Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cpdt
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
research
cpdt
Commits
7422c99a
Commit
7422c99a
authored
Nov 18, 2008
by
Adam Chlipala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Templatize Impure
parent
20dc1def
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
Impure.v
src/Impure.v
+12
-0
No files found.
src/Impure.v
View file @
7422c99a
...
@@ -67,6 +67,7 @@ Module impredicative.
...
@@ -67,6 +67,7 @@ Module impredicative.
->
eval
(
c2
v1
)
v2
->
eval
(
c2
v1
)
v2
->
eval
(
Bind
c1
c2
)
v2
.
->
eval
(
Bind
c1
c2
)
v2
.
(
*
begin
thide
*
)
Fixpoint
termDenote
(
e
:
term
dynamic
)
:
computation
dynamic
:=
Fixpoint
termDenote
(
e
:
term
dynamic
)
:
computation
dynamic
:=
match
e
with
match
e
with
|
Var
v
=>
Return
v
|
Var
v
=>
Return
v
...
@@ -78,6 +79,7 @@ Module impredicative.
...
@@ -78,6 +79,7 @@ Module impredicative.
|
Unit
=>
Return
(
Dyn
tt
)
|
Unit
=>
Return
(
Dyn
tt
)
end
.
end
.
(
*
end
thide
*
)
Definition
TermDenote
(
E
:
Term
)
:=
termDenote
(
E
_
)
.
Definition
TermDenote
(
E
:
Term
)
:=
termDenote
(
E
_
)
.
...
@@ -87,15 +89,18 @@ Module impredicative.
...
@@ -87,15 +89,18 @@ Module impredicative.
Eval
compute
in
TermDenote
ident_unit
.
Eval
compute
in
TermDenote
ident_unit
.
Theorem
eval_ident_unit
:
eval
(
TermDenote
ident_unit
)
(
Dyn
tt
)
.
Theorem
eval_ident_unit
:
eval
(
TermDenote
ident_unit
)
(
Dyn
tt
)
.
(
*
begin
thide
*
)
compute
.
compute
.
repeat
econstructor
.
repeat
econstructor
.
simpl
.
simpl
.
constructor
.
constructor
.
Qed
.
Qed
.
(
*
end
thide
*
)
Theorem
invert_ident
:
forall
(
E
:
Term
)
d
,
Theorem
invert_ident
:
forall
(
E
:
Term
)
d
,
eval
(
TermDenote
(
fun
_
=>
ident
_
@
E
_
))
d
eval
(
TermDenote
(
fun
_
=>
ident
_
@
E
_
))
d
->
eval
(
TermDenote
E
)
d
.
->
eval
(
TermDenote
E
)
d
.
(
*
begin
thide
*
)
inversion
1.
inversion
1.
crush
.
crush
.
...
@@ -106,6 +111,7 @@ Module impredicative.
...
@@ -106,6 +111,7 @@ Module impredicative.
simpl
in
H0
.
simpl
in
H0
.
(
**
[
injection
H0
.
]
*
)
(
**
[
injection
H0
.
]
*
)
Abort
.
Abort
.
(
*
end
thide
*
)
End
impredicative
.
End
impredicative
.
...
@@ -147,6 +153,7 @@ Module predicative.
...
@@ -147,6 +153,7 @@ Module predicative.
->
eval
ds
(
f
d2
)
ds
'
d3
->
eval
ds
(
f
d2
)
ds
'
d3
->
eval
ds
(
CApp
(
Func
i
)
d2
)
ds
'
d3
.
->
eval
ds
(
CApp
(
Func
i
)
d2
)
ds
'
d3
.
(
*
begin
thide
*
)
Fixpoint
termDenote
(
e
:
term
val
)
:
computation
:=
Fixpoint
termDenote
(
e
:
term
val
)
:
computation
:=
match
e
with
match
e
with
|
Var
v
=>
Return
v
|
Var
v
=>
Return
v
...
@@ -157,6 +164,7 @@ Module predicative.
...
@@ -157,6 +164,7 @@ Module predicative.
|
Unit
=>
Return
VUnit
|
Unit
=>
Return
VUnit
end
.
end
.
(
*
end
thide
*
)
Definition
TermDenote
(
E
:
Term
)
:=
termDenote
(
E
_
)
.
Definition
TermDenote
(
E
:
Term
)
:=
termDenote
(
E
_
)
.
...
@@ -166,6 +174,7 @@ Module predicative.
...
@@ -166,6 +174,7 @@ Module predicative.
Eval
compute
in
TermDenote
ident_unit
.
Eval
compute
in
TermDenote
ident_unit
.
Theorem
eval_ident_unit
:
exists
ds
,
eval
nil
(
TermDenote
ident_unit
)
ds
VUnit
.
Theorem
eval_ident_unit
:
exists
ds
,
eval
nil
(
TermDenote
ident_unit
)
ds
VUnit
.
(
*
begin
thide
*
)
compute
.
compute
.
repeat
econstructor
.
repeat
econstructor
.
simpl
.
simpl
.
...
@@ -207,10 +216,12 @@ Module predicative.
...
@@ -207,10 +216,12 @@ Module predicative.
|
[
|-
context
[
if
?
E
then
_
else
_
]
]
=>
destruct
E
|
[
|-
context
[
if
?
E
then
_
else
_
]
]
=>
destruct
E
end
;
crush
.
end
;
crush
.
Qed
.
Qed
.
(
*
end
thide
*
)
Theorem
invert_ident
:
forall
(
E
:
Term
)
ds
ds
'
d
,
Theorem
invert_ident
:
forall
(
E
:
Term
)
ds
ds
'
d
,
eval
ds
(
TermDenote
(
fun
_
=>
ident
_
@
E
_
))
ds
'
d
eval
ds
(
TermDenote
(
fun
_
=>
ident
_
@
E
_
))
ds
'
d
->
eval
((
fun
x
=>
Return
x
)
::
ds
)
(
TermDenote
E
)
ds
'
d
.
->
eval
((
fun
x
=>
Return
x
)
::
ds
)
(
TermDenote
E
)
ds
'
d
.
(
*
begin
thide
*
)
inversion
1
;
subst
.
inversion
1
;
subst
.
clear
H
.
clear
H
.
inversion
H3
;
clear
H3
;
subst
.
inversion
H3
;
clear
H3
;
subst
.
...
@@ -222,5 +233,6 @@ Module predicative.
...
@@ -222,5 +233,6 @@ Module predicative.
inversion
H7
;
clear
H7
;
subst
.
inversion
H7
;
clear
H7
;
subst
.
assumption
.
assumption
.
Qed
.
Qed
.
(
*
end
thide
*
)
End
predicative
.
End
predicative
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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