Quantcast
Channel: Dafny: An Automatic Program Verifier for Functional Correctness
Viewing all articles
Browse latest Browse all 1106

New Post: Induction hypothesis doesn't work?

$
0
0

Hi Zheng,

>>>>> Back to your second example, correct me if I am wrong, I do not think it is provable, since (n/m)*m != n, e.g. (1/2) * 2 == 0

Of course, it is not provable in general, but(n/m)*m != n <==> n%m==0.

So, I used it as a trick to avoid the use of the mod operator.

Thanks,

Paqui

De: zcheng [email removed]
Enviado el: viernes, 25 de septiembre de 2015 15:52
Para: [email removed]
Asunto: Re: Induction hypothesis doesn't work? [dafny:644665]

From: zcheng

Hi, as far as I remember, Dafny translates to Boogie, and Boogie has syntax for div and mod operator, but their operational semantics are not complete (since their operation semantics various from language to language, e.g. when negative numbers are involved, or whether 1/2 == 0).

Because of this level of incompleteness, when trivial lemma involve these operators, the user might need to help the verifier a little bit, e.g. rewrite the proof obligation to be simpler or expand/rewrite the definition of these operator. I find this is quite common during my experience with Dafny or Boogie.

Back to your second example, correct me if I am wrong, I do not think it is provable, since (n/m)*m != n, e.g. (1/2) * 2 == 0

Cheers, Zheng


Viewing all articles
Browse latest Browse all 1106

Trending Articles