Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
George Pirlea
Iris
Commits
a1fcf5b3
Commit
a1fcf5b3
authored
Nov 11, 2017
by
Robbert Krebbers
Browse files
Add a data type for possibly anonymous proof mode hypotheses.
parent
3dccde8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/proofmode/base.v
View file @
a1fcf5b3
...
...
@@ -49,3 +49,37 @@ Qed.
Lemma
string_beq_reflect
s1
s2
:
reflect
(
s1
=
s2
)
(
string_beq
s1
s2
).
Proof
.
apply
iff_reflect
.
by
rewrite
string_beq_true
.
Qed
.
Module
Export
ident
.
Inductive
ident
:
=
|
IAnon
:
positive
→
ident
|
INamed
:
>
string
→
ident
.
End
ident
.
Instance
maybe_IAnon
:
Maybe
IAnon
:
=
λ
i
,
match
i
with
IAnon
n
=>
Some
n
|
_
=>
None
end
.
Instance
maybe_INamed
:
Maybe
INamed
:
=
λ
i
,
match
i
with
INamed
s
=>
Some
s
|
_
=>
None
end
.
Instance
beq_eq_dec
:
EqDecision
ident
.
Proof
.
solve_decision
.
Defined
.
Definition
positive_beq
:
=
Eval
compute
in
Pos
.
eqb
.
Lemma
positive_beq_true
x
y
:
positive_beq
x
y
=
true
↔
x
=
y
.
Proof
.
apply
Pos
.
eqb_eq
.
Qed
.
Definition
ident_beq
(
i1
i2
:
ident
)
:
bool
:
=
match
i1
,
i2
with
|
IAnon
n1
,
IAnon
n2
=>
positive_beq
n1
n2
|
INamed
s1
,
INamed
s2
=>
string_beq
s1
s2
|
_
,
_
=>
false
end
.
Lemma
ident_beq_true
i1
i2
:
ident_beq
i1
i2
=
true
↔
i1
=
i2
.
Proof
.
destruct
i1
,
i2
;
rewrite
/=
?string_beq_true
?positive_beq_true
;
naive_solver
.
Qed
.
Lemma
ident_beq_reflect
i1
i2
:
reflect
(
i1
=
i2
)
(
ident_beq
i1
i2
).
Proof
.
apply
iff_reflect
.
by
rewrite
ident_beq_true
.
Qed
.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment