diff options
| author | Jakob L. Kreuze | 2023-11-07 19:09:57 -0500 |
|---|---|---|
| committer | Jakob L. Kreuze | 2023-11-07 19:09:57 -0500 |
| commit | 12b90b940da4bd89d4d6f94bf8bde32a873741a4 (patch) | |
| tree | 16b6d575a19fb39f2fb4ebf1f74dcee3568db6ad | |
| parent | f4395c9955e2c6e082d10dcaf896bd82dfdc9023 (diff) | |
Re-instate assignment order assertion
| -rw-r--r-- | rego-proofs/compiler-rewrite/lib/compiler.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rego-proofs/compiler-rewrite/lib/compiler.ml b/rego-proofs/compiler-rewrite/lib/compiler.ml index 65e139c..af0d14b 100644 --- a/rego-proofs/compiler-rewrite/lib/compiler.ml +++ b/rego-proofs/compiler-rewrite/lib/compiler.ml @@ -283,8 +283,8 @@ let rec compile_expr env : expr -> (environ * lean_expression) = function (* Call is a special case, being the only kind of "term" that affects scope. *) | Call ((Var "assign", []), [ Var name; rhs ]) -> (* Assumption: `name' is in the `env' because of our up-front variable analysis, but we've marked it as unassigned. *) - let { lean_id; kind; _ } = Map.find_exn env name in - (* assert (not assigned) ; *) + let { lean_id; kind; assigned } = Map.find_exn env name in + assert ((not assigned) || not (equal_definition_kind kind Complete)) ; let variable = { assigned = true; lean_id; kind } in let env' = Map.set env ~key:name ~data:variable in |