diff options
| author | Thomas Bauereiss | 2019-01-28 21:21:16 +0000 |
|---|---|---|
| committer | Thomas Bauereiss | 2019-01-28 21:21:16 +0000 |
| commit | b826df25ee3ec624483b8486af211e6d1e965589 (patch) | |
| tree | 28c9dc2627f21ba76ac9ddc2ca0c0b13e7028125 /src/pretty_print_lem.ml | |
| parent | e3266e1ce5463d57f3d35c89dc811348f76c9e41 (diff) | |
Lem: Be more careful about nexps occurring in the function signature
Don't ask Z3 to simplify them, as flow typing might lead to different
results in different if-branches, for example, leading to type errors in
Lem.
Diffstat (limited to 'src/pretty_print_lem.ml')
| -rw-r--r-- | src/pretty_print_lem.ml | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pretty_print_lem.ml b/src/pretty_print_lem.ml index 5c67f93a..c0af581a 100644 --- a/src/pretty_print_lem.ml +++ b/src/pretty_print_lem.ml @@ -349,14 +349,14 @@ let replace_typ_size ctxt env (Typ_aux (t,a)) = let mk_typ nexp = Some (Typ_aux (Typ_app (id, [A_aux (A_nexp nexp,Parse_ast.Unknown);ord;typ']),a)) in - match Type_check.solve env size with - | Some n -> mk_typ (nconstant n) - | None -> - let is_equal nexp = - prove env (NC_aux (NC_equal (size,nexp),Parse_ast.Unknown)) - in match List.find is_equal (NexpSet.elements ctxt.bound_nexps) with - | nexp -> mk_typ nexp - | exception Not_found -> None + let is_equal nexp = + prove env (NC_aux (NC_equal (size,nexp),Parse_ast.Unknown)) + in match List.find is_equal (NexpSet.elements ctxt.bound_nexps) with + | nexp -> mk_typ nexp + | exception Not_found -> + match Type_check.solve env size with + | Some n -> mk_typ (nconstant n) + | None -> None end | _ -> None |
