Commit e63b87af authored by Jean-Christophe Filliâtre's avatar Jean-Christophe Filliâtre
Browse files

programs: type-checking the any construct

parent 726da3e1
{
type char
use array.ArrayLength as S
type string = S.t char
logic empty_string : string
type rope =
| Str string (*ofs:*) int (len: int)
| App rope rope (len: int)
}
let empty () = Str empty_string 0 0
let length r = len r
(*
Local Variables:
compile-command: "unset LANG; make -C ../.. examples/programs/ropes"
End:
*)
......@@ -1023,8 +1023,8 @@ and expr_desc gl env loc ty = function
| IElabel (lab, e1) ->
let e1 = expr gl env e1 in
Elabel (lab, e1), e1.expr_type_v, e1.expr_effect
| IEany _ ->
assert false (*TODO*)
| IEany c ->
Eany c, c.c_result_type, c.c_effect
and triple gl env (p, e, q) =
let e = expr gl env e in
......
let foo () =
{}
any {} int {result=2} + 1
{result=3}
let rec div x y variant {x} =
{ 0 <= x and 0 < y }
if y < x then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment