From: roderick.chapman@googlemail.com
Subject: Re: SPARK and static unit checking?
Date: Mon, 14 Apr 2008 07:57:49 -0700 (PDT)
Date: 2008-04-14T07:57:49-07:00 [thread overview]
Message-ID: <87c37b48-d523-4d13-b10e-474cda527753@e67g2000hsa.googlegroups.com> (raw)
In-Reply-To: f6625d23-9ff0-417d-9d87-890cf52ec045@a22g2000hsc.googlegroups.com
SPARK has a few general princles regarding the arithmetic
operators.
1) They are always "monotonic" meaning they take and return the same
type - the binary operators, for example, always have the signature
(Left, Right : in T) return T
2) There is no re-declaration, renaming, or user-defined overloading
of the
operators, so "+" _always_ means "arithmetic addition" (which might
be signed integer, modular integer, floating, or fixed, of course...)
3) You can't change the base-name of an operator via a renaming,
which,
as Bob Duff pointed out in another thread, is a dreadful thing to do
anyway.
You can define functions with identifiers for names if you can put
up with having to write "My_Plus (A, B)" instead of "A + B" for
instance.
- Rod Chapman, SPARK Team
prev parent reply other threads:[~2008-04-14 14:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-11 9:59 SPARK and static unit checking? Jacob Sparre Andersen
2008-04-13 19:39 ` JP Thornley
2008-04-14 11:21 ` Jacob Sparre Andersen
2008-04-14 14:57 ` roderick.chapman [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox