Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion spectec/src/exe-spectec/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type pass =
| AliasDemut
| ImproveIds
| Ite
| DefToRel

(* This list declares the intended order of passes.

Expand All @@ -42,9 +43,10 @@ let all_passes = [
Totalize;
Else;
Uncaseremoval;
Sideconditions;
SubExpansion;
Sub;
DefToRel;
Sideconditions;
AliasDemut;
ImproveIds
]
Expand Down Expand Up @@ -112,6 +114,7 @@ let pass_flag = function
| Uncaseremoval -> "uncase-removal"
| ImproveIds -> "improve-ids"
| Ite -> "ite"
| DefToRel -> "definition-to-relation"

let pass_desc = function
| Sub -> "Synthesize explicit subtype coercions"
Expand All @@ -126,6 +129,7 @@ let pass_desc = function
| AliasDemut -> "Lifts type aliases out of mutual groups"
| ImproveIds -> "Disambiguates ids used from each other"
| Ite -> "If-then-else introduction"
| DefToRel -> "Transform specific function definitions into relations"


let run_pass : pass -> Il.Ast.script -> Il.Ast.script = function
Expand All @@ -141,6 +145,7 @@ let run_pass : pass -> Il.Ast.script -> Il.Ast.script = function
| AliasDemut -> Middlend.AliasDemut.transform
| ImproveIds -> Middlend.Improveids.transform
| Ite -> Middlend.Ite.transform
| DefToRel -> Middlend.Deftorel.transform


(* Argument parsing *)
Expand Down
3 changes: 3 additions & 0 deletions spectec/src/il/iter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sig
val visit_typ : typ -> unit
val visit_deftyp : deftyp -> unit
val visit_exp : exp -> unit
val visit_arg : arg -> unit
val visit_path : path -> unit
val visit_sym : sym -> unit
val visit_prem : prem -> unit
Expand Down Expand Up @@ -46,6 +47,7 @@ struct
let visit_typ _ = ()
let visit_deftyp _ = ()
let visit_exp _ = ()
let visit_arg _ = ()
let visit_path _ = ()
let visit_sym _ = ()
let visit_prem _ = ()
Expand Down Expand Up @@ -219,6 +221,7 @@ and prems prs = list prem prs
(* Definitions *)

and arg a =
visit_arg a;
match a.it with
| ExpA e -> exp e
| TypA t -> typ t
Expand Down
Loading
Loading