Skip to content

Commit 2560ad0

Browse files
authored
Merge pull request #777 from LPCIC/fix-704
fix #704
2 parents c75f270 + f8acd78 commit 2560ad0

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

apps/locker/elpi/locker.elpi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module-lock ID Bo Arity UnivDecl :- std.do! [
4343
% extra universe constraints (if upoly) which are necessary for the body!
4444
if (UnivDecl = some UD)
4545
(std.do![
46-
PTY = {{ lp:Bo = lp:Bo }},
46+
PTY = {{ @eq lp:Ty lp:Bo lp:Bo }},
4747
std.assert-ok! (coq.typecheck-ty PTY _) "lock: unlock statement illtyped",
4848
P = {{ @refl_equal lp:Ty lp:Bo }},
4949
std.assert-ok! (coq.typecheck P PTY) "locker: unlock proof illtyped",
@@ -83,10 +83,10 @@ lock-module-body Signature ID Ty Bo UnivDecl B M :- std.do! [
8383
if (UnivDecl = some UD) (coq.upoly-decl->attribute UD Poly!) (Poly! = true),
8484
Poly! => coq.env.add-const "body" Bo Ty @transparent! C,
8585
coq.env.global (const C) B,
86-
P = {{ @refl_equal lp:Ty lp:B }},
87-
std.assert-ok! (coq.typecheck P _) "locker: unlock proof illtyped",
8886
PTY = {{ lp:B = lp:Bo }},
8987
std.assert-ok! (coq.typecheck-ty PTY _) "locker: unlock statement illtyped",
88+
P = {{ @refl_equal lp:Ty lp:B }},
89+
std.assert-ok! (coq.typecheck P PTY) "locker: unlock proof illtyped",
9090
if (UnivDecl = some UD) (coq.upoly-decl.complete-constraints UD UD1, coq.upoly-decl->attribute UD1 Poly1!) (Poly1! = true),
9191
Poly1! => coq.env.add-const "unlock" P PTY @opaque! _,
9292
coq.env.end-module M,

apps/locker/tests/test_locker.v

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,8 @@ About up2.body.
111111
Elpi Query lp:{{ coq.locate "up2" GR, coq.env.univpoly? GR 2 }}.
112112

113113
Fail mlock Definition up3@{u} (T : Type@{u}) (W : Type) (x : T) := x.
114+
115+
(* #704 ----------------------- *)
116+
117+
Set Universe Polymorphism.
118+
mlock Definition Bla (T : bool) : Type := nat.

apps/locker/theories/locker.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ Elpi Accumulate lp:{{
8989
main _ :- coq.error "Usage: mlock Definition ...".
9090
}}.
9191

92-
Elpi Export mlock.
92+
Elpi Export mlock.

0 commit comments

Comments
 (0)