comp.lang.ada
 help / color / mirror / Atom feed
* Proving A Loop will Terminate in SPARK Question
@ 2017-03-08 21:25 bakolden5
  2017-03-09 15:13 ` Phil Thornley
  0 siblings, 1 reply; 2+ messages in thread
From: bakolden5 @ 2017-03-08 21:25 UTC (permalink / raw)


I got my hands on "Building High Integrity Applications with SPARK" and wanted to do some tests with loop proofs. I quickly ran into a case that I did not know how to verify.

	procedure Test is
		type Big is mod 2**16;
		I : Big := 1;
	begin
		while I /= 0 loop
			I := 2**Natural(I);
		end loop;
	end Test;

Theoretically, this loop will end however if the condition was I /= 256, it will not. Is it possible to check if I will reach the condition, given a specific starting value of I (1, in this case)?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-09 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-08 21:25 Proving A Loop will Terminate in SPARK Question bakolden5
2017-03-09 15:13 ` Phil Thornley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox