From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: SPARK understand me very well... me neither
Date: Sat, 14 Aug 2010 18:57:57 +0200
Date: 2010-08-14T18:57:57+02:00 [thread overview]
Message-ID: <op.vhftevalule2fv@garhos> (raw)
In-Reply-To: 2308d0a0-8fdb-41a0-b2dc-6b30a2bf2f18@v41g2000yqv.googlegroups.com
Le Sat, 14 Aug 2010 18:04:23 +0200, Phil Thornley
<phil.jpthornley@gmail.com> a écrit:
> So I would much prefer the simple and obvious version of the
> precondition and code to be the version on Rosetta Code so that anyone
> browsing that site for information about SPARK doesn't get a wrong
> view of the language.
Updated with this added comment :
> Note: how do you ensure then “A * B in Natural” ? Either with
> a proof prior to Multiply invokation or using another form
> of Multiply where input A and B would be restricted to a range
> which ensures the resulting product is always valid. Exemple :
> type Input_Type is range 0 .. 10;
> type Result_Type is range 0 .. 100;
> and had a version of Multiply using these types.
> On the other hand, if arguments of Multiply are constants, this
> is provable straight away.
I wanted to add this comment, because the How is of a practicable
importance.
--
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
-- i.e. forget about previous premises which leads to conclusion
-- and start with new conclusion as premise.
prev parent reply other threads:[~2010-08-14 16:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-13 20:12 SPARK understand me very well... me neither Yannick Duchêne (Hibou57)
2010-08-14 4:57 ` Yannick Duchêne (Hibou57)
2010-08-14 16:04 ` Phil Thornley
2010-08-14 16:44 ` Yannick Duchêne (Hibou57)
2010-08-14 19:08 ` Phil Thornley
2010-08-14 20:48 ` Yannick Duchêne (Hibou57)
2010-08-14 21:07 ` Yannick Duchêne (Hibou57)
2010-08-14 21:50 ` Jeffrey Carter
2010-08-14 22:20 ` Yannick Duchêne (Hibou57)
2010-08-15 0:45 ` Yannick Duchêne (Hibou57)
2010-08-14 16:57 ` Yannick Duchêne (Hibou57) [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