@@ -11,47 +11,49 @@ Set Implicit Arguments.
11
11
12
12
Record language :=
13
13
{
14
- par : Set ; (* partial programs *)
14
+ int : Set ;
15
+ par : int -> Set ; (* partial programs *)
16
+ ctx : int -> Set ; (* context *)
15
17
prg : Set ; (* whole programs *)
16
- ctx : Set ; (* context *)
17
- plug : par -> ctx -> prg;
18
+ plug : forall {i:int}, par i -> ctx i -> prg;
18
19
sem : prg -> prop;
19
20
non_empty_sem : forall W, exists t, sem W t
20
21
}.
21
22
22
-
23
23
Axiom src : language.
24
24
Axiom tgt : language.
25
- Axiom compile_par : (par src) -> (par tgt).
26
- Axiom compile_ctx : (ctx src) -> (ctx tgt).
27
- Axiom compile_prg : (prg src) -> (ctx tgt).
25
+
26
+ Axiom cint : int src -> int tgt.
27
+
28
+ Axiom compile_par : forall {i}, (par src i) -> (par tgt (cint i)).
29
+ Axiom compile_ctx : forall {i}, (ctx src i) -> (ctx tgt (cint i)).
30
+
31
+ Axiom i : int src.
28
32
29
33
Notation "C [ P ]" := (plug _ P C) (at level 50).
30
34
Notation "P ↓" := (compile_par P) (at level 50).
31
35
36
+ Section Ki.
32
37
33
- Definition psem {K : language}
34
- (P : prg K)
38
+ Context {K : language} {i : int K}.
39
+
40
+ Definition psem (P : prg K)
35
41
(m : finpref) : Prop :=
36
42
exists t, prefix m t /\ (sem K) P t.
37
43
38
- Definition xsem {K : language}
39
- (P : prg K)
44
+ Definition xsem (P : prg K)
40
45
(x : xpref) : Prop :=
41
46
exists t, xprefix x t /\ (sem K) P t.
42
47
43
- Definition sat {K : language}
44
- (P : prg K)
48
+ Definition sat (P : prg K)
45
49
(π : prop) : Prop :=
46
50
forall t, sem K P t -> π t.
47
51
48
- Definition rsat {K : language}
49
- (P : par K)
52
+ Definition rsat (P : par K i)
50
53
(π : prop) : Prop :=
51
54
forall C, sat (C [ P ] ) π.
52
55
53
-
54
- Lemma neg_rsat {K : language} :
56
+ Lemma neg_rsat :
55
57
forall P π, (~ rsat P π <->
56
58
(exists C t, sem K (C [ P ]) t /\ ~ π t)).
57
59
Proof .
@@ -66,30 +68,28 @@ Proof.
66
68
Qed .
67
69
68
70
69
- Definition beh {K : language} (P : prg K) : prop :=
71
+ Definition beh (P : prg K) : prop :=
70
72
fun b => sem K P b.
71
73
72
- Definition hsat {K : language}
73
- (P : prg K)
74
+ Definition hsat (P : prg K)
74
75
(H : hprop) : Prop :=
75
76
H (beh P).
76
77
77
- Definition rhsat {K : language}
78
- (P : par K)
78
+ Definition rhsat (P : par K i)
79
79
(H : hprop) : Prop :=
80
80
forall C, hsat ( C [ P ] ) H.
81
81
82
- Lemma neg_rhsat {K : language} :
83
- forall P H, (~ rhsat P H <-> ( exists (C : ctx K), ~ H (beh ( C [ P ] )))).
82
+ Lemma neg_rhsat : forall (P:par K i) H,
83
+ (~ rhsat P H <-> ( exists (C : ctx K i ), ~ H (beh ( C [ P ] )))).
84
84
Proof .
85
85
intros P H. split; unfold rhsat; intro H0;
86
86
[now rewrite <- not_forall_ex_not | now rewrite not_forall_ex_not].
87
87
Qed .
88
88
89
- Definition sat2 {K : language} (P1 P2 : @prg K) (r : rel_prop) : Prop :=
89
+ Definition sat2 (P1 P2 : @prg K) (r : rel_prop) : Prop :=
90
90
forall t1 t2, sem K P1 t1 -> sem K P2 t2 -> r t1 t2.
91
91
92
- Lemma neg_sat2 {K : language} : forall P1 P2 r,
92
+ Lemma neg_sat2 : forall P1 P2 r,
93
93
~ sat2 P1 P2 r <-> (exists t1 t2, sem K P1 t1 /\ sem K P2 t2 /\ ~ r t1 t2).
94
94
Proof .
95
95
unfold sat2. intros P1 P2 r. split.
@@ -106,19 +106,18 @@ Proof.
106
106
Qed .
107
107
108
108
109
- Definition rsat2 {K : language} (P1 P2 : @ par K) (r : rel_prop) : Prop :=
109
+ Definition rsat2 (P1 P2 : par K i ) (r : rel_prop) : Prop :=
110
110
forall C, sat2 (C [ P1 ]) (C [ P2 ]) r.
111
111
112
-
113
- Definition hsat2 {K : language} (P1 P2 : @prg K) (r : rel_hprop) : Prop :=
112
+ Definition hsat2 (P1 P2 : prg K) (r : rel_hprop) : Prop :=
114
113
r (sem K P1) (sem K P2).
115
114
116
- Definition hrsat2 {K : language} (P1 P2 : @ par K) (r : rel_hprop) : Prop :=
115
+ Definition hrsat2 (P1 P2 : par K i ) (r : rel_hprop) : Prop :=
117
116
forall C, r (sem K (C [P1])) (sem K (C [P2])).
118
117
119
118
(************************************************************************* *)
120
119
121
- Definition input_totality (K : language) : Prop :=
120
+ Definition input_totality : Prop :=
122
121
forall (P : prg K) l e1 e2,
123
122
is_input e1 -> is_input e2 -> psem P (ftbd (snoc l e1)) -> psem P (ftbd (snoc l e2)).
124
123
@@ -128,11 +127,13 @@ Definition traces_match (t1 t2 : trace) : Prop :=
128
127
is_input e1 /\ is_input e2 /\ e1 <> e2 /\
129
128
prefix (ftbd (snoc l e1)) t1 /\ prefix (ftbd (snoc l e2)) t2).
130
129
131
- Definition determinacy (K : language) : Prop :=
130
+ Definition determinacy : Prop :=
132
131
forall (P : prg K) t1 t2,
133
132
sem K P t1 -> sem K P t2 -> traces_match t1 t2.
134
133
135
- Definition semantics_safety_like (K : language) : Prop :=
134
+ Definition semantics_safety_like : Prop :=
136
135
forall t P,
137
136
~ sem K P t -> inf t -> ~ diverges t ->
138
137
(exists l ebad, psem P (ftbd l) /\ prefix (ftbd (snoc l ebad)) t /\ ~ psem P (ftbd (snoc l ebad))).
138
+
139
+ End Ki.
0 commit comments