@cella-lang/programlogic 0.1.202611241400 → 0.1.202611260446
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -12
- package/index.json +5 -5
- package/package.json +5 -5
- package/programlogic.cell +0 -0
package/README.md
CHANGED
|
@@ -8,12 +8,13 @@ No dependencies besides `cella-lang`'s standard modules.
|
|
|
8
8
|
|
|
9
9
|
## Plugging in a language
|
|
10
10
|
|
|
11
|
-
- `programlogic.Step
|
|
12
|
-
final value) or `fault
|
|
13
|
-
|
|
14
|
-
- `programlogic.
|
|
15
|
-
|
|
16
|
-
`
|
|
11
|
+
- `programlogic.Step(C, V, S, W)`: the result of one step: `advance(c, s)` (a new configuration and state),
|
|
12
|
+
`finish(v, s)` (a final value) or `fault(w)` (a fault with its reason; for C, undefined behavior with its node and
|
|
13
|
+
clause).
|
|
14
|
+
- `programlogic.Language(C, V, S, W)`: a record with one field, `step: C -> S -> Step(C, V, S, W)`.
|
|
15
|
+
- `programlogic.SeparationAlgebra(S, R)`: resources `R` with `join(a, b, c)` (`a` and `b` are disjoint and together
|
|
16
|
+
make `c`), a `unit` with `joinUnit`, both directions of associativity (`associateRight`: from (a b) c to a (b c);
|
|
17
|
+
`associateLeft`), and `interpret(s, r)` (the state `s` holds the resource `r`).
|
|
17
18
|
|
|
18
19
|
The small-step machine of `@cella-lang/machine` (which the C family and Python run on) plugs in like this, with a
|
|
19
20
|
statement and its frames as the configuration:
|
|
@@ -64,15 +65,16 @@ With the whole state owned exclusively as the resource, this proves `while (x !=
|
|
|
64
65
|
|
|
65
66
|
## What you get
|
|
66
67
|
|
|
67
|
-
- `programlogic.Wp
|
|
68
|
-
`Q
|
|
68
|
+
- `programlogic.Wp(L, A, c, Q, r)`: from resource `r`, running `c` never reaches a fault, and if it finishes with `v`,
|
|
69
|
+
`Q(v, r2)` holds for the remaining resource `r2`. It is `WpWithin(L, A, n, c, Q, r)` for every `n`, explicitly step-indexed (Appel and
|
|
69
70
|
McAllester 2001; Ahmed 2006): no guarded fixed point is needed, and a loop rule is proved by induction on the number
|
|
70
71
|
of steps. The frame is part of the definition (as in Charguéraud's Separation Logic Foundations).
|
|
71
|
-
- After a step, the resource is an `Owned
|
|
72
|
+
- After a step, the resource is an `Owned(A, frame, s, X)`: a record with the `resource`, the `whole` resource it makes
|
|
72
73
|
with the frame, the proof they are `joined`, that the state `held` the whole, and that the resource `satisfies` X.
|
|
73
|
-
- `programlogic.safeOfWp
|
|
74
|
-
`L.
|
|
74
|
+
- `programlogic.safeOfWp(L, A, Q, c, r, s, h, i)`: from `h: Wp(L, A, c, Q, r)` and `i: A.interpret(s, r)`, a proof of
|
|
75
|
+
`L.Safe(c, s)`, which is: for every `n`, `L.run(n, c, s)` has not failed (partial correctness: termination is not
|
|
76
|
+
required).
|
|
75
77
|
- `programlogic.wpConsequence` (consequence), `programlogic.wpFrame` (frame: a disjoint resource is carried along
|
|
76
78
|
unchanged, `WithFrame`), `programlogic.wpWithinOfSucc` (one more step implies one fewer).
|
|
77
|
-
- Verdicts: a proved `Wp` is Accept; an input and a number of steps for which `run` reaches `failed
|
|
79
|
+
- Verdicts: a proved `Wp` is Accept; an input and a number of steps for which `run` reaches `failed(w)` is Reject (by
|
|
78
80
|
computation, carrying `w`); otherwise Unknown.
|
package/index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"cbfVersion":
|
|
3
|
-
"checkerHash": "
|
|
2
|
+
"cbfVersion": 35,
|
|
3
|
+
"checkerHash": "0b3103e70af9f0fa",
|
|
4
4
|
"defs": {
|
|
5
5
|
"__RecordTag_programlogic.Language": {
|
|
6
6
|
"merkle": "dc418f5a1fabb217f0bdde607eed461d0244aff45572b86aa304f692d7f7103e",
|
|
@@ -140,10 +140,10 @@
|
|
|
140
140
|
}
|
|
141
141
|
},
|
|
142
142
|
"format": 1,
|
|
143
|
-
"inputs": "
|
|
143
|
+
"inputs": "9176501f84683d145ab15c62df6dcfeb5f73fb7417596dbba217bb994edb0fe1",
|
|
144
144
|
"modules": {
|
|
145
145
|
"programlogic": {
|
|
146
|
-
"bytes":
|
|
146
|
+
"bytes": 61989,
|
|
147
147
|
"deps": [
|
|
148
148
|
"programlogic"
|
|
149
149
|
]
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
},
|
|
152
152
|
"requires": {
|
|
153
153
|
"cella-lang": {
|
|
154
|
-
"checkerHash": "
|
|
154
|
+
"checkerHash": "0b3103e70af9f0fa",
|
|
155
155
|
"modules": []
|
|
156
156
|
},
|
|
157
157
|
"packages": []
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cella-lang/programlogic",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.202611260446",
|
|
4
4
|
"description": "A language-generic program logic for Cella Lang: a language gives one step (next configuration, a final value, or a fault with its reason) and a separation algebra of resources; the package gives the weakest precondition Wp (explicitly step-indexed), soundness (Wp implies the program never reaches a fault, for every number of steps), and the consequence and frame rules - compiled module pack.",
|
|
5
5
|
"files": [
|
|
6
6
|
"programlogic.cell",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"author": "SungYu Chang",
|
|
24
24
|
"homepage": "https://cella-lang.org/",
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"cella-lang": "0.1.
|
|
26
|
+
"cella-lang": "0.1.202611260344"
|
|
27
27
|
},
|
|
28
28
|
"cella": {
|
|
29
|
-
"checkerHash": "
|
|
30
|
-
"cbfVersion":
|
|
29
|
+
"checkerHash": "0b3103e70af9f0fa",
|
|
30
|
+
"cbfVersion": 35,
|
|
31
31
|
"modules": [
|
|
32
32
|
"programlogic"
|
|
33
33
|
],
|
|
34
|
-
"packHash": "
|
|
34
|
+
"packHash": "41204f4e191c3627"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/programlogic.cell
CHANGED
|
Binary file
|