Commit f118cf52 authored by Andrei Paskevich's avatar Andrei Paskevich
Browse files

whyml: specification typing, part 1

parent 2ac5d569
...@@ -29,38 +29,41 @@ open Mlw_module ...@@ -29,38 +29,41 @@ open Mlw_module
open Mlw_dty open Mlw_dty
type loc = Loc.position type loc = Loc.position
type ident = Ptree.ident type ident = Ptree.ident
(* user type_v *)
type ghost = bool type ghost = bool
type dpre = Ptree.pre type dpre = Ptree.pre
type dpost = Ptree.pre type dpost = Ptree.pre
type dxpost = (xsymbol * dpost) list type dxpost = (xsymbol * dpost) list
type dbinder = ident * ghost * dity type dbinder = ident * ghost * dity
(** type deffect = {
type dutype_v = deff_reads : (ghost * Ptree.lexpr) list;
| DUTpure of Denv.dty deff_writes : (ghost * Ptree.lexpr) list;
| DUTarrow of dbinder list * dutype_c deff_raises : (ghost * xsymbol) list;
}
and dutype_c = type dtype_v =
{ duc_result_type : dutype_v; | DSpecV of dity
duc_effect : deffect; | DSpecA of dbinder list * dtype_c
duc_pre : Ptree.lexpr;
duc_post : Ptree.lexpr * (Term.lsymbol * Ptree.lexpr) list; } and dtype_c = {
**) dc_result : dtype_v;
dc_effect : deffect;
dc_pre : dpre;
dc_post : dpost;
dc_xpost : dxpost;
}
type dvariant = Ptree.lexpr * Term.lsymbol option type dvariant = Ptree.lexpr * Term.lsymbol option
type dinvariant = Ptree.lexpr option type dinvariant = Ptree.lexpr option
type dexpr = { type dexpr = {
dexpr_desc : dexpr_desc; de_desc : dexpr_desc;
dexpr_type : dity; de_type : dity;
dexpr_lab : Ident.label list; de_lab : Ident.label list;
dexpr_loc : loc; de_loc : loc;
} }
and dexpr_desc = and dexpr_desc =
...@@ -87,18 +90,8 @@ and dexpr_desc = ...@@ -87,18 +90,8 @@ and dexpr_desc =
| DEassert of Ptree.assertion_kind * Ptree.lexpr | DEassert of Ptree.assertion_kind * Ptree.lexpr
| DEmark of ident * dexpr | DEmark of ident * dexpr
| DEghost of dexpr | DEghost of dexpr
(* | DEany of dtype_c
| DEany of deffect
*)
and drecfun = ident * dity * dlambda and drecfun = ident * dity * dlambda
and dlambda = dbinder list * dvariant list * dpre * dexpr * dpost * dxpost and dlambda = dbinder list * dvariant list * dpre * dexpr * dpost * dxpost
(*
and deffect = {
deff_reads : dexpr list;
deff_writes : dexpr list;
deff_raises : (ghost * xsymbol) list;
}
*)
This diff is collapsed.
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