Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tej Chajed
iris
Commits
483e9a03
Commit
483e9a03
authored
8 years ago
by
Jacques-Henri Jourdan
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.mpi-sws.org:FP/iris-coq
parents
416f4dfb
a9f8d0f0
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
proofmode/intro_patterns.v
+13
-12
13 additions, 12 deletions
proofmode/intro_patterns.v
proofmode/spec_patterns.v
+21
-24
21 additions, 24 deletions
proofmode/spec_patterns.v
proofmode/tactics.v
+7
-1
7 additions, 1 deletion
proofmode/tactics.v
tests/proofmode.v
+1
-1
1 addition, 1 deletion
tests/proofmode.v
with
42 additions
and
38 deletions
proofmode/intro_patterns.v
+
13
−
12
View file @
483e9a03
...
@@ -13,7 +13,7 @@ Inductive intro_pat :=
...
@@ -13,7 +13,7 @@ Inductive intro_pat :=
|
INext
:
intro_pat
|
INext
:
intro_pat
|
IForall
:
intro_pat
|
IForall
:
intro_pat
|
IAll
:
intro_pat
|
IAll
:
intro_pat
|
IClear
:
list
string
→
intro_pat
.
|
IClear
:
list
(
bool
*
string
)
→
intro_pat
.
(* true = frame, false = clear *)
Module
intro_pat
.
Module
intro_pat
.
Inductive
token
:=
Inductive
token
:=
...
@@ -71,8 +71,7 @@ Inductive stack_item :=
...
@@ -71,8 +71,7 @@ Inductive stack_item :=
|
SList
:
stack_item
|
SList
:
stack_item
|
SConjList
:
stack_item
|
SConjList
:
stack_item
|
SBar
:
stack_item
|
SBar
:
stack_item
|
SAmp
:
stack_item
|
SAmp
:
stack_item
.
|
SClear
:
stack_item
.
Notation
stack
:=
(
list
stack_item
)
.
Notation
stack
:=
(
list
stack_item
)
.
Fixpoint
close_list
(
k
:
stack
)
Fixpoint
close_list
(
k
:
stack
)
...
@@ -108,13 +107,6 @@ Fixpoint close_conj_list (k : stack)
...
@@ -108,13 +107,6 @@ Fixpoint close_conj_list (k : stack)
|
_
=>
None
|
_
=>
None
end
.
end
.
Fixpoint
close_clear
(
k
:
stack
)
(
ss
:
list
string
)
:
option
stack
:=
match
k
with
|
SPat
(
IName
s
)
::
k
=>
close_clear
k
(
s
::
ss
)
|
SClear
::
k
=>
Some
(
SPat
(
IClear
(
reverse
ss
))
::
k
)
|
_
=>
None
end
.
Fixpoint
parse_go
(
ts
:
list
token
)
(
k
:
stack
)
:
option
stack
:=
Fixpoint
parse_go
(
ts
:
list
token
)
(
k
:
stack
)
:
option
stack
:=
match
ts
with
match
ts
with
|
[]
=>
Some
k
|
[]
=>
Some
k
...
@@ -135,9 +127,18 @@ Fixpoint parse_go (ts : list token) (k : stack) : option stack :=
...
@@ -135,9 +127,18 @@ Fixpoint parse_go (ts : list token) (k : stack) : option stack :=
|
TNext
::
ts
=>
parse_go
ts
(
SPat
INext
::
k
)
|
TNext
::
ts
=>
parse_go
ts
(
SPat
INext
::
k
)
|
TAll
::
ts
=>
parse_go
ts
(
SPat
IAll
::
k
)
|
TAll
::
ts
=>
parse_go
ts
(
SPat
IAll
::
k
)
|
TForall
::
ts
=>
parse_go
ts
(
SPat
IForall
::
k
)
|
TForall
::
ts
=>
parse_go
ts
(
SPat
IForall
::
k
)
|
TClearL
::
ts
=>
parse_go
ts
(
SClear
::
k
)
|
TClearL
::
ts
=>
parse_clear
ts
[]
k
|
TClearR
::
ts
=>
close_clear
k
[]
≫=
parse_go
ts
|
_
=>
None
end
with
parse_clear
(
ts
:
list
token
)
(
ss
:
list
(
bool
*
string
))
(
k
:
stack
)
:
option
stack
:=
match
ts
with
|
TFrame
::
TName
s
::
ts
=>
parse_clear
ts
((
true
,
s
)
::
ss
)
k
|
TName
s
::
ts
=>
parse_clear
ts
((
false
,
s
)
::
ss
)
k
|
TClearR
::
ts
=>
parse_go
ts
(
SPat
(
IClear
(
reverse
ss
))
::
k
)
|
_
=>
None
end
.
end
.
Definition
parse
(
s
:
string
)
:
option
(
list
intro_pat
)
:=
Definition
parse
(
s
:
string
)
:
option
(
list
intro_pat
)
:=
match
k
←
parse_go
(
tokenize
s
)
[
SList
];
close_list
k
[]
[]
with
match
k
←
parse_go
(
tokenize
s
)
[
SList
];
close_list
k
[]
[]
with
|
Some
[
SPat
(
IList
[
ps
])]
=>
Some
ps
|
Some
[
SPat
(
IList
[
ps
])]
=>
Some
ps
...
...
This diff is collapsed.
Click to expand it.
proofmode/spec_patterns.v
+
21
−
24
View file @
483e9a03
...
@@ -42,32 +42,29 @@ Inductive state :=
...
@@ -42,32 +42,29 @@ Inductive state :=
|
StTop
:
state
|
StTop
:
state
|
StAssert
:
spec_goal_kind
→
bool
→
list
string
→
state
.
|
StAssert
:
spec_goal_kind
→
bool
→
list
string
→
state
.
Fixpoint
parse_go
(
ts
:
list
token
)
(
s
:
state
)
Fixpoint
parse_go
(
ts
:
list
token
)
(
k
:
list
spec_pat
)
:
option
(
list
spec_pat
)
:=
(
k
:
list
spec_pat
)
:
option
(
list
spec_pat
)
:=
match
ts
with
match
s
with
|
[]
=>
Some
(
rev
k
)
|
StTop
=>
|
TName
s
::
ts
=>
parse_go
ts
(
SName
false
s
::
k
)
match
ts
with
|
TBracketL
::
TPersistent
::
TBracketR
::
ts
=>
parse_go
ts
(
SGoalPersistent
::
k
)
|
[]
=>
Some
(
rev
k
)
|
TBracketL
::
TPure
::
TBracketR
::
ts
=>
parse_go
ts
(
SGoalPure
::
k
)
|
TName
s
::
ts
=>
parse_go
ts
StTop
(
SName
false
s
::
k
)
|
TBracketL
::
ts
=>
parse_goal
ts
GoalStd
false
[]
k
|
TBracketL
::
TPersistent
::
TBracketR
::
ts
=>
parse_go
ts
StTop
(
SGoalPersistent
::
k
)
|
TPvs
::
TBracketL
::
ts
=>
parse_goal
ts
GoalPvs
false
[]
k
|
TBracketL
::
TPure
::
TBracketR
::
ts
=>
parse_go
ts
StTop
(
SGoalPure
::
k
)
|
TPvs
::
ts
=>
parse_go
ts
(
SGoal
GoalPvs
true
[]
::
k
)
|
TBracketL
::
ts
=>
parse_go
ts
(
StAssert
GoalStd
false
[])
k
|
TPersistent
::
TName
s
::
ts
=>
parse_go
ts
(
SName
true
s
::
k
)
|
TPvs
::
TBracketL
::
ts
=>
parse_go
ts
(
StAssert
GoalPvs
false
[])
k
|
TForall
::
ts
=>
parse_go
ts
(
SForall
::
k
)
|
TPvs
::
ts
=>
parse_go
ts
StTop
(
SGoal
GoalPvs
true
[]
::
k
)
|
_
=>
None
|
TPersistent
::
TName
s
::
ts
=>
parse_go
ts
StTop
(
SName
true
s
::
k
)
end
|
TForall
::
ts
=>
parse_go
ts
StTop
(
SForall
::
k
)
with
parse_goal
(
ts
:
list
token
)
(
kind
:
spec_goal_kind
)
|
_
=>
None
(
neg
:
bool
)
(
ss
:
list
string
)
(
k
:
list
spec_pat
)
:
option
(
list
spec_pat
)
:=
end
match
ts
with
|
StAssert
kind
neg
ss
=>
|
TMinus
::
ts
=>
guard
(
¬
neg
∧
ss
=
[]);
parse_goal
ts
kind
true
ss
k
match
ts
with
|
TName
s
::
ts
=>
parse_goal
ts
kind
neg
(
s
::
ss
)
k
|
TMinus
::
ts
=>
guard
(
¬
neg
∧
ss
=
[]);
parse_go
ts
(
StAssert
kind
true
ss
)
k
|
TBracketR
::
ts
=>
parse_go
ts
(
SGoal
kind
neg
(
reverse
ss
)
::
k
)
|
TName
s
::
ts
=>
parse_go
ts
(
StAssert
kind
neg
(
s
::
ss
))
k
|
_
=>
None
|
TBracketR
::
ts
=>
parse_go
ts
StTop
(
SGoal
kind
neg
(
rev
ss
)
::
k
)
|
_
=>
None
end
end
.
end
.
Definition
parse
(
s
:
string
)
:
option
(
list
spec_pat
)
:=
Definition
parse
(
s
:
string
)
:
option
(
list
spec_pat
)
:=
parse_go
(
tokenize
s
)
StTop
[]
.
parse_go
(
tokenize
s
)
[]
.
Ltac
parse
s
:=
Ltac
parse
s
:=
lazymatch
type
of
s
with
lazymatch
type
of
s
with
...
...
This diff is collapsed.
Click to expand it.
proofmode/tactics.v
+
7
−
1
View file @
483e9a03
...
@@ -560,7 +560,13 @@ Tactic Notation "iIntros" constr(pat) :=
...
@@ -560,7 +560,13 @@ Tactic Notation "iIntros" constr(pat) :=
|
ISimpl
::
?pats
=>
simpl
;
go
pats
|
ISimpl
::
?pats
=>
simpl
;
go
pats
|
IAlways
::
?pats
=>
iAlways
;
go
pats
|
IAlways
::
?pats
=>
iAlways
;
go
pats
|
INext
::
?pats
=>
iNext
;
go
pats
|
INext
::
?pats
=>
iNext
;
go
pats
|
IClear
?Hs
::
?pats
=>
iClear
Hs
;
go
pats
|
IClear
?cpats
::
?pats
=>
let
rec
clr
cpats
:=
match
cpats
with
|
[]
=>
go
pats
|
(
false
,
?H
)
::
?cpats
=>
iClear
H
;
clr
cpats
|
(
true
,
?H
)
::
?cpats
=>
iFrame
H
;
clr
cpats
end
in
clr
cpats
|
IPersistent
(
IName
?H
)
::
?pats
=>
iIntro
#
H
;
go
pats
|
IPersistent
(
IName
?H
)
::
?pats
=>
iIntro
#
H
;
go
pats
|
IName
?H
::
?pats
=>
iIntro
H
;
go
pats
|
IName
?H
::
?pats
=>
iIntro
H
;
go
pats
|
IPersistent
IAnom
::
?pats
=>
let
H
:=
iFresh
in
iIntro
#
H
;
go
pats
|
IPersistent
IAnom
::
?pats
=>
let
H
:=
iFresh
in
iIntro
#
H
;
go
pats
...
...
This diff is collapsed.
Click to expand it.
tests/proofmode.v
+
1
−
1
View file @
483e9a03
...
@@ -28,7 +28,7 @@ Proof.
...
@@ -28,7 +28,7 @@ Proof.
iRevert
{
a
b
}
"Ha Hb"
.
iIntros
{
b
a
}
"Hb {foo} Ha"
.
iRevert
{
a
b
}
"Ha Hb"
.
iIntros
{
b
a
}
"Hb {foo} Ha"
.
iAssert
(
uPred_ownM
(
a
⋅
core
a
))
with
"[Ha]"
as
"[Ha #Hac]"
.
iAssert
(
uPred_ownM
(
a
⋅
core
a
))
with
"[Ha]"
as
"[Ha #Hac]"
.
{
by
rewrite
cmra_core_r
.
}
{
by
rewrite
cmra_core_r
.
}
i
Frame
"Ha
Ha
c
"
.
i
Intros
"{$Hac $
Ha
}
"
.
iExists
(
S
j
+
z1
),
z2
.
iExists
(
S
j
+
z1
),
z2
.
iNext
.
iNext
.
iApply
(
"H3"
$!
_
0
with
"H1 []"
)
.
iApply
(
"H3"
$!
_
0
with
"H1 []"
)
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment