diff options
| author | Gaëtan Gilbert | 2018-06-21 18:02:40 +0200 |
|---|---|---|
| committer | Gaëtan Gilbert | 2018-06-22 13:09:15 +0200 |
| commit | d236c7362053c4fc8f1c7f3b59248b412b029fb8 (patch) | |
| tree | b1f4186bb493a9b91a36b3a29d29b4dfef040404 /kernel/constr.ml | |
| parent | 0f12f2334e6c921a13e2e2186c44b7fb017714c1 (diff) | |
Define and use UGraph.enforce_leq_alg for subtyping inference
Not sure if worth using in other places.
Diffstat (limited to 'kernel/constr.ml')
| -rw-r--r-- | kernel/constr.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/constr.ml b/kernel/constr.ml index 4182293301..e68f906ec2 100644 --- a/kernel/constr.ml +++ b/kernel/constr.ml @@ -828,8 +828,10 @@ let leq_constr_univs_infer univs m n = let u1 = Sorts.univ_of_sort s1 and u2 = Sorts.univ_of_sort s2 in if UGraph.check_leq univs u1 u2 then true else - (cstrs := Univ.enforce_leq u1 u2 !cstrs; - true) + (try let c, _ = UGraph.enforce_leq_alg u1 u2 univs in + cstrs := Univ.Constraint.union c !cstrs; + true + with Univ.UniverseInconsistency _ -> false) in let rec eq_constr' nargs m n = m == n || compare_head_gen eq_universes eq_sorts eq_constr' nargs m n |
