summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlasdair Armstrong2019-02-15 18:19:26 +0000
committerAlasdair Armstrong2019-02-15 18:24:53 +0000
commit962b584da179b8737a67172d15d8cc58bb538fd6 (patch)
treee8d07f12fac8c537336fab7cd997406037924f75 /src
parenta62061fd64d3fb8a31f115a3d059da4346a13d85 (diff)
Fix bug in Int-synonym expansion
Diffstat (limited to 'src')
-rw-r--r--src/type_check.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/type_check.ml b/src/type_check.ml
index 65e13a19..0c936860 100644
--- a/src/type_check.ml
+++ b/src/type_check.ml
@@ -548,6 +548,10 @@ end = struct
match aux with
| NC_or (nc1, nc2) -> NC_aux (NC_or (expand_constraint_synonyms env nc1, expand_constraint_synonyms env nc2), l)
| NC_and (nc1, nc2) -> NC_aux (NC_and (expand_constraint_synonyms env nc1, expand_constraint_synonyms env nc2), l)
+ | NC_equal (n1, n2) -> NC_aux (NC_equal (expand_nexp_synonyms env n1, expand_nexp_synonyms env n2), l)
+ | NC_not_equal (n1, n2) -> NC_aux (NC_not_equal (expand_nexp_synonyms env n1, expand_nexp_synonyms env n2), l)
+ | NC_bounded_le (n1, n2) -> NC_aux (NC_bounded_le (expand_nexp_synonyms env n1, expand_nexp_synonyms env n2), l)
+ | NC_bounded_ge (n1, n2) -> NC_aux (NC_bounded_ge (expand_nexp_synonyms env n1, expand_nexp_synonyms env n2), l)
| NC_app (id, args) ->
(try
begin match Bindings.find id env.typ_synonyms l env args with
@@ -555,7 +559,7 @@ end = struct
| arg -> typ_error env l ("Expected Bool when expanding synonym " ^ string_of_id id ^ " got " ^ string_of_typ_arg arg)
end
with Not_found -> NC_aux (NC_app (id, List.map (expand_synonyms_arg env) args), l))
- | NC_true | NC_false | NC_equal _ | NC_not_equal _ | NC_bounded_le _ | NC_bounded_ge _ | NC_var _ | NC_set _ -> nc
+ | NC_true | NC_false | NC_var _ | NC_set _ -> nc
and expand_nexp_synonyms env (Nexp_aux (aux, l) as nexp) =
typ_debug ~level:2 (lazy ("Expanding " ^ string_of_nexp nexp));