The syntax of WhyML programs changed in release 1.0. The table in Figure A.1 summarizes the changes.
Note also that logical symbols can no longer be used in non-ghost code; in particular, there is no polymorphic equality in programs anymore, so equality functions must be declared/defined on a per-type basis (already done for type int in the standard library). The CHANGES.md file describes other potential sources of incompatibility.
version 0.88 version 1.0 function f ... let function f ... if called in programs ’L: label L in at x ’L x at L \x. e fun x -> e use HighOrd nothing, not needed anymore HighOrd.pred ty ty -> bool type t model ... type t = abstract ... abstract e ensures { Q } begin ensures { Q } e end namespace N scope N use import M use M "attribute" [@attribute] meta M prop P meta M lemma P or meta M axiom P or meta M goal P loop ... end while true do ... done type ... invariant { ... self.foo ... } type ... invariant { ... foo ... }
Figure A.1: Syntax changes from version 0.88 to version 1.0
The syntax of WhyML programs changed in release 0.80. The table in Figure A.2 summarizes the changes.
version 0.73 version 0.80 type t = {| field : int |} type t = { field : int } {| field = 5 |} { field = 5 } use import module M use import M let rec f (x:int) (y:int) : t
variant { t } with rel =
{ P }
e
{ Q }
| Exc1 -> { R1 }
| Exc2 n -> { R2 }let rec f (x:int) (y:int) : t
variant { t with rel }
requires { P }
ensures { Q }
raises { Exc1 -> R1
| Exc2 n -> R2 }
= eval f (x:int) (y:int) :
{ P }
t
writes a b
{ Q }
| Exc1 -> { R1 }
| Exc2 n -> { R2 }val f (x:int) (y:int) : t
requires { P }
writes { a, b }
ensures { Q }
raises { Exc1 -> R1
| Exc2 n -> R2 }val f : x:int -> y:int ->
{ P }
t
writes a b
{ Q }
| Exc1 -> { R1 }
| Exc2 n -> { R2 }val f (x y:int) : t
requires { P }
writes { a, b }
ensures { Q }
raises { Exc1 -> R1
| Exc2 n -> R2 }abstract e { Q } abstract e ensures { Q }
Figure A.2: Syntax changes from version 0.73 to version 0.80
The main new features with respect to Why 2.xx are the following.