Skip to content

Commit

Permalink
Do not allow setting named quality variables above prop
Browse files Browse the repository at this point in the history
  • Loading branch information
SkySkimmer committed Jun 18, 2024
1 parent 5ea287a commit ebef1de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions engine/uState.ml
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,20 @@ let set q qv m =
Some { named = m.named; qmap = QMap.add q (Some qv) m.qmap; above = QSet.remove q m.above }

let set_above_prop q m =
(* XXX fail if named? *)
let q = repr q m in
let q = match q with QVar q -> q | QConstant _ -> assert false in
{ named = m.named; qmap = m.qmap; above = QSet.add q m.above }
if QSet.mem q m.named then None
else Some { named = m.named; qmap = m.qmap; above = QSet.add q m.above }

let unify_quality ~fail c q1 q2 local = match q1, q2 with
| QConstant QType, QConstant QType
| QConstant QProp, QConstant QProp
| QConstant QSProp, QConstant QSProp -> local
| QConstant QProp, QVar q when c == Conversion.CUMUL ->
set_above_prop q local
begin match set_above_prop q local with
| Some local -> local
| None -> fail ()
end
| QVar qv1, QVar qv2 -> begin match set qv1 q2 local with
| Some local -> local
| None -> match set qv2 q1 local with
Expand Down
3 changes: 3 additions & 0 deletions test-suite/bugs/bug_19231.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Set Universe Polymorphism.

Fail Lemma vroom@{q| |} : (True : Type@{q|_}).

0 comments on commit ebef1de

Please sign in to comment.