Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
702fbtngus committed Sep 23, 2024
1 parent 229b01e commit 6cf0808
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions spectec/src/backend-prose/gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let is_empty_context_rel def =
| Ast.RelD (_, [ { it = El.Atom.Turnstile; _} ] :: _, _, _) -> true
| _ -> false

let preprocess_il il =
let extract_validation_il il =
il
|> List.concat_map flatten_rec
|> List.filter (fun rel -> is_context_rel rel || is_empty_context_rel rel)
Expand Down Expand Up @@ -181,7 +181,7 @@ let rec prem_to_instrs prem =
| Ast.IfPr e ->
if_expr_to_instrs e
| Ast.RulePr (id, _, e) ->
let rel = match List.find_opt (rel_has_id id) !Langs.preprocessed_il with Some rel -> rel | None -> failwith id.it in
let rel = match List.find_opt (rel_has_id id) !Langs.validation_il with Some rel -> rel | None -> failwith id.it in
let args = exp_to_argexpr e in
( match get_rel_kind rel, args with
(* contextless *)
Expand Down Expand Up @@ -518,7 +518,7 @@ let postprocess_prose defs =

(** Entry for generating validation prose **)
let gen_validation_prose () =
prose_of_rels (!Langs.preprocessed_il)
prose_of_rels (!Langs.validation_il)

let get_state_arg_opt f =
let arg = ref (Al.Ast.TypA (Il.Ast.BoolT $ no_region)) in
Expand Down Expand Up @@ -596,7 +596,7 @@ let gen_execution_prose () =
(** Main entry for generating prose **)
let gen_prose el il al =
Langs.el := el;
Langs.preprocessed_il := preprocess_il il;
Langs.validation_il := extract_validation_il il;
Langs.il := il;
Langs.al := al;

Expand Down
2 changes: 1 addition & 1 deletion spectec/src/backend-prose/langs.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let el = ref []
let preprocessed_il = ref []
let validation_il = ref []
let il = ref []
let al = ref []
2 changes: 1 addition & 1 deletion spectec/src/backend-prose/langs.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
val el : El.Ast.script ref
val preprocessed_il : Il.Ast.script ref
val validation_il : Il.Ast.script ref
val il : Il.Ast.script ref
val al : Al.Ast.script ref

0 comments on commit 6cf0808

Please sign in to comment.