Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simuliris
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Iris
simuliris
Commits
8430e116
Commit
8430e116
authored
4 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
prove beh_rel
beh_rel_alt (with one axiom about fair_div)
parent
357cae2c
No related branches found
No related tags found
No related merge requests found
Pipeline
#48079
passed
4 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/simulation/behavior.v
+88
-1
88 additions, 1 deletion
theories/simulation/behavior.v
theories/simulation/fairness.v
+8
-0
8 additions, 0 deletions
theories/simulation/fairness.v
with
96 additions
and
1 deletion
theories/simulation/behavior.v
+
88
−
1
View file @
8430e116
From
stdpp
Require
Import
strings
.
From
stdpp
Require
Import
strings
.
From
simuliris
.
simulation
Require
Import
fairness
language
.
From
simuliris
.
simulation
Require
Import
fairness
language
.
From
Coq
.
Logic
Require
Import
Classical
.
Section
beh
.
Section
beh
.
Context
{
Λ
:
language
}
.
Context
{
Λ
:
language
}
.
...
@@ -58,5 +59,91 @@ Section beh.
...
@@ -58,5 +59,91 @@ Section beh.
has_beh
p_t
[
of_call
main
u
]
σ_t
b_t
→
has_beh
p_t
[
of_call
main
u
]
σ_t
b_t
→
∃
b_s
,
has_beh
p_s
[
of_call
main
u
]
σ_s
b_s
∧
obs_beh
b_t
b_s
.
∃
b_s
,
has_beh
p_s
[
of_call
main
u
]
σ_s
b_s
∧
obs_beh
b_t
b_s
.
(* TODO: prove them equivalent under classical assumptions. *)
(** * [Classical] prove of equivalence of the two notions of behavior. *)
Lemma
has_beh_ub
p
T
σ
:
has_beh
p
T
σ
BehUndefined
↔
pool_reach_stuck
p
T
σ
.
Proof
.
split
.
-
remember
BehUndefined
as
b
.
induction
1
as
[|
|
|???????
IH
];
[|
done
..|]
.
{
eexists
_,
_,
_
.
split
;
last
done
.
constructor
.
}
subst
b
.
specialize
(
IH
eq_refl
)
.
eapply
pool_steps_reach_stuck
;
last
done
.
eapply
pool_steps_single
.
done
.
-
intros
(
T'
&
σ'
&
I'
&
Hsteps
&
Hstuck
)
.
induction
Hsteps
;
eauto
using
has_beh
.
Qed
.
Lemma
has_beh_div
p
T
σ
:
has_beh
p
T
σ
BehDiverge
↔
fair_div
p
T
σ
.
Proof
.
split
.
-
remember
BehDiverge
as
b
.
induction
1
as
[|
|
|???????
IH
];
try
done
;
[]
.
eapply
fair_div_step
;
eauto
.
-
intros
.
constructor
.
done
.
Qed
.
Lemma
has_beh_ret
p
T
σ
v
:
has_beh
p
T
σ
(
BehReturn
v
)
↔
∃
T'
σ'
I
,
pool_steps
p
T
σ
I
(
of_val
v
::
T'
)
σ'
.
Proof
.
split
.
-
remember
(
BehReturn
v
)
as
b
.
induction
1
as
[|
|
|???????
IH
];
try
done
;
[|]
.
{
eexists
_,
_,
_
.
simplify_eq
/=.
constructor
.
}
subst
b
.
specialize
(
IH
eq_refl
)
.
destruct
IH
as
(
T''
&
σ''
&
J
&
Hsteps
)
.
eexists
T''
,
_,
_
.
eapply
pool_steps_trans
;
last
done
.
eapply
pool_steps_single
.
done
.
-
intros
(
T'
&
σ'
&
I'
&
Hsteps
)
.
remember
(
of_val
v
::
T'
)
as
T''
.
induction
Hsteps
;
eauto
using
has_beh
.
simplify_eq
.
constructor
.
Qed
.
Lemma
beh_rel_to_alt
p_t
p_s
:
beh_rel
p_t
p_s
→
beh_rel_alt
p_t
p_s
.
Proof
.
intros
HB
σ_t
σ_s
b_t
HI
Ht
.
destruct
(
classic
(
reach_stuck
p_s
(
of_call
main
u
)
σ_s
))
as
[
HUB
|
HnoUB
]
.
{
exists
BehUndefined
.
split
;
last
by
constructor
.
apply
has_beh_ub
.
done
.
}
specialize
(
HB
_
_
HI
HnoUB
)
.
destruct
HB
as
(
Hdiv
&
Hret
&
Hsafe
)
.
destruct
b_t
.
-
apply
has_beh_ret
in
Ht
as
(
T_t'
&
σ_t'
&
J_t
&
Hsteps_t
)
.
destruct
(
Hret
_
_
_
_
Hsteps_t
)
as
(
v_s'
&
T_s'
&
σ_s'
&
J_s
&
Hsteps_s
&
HO
)
.
exists
(
BehReturn
v_s'
)
.
split
;
last
by
constructor
.
apply
has_beh_ret
.
eauto
.
-
exists
BehDiverge
.
split
;
last
by
constructor
.
apply
has_beh_div
,
Hdiv
,
has_beh_div
.
done
.
-
exfalso
.
apply
has_beh_ub
in
Ht
.
apply
Hsafe
.
done
.
Qed
.
Lemma
beh_rel_from_alt
p_t
p_s
:
beh_rel_alt
p_t
p_s
→
beh_rel
p_t
p_s
.
Proof
.
intros
HB
σ_t
σ_s
HI
Hsafe
.
assert
(
HnoUB
:
¬
has_beh
p_s
[
of_call
main
u
]
σ_s
BehUndefined
)
.
{
intros
?
%
has_beh_ub
.
apply
Hsafe
.
done
.
}
split
;
last
split
.
-
intros
Hdiv
.
destruct
(
HB
_
_
BehDiverge
HI
)
as
(
b_s
&
Hbeh_s
&
Hrel
)
.
{
apply
has_beh_div
.
eauto
.
}
inversion
Hrel
;
simplify_eq
;
last
done
.
apply
has_beh_div
.
done
.
-
intros
v_t
T_t
σ_t'
J_t
Hsteps
.
destruct
(
HB
_
_
(
BehReturn
v_t
)
HI
)
as
(
b_s
&
Hbeh_s
&
Hrel
)
.
{
apply
has_beh_ret
.
eauto
.
}
inversion
Hrel
;
simplify_eq
;
last
done
.
apply
has_beh_ret
in
Hbeh_s
.
naive_solver
.
-
intros
Hstuck
.
destruct
(
HB
_
_
BehUndefined
HI
)
as
(
b_s
&
Hbeh_s
&
Hrel
)
.
{
apply
has_beh_ub
.
eauto
.
}
inversion
Hrel
;
simplify_eq
;
done
.
Qed
.
Lemma
beh_rel_equiv
p_t
p_s
:
beh_rel
p_t
p_s
↔
beh_rel_alt
p_t
p_s
.
Proof
.
split
;
eauto
using
beh_rel_to_alt
,
beh_rel_from_alt
.
Qed
.
End
beh
.
End
beh
.
This diff is collapsed.
Click to expand it.
theories/simulation/fairness.v
+
8
−
0
View file @
8430e116
...
@@ -271,6 +271,14 @@ Section coinductive_inductive_fairness.
...
@@ -271,6 +271,14 @@ Section coinductive_inductive_fairness.
econstructor
;
eauto
.
econstructor
;
eauto
.
Qed
.
Qed
.
Lemma
fair_div_step
p
T
σ
i
T'
σ'
:
fair_div
p
T'
σ'
→
pool_step
p
T
σ
i
T'
σ'
→
fair_div
p
T
σ
.
Proof
.
(* TODO *)
Admitted
.
End
coinductive_inductive_fairness
.
End
coinductive_inductive_fairness
.
...
...
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