- 08 Jun, 2017 20 commits
-
-
Andrei Paskevich authored
x.{f} is allowed and can be used for unary applications M.{f} is not allowed, use {M.f} instead
-
Martin Clochard authored
-
Andrei Paskevich authored
It is confusing to use the keyword "label" to define an exception. Also, the "label L in ..." binds too far and the break point is not clearly defined. We do need some syntactic sugar for exception X t in try <expr> with X r -> r (at the very least "break" and "continue"), but labels are not it.
-
Andrei Paskevich authored
-
Andrei Paskevich authored
-
MARCHE Claude authored
-
Martin Clochard authored
-
Martin Clochard authored
-
MARCHE Claude authored
-
MARCHE Claude authored
-
MARCHE Claude authored
-
MARCHE Claude authored
-
MARCHE Claude authored
-
MARCHE Claude authored
-
Mário Pereira authored
-
Jean-Christophe Filliâtre authored
-
Jean-Christophe Filliâtre authored
-
Andrei Paskevich authored
In the surface language, the loop index is always int in the loop invariant and all annotations and pure terms inside the loop. If you want to access the original range-typed index, use "let copy_i = i in" in the program code before your assertion. Of course, you cannot do that for the loop invariant, which is what we want.
-
Martin Clochard authored
Reason for that change: interpret correctly both (1) A by B -> C and (2) A -> B by C Case (2) is common, and we expect by to take precendence, so that A is the context for the proof of B. Case (1) is rarer, and is troublesome if by take precendence cause (A by B) -> C is almost certainly not what the user intended to write. Putting precendence of by/so at the same level as the arrow fix this
-
Andrei Paskevich authored
At this moment, there is no semantics change. This commit only provides dedicated grammar rules for negated numerals, so that we do not have to recognize them later.
-
- 07 Jun, 2017 4 commits
-
-
Mário Pereira authored
-
Martin Clochard authored
-
Mário Pereira authored
-
Mário Pereira authored
-
- 06 Jun, 2017 13 commits
-
-
Andrei Paskevich authored
-
Andrei Paskevich authored
This allows to import an existing scope to the current namespace. Not sure if we need this in the surface language, though.
-
Andrei Paskevich authored
In this way, someone who puts a part of his function in an abstract block will not have broken "return"s.
-
Andrei Paskevich authored
-
Jean-Christophe Filliâtre authored
-
Jean-Christophe Filliâtre authored
-
Jean-Christophe Filliâtre authored
-
Jean-Christophe Filliâtre authored
-
Mário Pereira authored
-
Mário Pereira authored
-
Mário Pereira authored
-
Andrei Paskevich authored
-
Andrei Paskevich authored
-
- 05 Jun, 2017 3 commits
-
-
Andrei Paskevich authored
Useful to break out of the loops: label Break in while ... do label Continue in ... raise Break ... ... raise Continue ... done When a label is put over a non-unit expression, raise acts as return: label Return in if ... then raise Return 42; 0 Also, "return <expr>" returns from the innermost function. This includes abstract blocks, too, so if you want to return across an abstract block, you should rather use a label at the top of the main function. TODO/FIXME: maybe we should let "return" pass across abstract blocks by default, to avoid surprises? One shortcoming of the labels-as-exceptions is that they cannot be used to transmit tuples with ghost elements, nor return ghost values from non-ghost expressions. A local exception with an explicit mask should be used instead. Similarly, to return a partially ghost value from a function, it must have have its mask explicitly written (which is a good practice anyway). We cannot know the mask of an expr before we construct it, but in order to construct it, we need to create the local exceptions first. Another caveat is that while it is possible to catch an exception generated by a label, you should avoid to do so. We only declare the local exception if the expression under the label _raises_ the exception, and thus the following code will not typecheck: label X in (try raise X with X -> () end) Indeed, the expression in the parentheses does not raise X, and so we do not declare a local exception X for this label, and so the program contains an undeclared exception symbol.
-
Andrei Paskevich authored
current syntax is exception Return (int, ghost bool) in ... try ... raise Return (5, false) ... with Return (i, b) -> ... ... These exceptions can carry mutable and non-monomorphic values. They can be raised from local functions defined in the scope of the exception declaration.
-
Andrei Paskevich authored
-