Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
smart-contract-interactions
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
concordium
smart-contract-interactions
Commits
807da0fc
Commit
807da0fc
authored
May 02, 2019
by
Jakob Botsch Nielsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lots more work
parent
51668cc7
Pipeline
#12208
failed with stage
in 1 minute and 20 seconds
Changes
5
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
297 additions
and
228 deletions
+297
-228
src/Automation.v
src/Automation.v
+1
-1
src/Blockchain.v
src/Blockchain.v
+1
-1
src/Congress.v
src/Congress.v
+243
-225
src/Containers.v
src/Containers.v
+41
-0
src/Extras.v
src/Extras.v
+11
-1
No files found.
src/Automation.v
View file @
807da0fc
...
...
@@ -191,7 +191,7 @@ Ltac solve_by_inversion :=
|
[
H
:
_
|-
_
]
=>
solve
[
inversion
H
]
end
.
Ltac
s
implify
_hypotheses
:=
Ltac
s
pecialize
_hypotheses
:=
repeat
match
goal
with
|
[
H
:
_
->
_
|-
_
]
=>
specialize
(
H
ltac
:
(
auto
))
...
...
src/Blockchain.v
View file @
807da0fc
...
...
@@ -848,7 +848,7 @@ Proof.
split
;
[
eapply
new_acts_no_out_queue
|
eapply
list
.
Forall_cons
];
eauto
.
-
(
*
Permutation
*
)
subst
.
s
implify
_hypotheses
.
s
pecialize
_hypotheses
.
match
goal
with
|
[
prev_eq_new
:
_
=
_
,
perm
:
Permutation
_
_
|-
_
]
=>
now
rewrite
prev_eq_new
in
*
;
rewrite
<-
perm
;
auto
...
...
src/Congress.v
View file @
807da0fc
This diff is collapsed.
Click to expand it.
src/Containers.v
View file @
807da0fc
From
Coq
Require
Import
List
.
From
Coq
Require
Import
ZArith
.
From
Coq
Require
Import
Permutation
.
From
stdpp
Require
gmap
.
From
SmartContracts
Require
Import
Monads
.
From
SmartContracts
Require
Import
BoundedN
.
From
SmartContracts
Require
Import
Automation
.
Import
ListNotations
.
Notation
FMap
:=
gmap
.
gmap
.
...
...
@@ -66,6 +68,45 @@ Module FMap.
k
<>
k
'
->
find
k
'
(
partial_alter
f
k
m
)
=
find
k
'
m
.
Proof
.
apply
fin_maps
.
lookup_partial_alter_ne
.
Qed
.
Lemma
find_empty
k
:
FMap
.
find
k
(
FMap
.
empty
:
FMap
K
V
)
=
None
.
Proof
.
apply
fin_maps
.
lookup_empty
.
Qed
.
Lemma
elements_add
(
m
:
FMap
K
V
)
k
v
:
find
k
m
=
None
->
Permutation
(
elements
(
add
k
v
m
))
((
k
,
v
)
::
elements
m
).
Proof
.
apply
fin_maps
.
map_to_list_insert
.
Qed
.
Lemma
elements_empty
:
(
elements
empty
:
list
(
K
*
V
))
=
[].
Proof
.
now
rewrite
fin_maps
.
map_to_list_empty
.
Qed
.
Lemma
elements_add_empty
(
k
:
K
)
(
v
:
V
)
:
FMap
.
elements
(
FMap
.
add
k
v
FMap
.
empty
)
=
[(
k
,
v
)].
Proof
.
now
rewrite
fin_maps
.
insert_empty
,
fin_maps
.
map_to_list_singleton
.
Qed
.
Lemma
add_remove
(
m
:
FMap
K
V
)
k
v
:
add
k
v
(
remove
k
m
)
=
add
k
v
m
.
Proof
.
apply
fin_maps
.
insert_delete
.
Qed
.
Lemma
remove_add
(
m
:
FMap
K
V
)
k
v
:
find
k
m
=
None
->
remove
k
(
add
k
v
m
)
=
m
.
Proof
.
apply
fin_maps
.
delete_insert
.
Qed
.
Lemma
find_remove
(
m
:
FMap
K
V
)
k
:
find
k
(
remove
k
m
)
=
None
.
Proof
.
apply
fin_maps
.
lookup_delete
.
Qed
.
Lemma
add_commute
(
m
:
FMap
K
V
)
(
k
k
'
:
K
)
(
v
v
'
:
V
)
:
k
<>
k
'
->
FMap
.
add
k
v
(
FMap
.
add
k
'
v
'
m
)
=
FMap
.
add
k
'
v
'
(
FMap
.
add
k
v
m
).
Proof
.
apply
fin_maps
.
insert_commute
.
Qed
.
Lemma
add_id
(
m
:
FMap
K
V
)
k
v
:
find
k
m
=
Some
v
->
add
k
v
m
=
m
.
Proof
.
apply
fin_maps
.
insert_id
.
Qed
.
End
Theories
.
End
FMap
.
...
...
src/Extras.v
View file @
807da0fc
...
...
@@ -56,11 +56,21 @@ Proof.
lia
.
Qed
.
Lemma
sumnat_permutation
{
A
:
Type
}
{
f
:
A
->
nat
}
{
xs
ys
:
list
A
}
(
perm_eq
:
Permutation
xs
ys
)
:
sumnat
f
xs
=
sumnat
f
ys
.
Proof
.
induction
perm_eq
;
perm_simplify
;
lia
.
Qed
.
Instance
sumnat_perm_proper
{
A
:
Type
}
{
f
:
A
->
nat
}
:
Proper
(
Permutation
(
A
:=
A
)
==>
eq
)
(
sumnat
f
).
Proof
.
intros
x
y
perm
.
now
apply
sumnat_permutation
.
Qed
.
Lemma
sumZ_permutation
{
A
:
Type
}
{
f
:
A
->
Z
}
{
xs
ys
:
list
A
}
(
perm_eq
:
Permutation
xs
ys
)
:
sumZ
f
xs
=
sumZ
f
ys
.
Proof
.
induction
perm_eq
;
p
rove
.
Qed
.
Proof
.
induction
perm_eq
;
p
erm_simplify
;
lia
.
Qed
.
Instance
sumZ_perm_proper
{
A
:
Type
}
{
f
:
A
->
Z
}
:
Proper
(
Permutation
(
A
:=
A
)
==>
eq
)
(
sumZ
f
).
...
...
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