agent-formal-verify 0.4.12 → 0.4.13
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/CHANGES.md +136 -0
- package/README.md +5 -3
- package/package.json +2 -1
- package/skills/formal-verify/SKILL.md +11 -13
- package/skills/formal-verify/examples/kani-template/src/lib.rs +5 -6
- package/skills/formal-verify/examples/lean-template/Model/BoundedQueue.statements +10 -45
- package/skills/formal-verify/examples/tla-template/BoundedQueue.matrix +16 -13
- package/skills/formal-verify/examples/tla-template/BoundedQueue.mutations +92 -14
- package/skills/formal-verify/examples/tla-template/BoundedQueue.tla +169 -28
- package/skills/formal-verify/references/evidence.md +1 -1
- package/skills/formal-verify/references/helpers.md +4 -3
- package/skills/formal-verify/references/lean-brief.md +2 -2
- package/skills/formal-verify/references/rust-brief.md +58 -6
- package/skills/formal-verify/references/setup.md +23 -7
- package/skills/formal-verify/references/tla-brief.md +2 -2
- package/skills/formal-verify/scripts/baseline.py +564 -66
- package/skills/formal-verify/scripts/kani-check.sh +3 -1
- package/skills/formal-verify/scripts/kani.py +127 -59
- package/skills/formal-verify/scripts/lean-analysis.lean +387 -0
- package/skills/formal-verify/scripts/lean-check.sh +6 -243
- package/skills/formal-verify/scripts/lean.py +484 -0
- package/skills/formal-verify/scripts/lean_mutations.py +195 -0
- package/skills/formal-verify/scripts/lean_records.py +25 -0
- package/skills/formal-verify/scripts/mutate.py +81 -195
- package/skills/formal-verify/scripts/processes.py +266 -0
- package/skills/formal-verify/scripts/python-tools.sh +15 -0
- package/skills/formal-verify/scripts/runner.py +56 -0
- package/skills/formal-verify/scripts/setup.sh +18 -19
- package/skills/formal-verify/scripts/storage.py +207 -0
- package/skills/formal-verify/scripts/sync.py +401 -0
- package/skills/formal-verify/scripts/tlc-matrix.sh +3 -1
- package/skills/formal-verify/scripts/tlc.py +423 -116
- package/skills/formal-verify/scripts/{tlc-trace.py → tlc_trace.py} +16 -10
- package/skills/setup/SKILL.md +1 -1
- package/skills/formal-verify/scripts/lean-mutations.lean +0 -95
- package/skills/formal-verify/scripts/lean-statements.py +0 -161
- package/skills/formal-verify/scripts/lean-tools.sh +0 -24
- package/skills/formal-verify/scripts/tlc-tools.sh +0 -47
|
@@ -2,25 +2,103 @@
|
|
|
2
2
|
# plausible bug and names the one property that must fail on it. The text
|
|
3
3
|
# after `- ` must occur exactly once in the spec; `+ ` lines replace it. An
|
|
4
4
|
# optional `only <label-substring>` line limits the matrix runs. Every property
|
|
5
|
-
# the matrix checks needs a mutation.
|
|
5
|
+
# the matrix checks needs a mutation. The only lines here keep each mutation to
|
|
6
|
+
# the smallest runs that show its bug, which bounds the run time; without them
|
|
7
|
+
# a mutation runs on every run that checks its property.
|
|
6
8
|
|
|
7
9
|
mutation claim one item past the window
|
|
8
10
|
detects InWindow
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
only window=1
|
|
12
|
+
- next < consumed + Window
|
|
13
|
+
+ next <= consumed + Window
|
|
14
|
+
|
|
15
|
+
mutation the window never fills
|
|
16
|
+
detects reach:WindowFull
|
|
17
|
+
- next < consumed + Window
|
|
18
|
+
+ next < consumed + Window - 1
|
|
19
|
+
|
|
20
|
+
mutation a woken worker claims without rereading the window, as if a while were an if
|
|
21
|
+
detects InWindow
|
|
22
|
+
only window=1
|
|
23
|
+
- ELSE IF next < consumed + Window
|
|
24
|
+
+ ELSE IF wpc[w] = "wait" \/ next < consumed + Window
|
|
11
25
|
|
|
12
26
|
mutation claim after the last item
|
|
13
27
|
detects TypeOK
|
|
14
|
-
|
|
15
|
-
|
|
28
|
+
only window=1
|
|
29
|
+
- IF closed \/ next = Items
|
|
30
|
+
+ IF closed
|
|
16
31
|
|
|
17
|
-
mutation
|
|
18
|
-
detects
|
|
19
|
-
only
|
|
20
|
-
-
|
|
21
|
-
+
|
|
32
|
+
mutation publish into the slot claimed last
|
|
33
|
+
detects Owned
|
|
34
|
+
only workers=2
|
|
35
|
+
- /\ slot' = [slot EXCEPT ![item[w]] =
|
|
36
|
+
+ /\ slot' = [slot EXCEPT ![next - 1] =
|
|
22
37
|
|
|
23
|
-
mutation the
|
|
24
|
-
detects
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
mutation deliver the claim count
|
|
39
|
+
detects InOrder
|
|
40
|
+
only workers=2
|
|
41
|
+
- /\ out' = Append(out, consumed)
|
|
42
|
+
+ /\ out' = Append(out, next - 1)
|
|
43
|
+
|
|
44
|
+
mutation report an error before the items ahead of it
|
|
45
|
+
detects ErrorInOrder
|
|
46
|
+
only fail=1
|
|
47
|
+
- ELSE IF slot[consumed] = "failed"
|
|
48
|
+
+ ELSE IF \E i \in Indices : slot[i] = "failed"
|
|
49
|
+
|
|
50
|
+
mutation close returns before the workers exit
|
|
51
|
+
detects NoLeak
|
|
52
|
+
only window=1
|
|
53
|
+
- cpc = "join"
|
|
54
|
+
- /\ Exited
|
|
55
|
+
+ cpc = "join"
|
|
56
|
+
+ /\ TRUE
|
|
57
|
+
|
|
58
|
+
mutation close returns without freeing the untaken items
|
|
59
|
+
detects NoLeak
|
|
60
|
+
only window=1
|
|
61
|
+
- /\ slot' = [i \in Indices |-> IF slot[i] \in {"ready", "failed"} THEN "freed" ELSE slot[i]]
|
|
62
|
+
+ /\ UNCHANGED slot
|
|
63
|
+
|
|
64
|
+
mutation next() skips the item whose build failed
|
|
65
|
+
detects NoDeliveryAfterError
|
|
66
|
+
only fail=1
|
|
67
|
+
- THEN /\ cpc' = "error"
|
|
68
|
+
- /\ UNCHANGED <<consumed, slot, out, parked>>
|
|
69
|
+
+ THEN /\ slot' = [slot EXCEPT ![consumed] = "taken"]
|
|
70
|
+
+ /\ consumed' = consumed + 1
|
|
71
|
+
+ /\ cpc' = "idle"
|
|
72
|
+
+ /\ UNCHANGED <<out, parked>>
|
|
73
|
+
|
|
74
|
+
mutation publish without waking the waiters
|
|
75
|
+
detects NextReturns
|
|
76
|
+
only window=1
|
|
77
|
+
- /\ slot' = [slot EXCEPT ![item[w]] = IF item[w] \in FailAt THEN "failed" ELSE "ready"]
|
|
78
|
+
- /\ parked' = {}
|
|
79
|
+
+ /\ slot' = [slot EXCEPT ![item[w]] = IF item[w] \in FailAt THEN "failed" ELSE "ready"]
|
|
80
|
+
+ /\ parked' = parked
|
|
81
|
+
|
|
82
|
+
mutation take an item without waking the waiters
|
|
83
|
+
detects NextReturns
|
|
84
|
+
only window=1
|
|
85
|
+
- /\ consumed' = consumed + 1
|
|
86
|
+
- /\ parked' = {}
|
|
87
|
+
+ /\ consumed' = consumed + 1
|
|
88
|
+
+ /\ parked' = parked
|
|
89
|
+
|
|
90
|
+
mutation close without waking the waiters
|
|
91
|
+
detects CloseReturns
|
|
92
|
+
only window=1
|
|
93
|
+
- /\ closed' = TRUE
|
|
94
|
+
- /\ parked' = {}
|
|
95
|
+
+ /\ closed' = TRUE
|
|
96
|
+
+ /\ parked' = parked
|
|
97
|
+
|
|
98
|
+
mutation next() returns before it takes the ready item
|
|
99
|
+
detects AllConsumed
|
|
100
|
+
only window=1
|
|
101
|
+
- THEN /\ slot' = [slot EXCEPT ![consumed] = "taken"]
|
|
102
|
+
- /\ out' = Append(out, consumed)
|
|
103
|
+
- /\ consumed' = consumed + 1
|
|
104
|
+
+ THEN /\ UNCHANGED <<slot, out, consumed>>
|
|
@@ -2,43 +2,184 @@
|
|
|
2
2
|
(* Copyright (c) 2026 Michael Denyer
|
|
3
3
|
SPDX-License-Identifier: GPL-3.0-only
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
An ordered bounded queue. Each worker thread claims the next item number
|
|
6
|
+
under the mutex, builds the item without it, and publishes the item under
|
|
7
|
+
the mutex. At most Window claimed items may wait for the consumer. The one
|
|
8
|
+
consumer calls next(), which returns the items in claim order, then the
|
|
9
|
+
end, or the error of the first item whose build failed. It may stop
|
|
10
|
+
calling, call next() again after the end or an error, and call close()
|
|
11
|
+
whenever no call is in progress. close() wakes every waiter, waits for
|
|
12
|
+
every worker to exit, and frees the items the consumer never took.
|
|
13
|
+
Building an item in FailAt fails.
|
|
14
|
+
|
|
15
|
+
Each critical section under the mutex is one atomic step, so no two
|
|
16
|
+
threads hold the mutex at once and the spec needs no lock variable.
|
|
17
|
+
Building is the unlocked phase between a claim and its publish. A thread that must wait
|
|
18
|
+
parks on the one condition variable, which publishing, taking an item and
|
|
19
|
+
closing broadcast. A parked thread leaves only on a broadcast or a spurious
|
|
20
|
+
wakeup, then retakes the mutex and rereads the state, so a lost wakeup
|
|
21
|
+
shows as a liveness violation rather than a TLC deadlock.
|
|
22
|
+
|
|
23
|
+
Assumptions: one condition variable serves every wait; spurious wakeups
|
|
24
|
+
and the consumer's choice of call have no fairness; every other step is
|
|
25
|
+
weakly fair.
|
|
26
|
+
|
|
27
|
+
The window arithmetic is the one ../lean-template/Model/BoundedQueue.lean
|
|
28
|
+
proves for every size; this spec checks the threads around it for the
|
|
29
|
+
instances in BoundedQueue.matrix. BoundedQueue.mutations lists the bugs
|
|
30
|
+
its properties must detect.
|
|
31
|
+
|
|
32
|
+
To adapt it, replace this header with the source files and line ranges
|
|
33
|
+
the model follows, the functions and shared variables it covers, the
|
|
34
|
+
commit they were read at as `Source read at <commit>`, and each
|
|
35
|
+
assumption. Keep the top-level formula named Spec, which tlc-matrix.sh
|
|
15
36
|
checks. *)
|
|
16
|
-
EXTENDS Naturals
|
|
37
|
+
EXTENDS Naturals, Sequences
|
|
38
|
+
|
|
39
|
+
CONSTANTS Workers, Window, Items, FailAt
|
|
40
|
+
|
|
41
|
+
VARIABLES next, consumed, slot, out, wpc, item, cpc, parked, closed
|
|
42
|
+
\* The variables each worker and the consumer own, and the queue state under the mutex.
|
|
43
|
+
worker == <<wpc, item>>
|
|
44
|
+
consumer == <<cpc, out>>
|
|
45
|
+
queue == <<next, consumed, slot, closed>>
|
|
46
|
+
vars == <<queue, parked, worker, consumer>>
|
|
47
|
+
|
|
48
|
+
Consumer == "consumer"
|
|
49
|
+
Indices == 0..(Items - 1)
|
|
17
50
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
51
|
+
Init == /\ next = 0
|
|
52
|
+
/\ consumed = 0
|
|
53
|
+
/\ slot = [i \in Indices |-> "free"]
|
|
54
|
+
/\ out = <<>>
|
|
55
|
+
/\ wpc = [w \in Workers |-> "claim"]
|
|
56
|
+
/\ item = [w \in Workers |-> 0]
|
|
57
|
+
/\ cpc = "idle"
|
|
58
|
+
/\ parked = {}
|
|
59
|
+
/\ closed = FALSE
|
|
21
60
|
|
|
22
|
-
|
|
61
|
+
\* A worker takes the mutex to claim the next item. It waits while the window
|
|
62
|
+
\* is full, and exits once the queue is closed or every item is claimed.
|
|
63
|
+
Claim(w) ==
|
|
64
|
+
/\ wpc[w] \in {"claim", "wait"}
|
|
65
|
+
/\ w \notin parked
|
|
66
|
+
/\ IF closed \/ next = Items
|
|
67
|
+
THEN /\ wpc' = [wpc EXCEPT ![w] = "exit"]
|
|
68
|
+
/\ UNCHANGED <<next, slot, item, parked>>
|
|
69
|
+
ELSE IF next < consumed + Window
|
|
70
|
+
THEN /\ slot' = [slot EXCEPT ![next] = "building"]
|
|
71
|
+
/\ item' = [item EXCEPT ![w] = next]
|
|
72
|
+
/\ next' = next + 1
|
|
73
|
+
/\ wpc' = [wpc EXCEPT ![w] = "publish"]
|
|
74
|
+
/\ UNCHANGED parked
|
|
75
|
+
ELSE /\ parked' = parked \cup {w}
|
|
76
|
+
/\ wpc' = [wpc EXCEPT ![w] = "wait"]
|
|
77
|
+
/\ UNCHANGED <<next, slot, item>>
|
|
78
|
+
/\ UNCHANGED <<consumed, closed, consumer>>
|
|
23
79
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
80
|
+
\* After building its item, a worker takes the mutex to publish it and wakes every waiter.
|
|
81
|
+
Publish(w) ==
|
|
82
|
+
/\ wpc[w] = "publish"
|
|
83
|
+
/\ slot' = [slot EXCEPT ![item[w]] = IF item[w] \in FailAt THEN "failed" ELSE "ready"]
|
|
84
|
+
/\ parked' = {}
|
|
85
|
+
/\ wpc' = [wpc EXCEPT ![w] = "claim"]
|
|
86
|
+
/\ UNCHANGED <<next, consumed, closed, item, consumer>>
|
|
28
87
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
88
|
+
\* A parked thread wakes without a broadcast.
|
|
89
|
+
Spurious(t) ==
|
|
90
|
+
/\ t \in parked
|
|
91
|
+
/\ parked' = parked \ {t}
|
|
92
|
+
/\ UNCHANGED <<queue, worker, consumer>>
|
|
32
93
|
|
|
33
|
-
\*
|
|
34
|
-
|
|
94
|
+
\* When no call is in progress, the consumer may call next() or close(), or stop calling.
|
|
95
|
+
Call(c) ==
|
|
96
|
+
/\ cpc \in {"idle", "end", "error"}
|
|
97
|
+
/\ cpc' = c
|
|
98
|
+
/\ UNCHANGED <<queue, parked, worker, out>>
|
|
35
99
|
|
|
36
|
-
|
|
100
|
+
\* next() takes the mutex and returns the next item, the end or the error, or
|
|
101
|
+
\* waits until the next item is published.
|
|
102
|
+
TakeNext ==
|
|
103
|
+
/\ cpc \in {"next", "wait"}
|
|
104
|
+
/\ Consumer \notin parked
|
|
105
|
+
/\ IF consumed = Items
|
|
106
|
+
THEN /\ cpc' = "end"
|
|
107
|
+
/\ UNCHANGED <<consumed, slot, out, parked>>
|
|
108
|
+
ELSE IF slot[consumed] = "ready"
|
|
109
|
+
THEN /\ slot' = [slot EXCEPT ![consumed] = "taken"]
|
|
110
|
+
/\ out' = Append(out, consumed)
|
|
111
|
+
/\ consumed' = consumed + 1
|
|
112
|
+
/\ parked' = {}
|
|
113
|
+
/\ cpc' = "idle"
|
|
114
|
+
ELSE IF slot[consumed] = "failed"
|
|
115
|
+
THEN /\ cpc' = "error"
|
|
116
|
+
/\ UNCHANGED <<consumed, slot, out, parked>>
|
|
117
|
+
ELSE /\ parked' = parked \cup {Consumer}
|
|
118
|
+
/\ cpc' = "wait"
|
|
119
|
+
/\ UNCHANGED <<consumed, slot, out>>
|
|
120
|
+
/\ UNCHANGED <<next, closed, worker>>
|
|
37
121
|
|
|
38
|
-
|
|
122
|
+
\* close() marks the queue closed and wakes every waiter under the mutex, then
|
|
123
|
+
\* joins the workers and frees the items that were published but never taken.
|
|
124
|
+
Close ==
|
|
125
|
+
/\ cpc = "close"
|
|
126
|
+
/\ closed' = TRUE
|
|
127
|
+
/\ parked' = {}
|
|
128
|
+
/\ cpc' = "join"
|
|
129
|
+
/\ UNCHANGED <<next, consumed, slot, worker, out>>
|
|
39
130
|
|
|
40
|
-
|
|
131
|
+
Exited == \A w \in Workers : wpc[w] = "exit"
|
|
132
|
+
|
|
133
|
+
Join ==
|
|
134
|
+
/\ cpc = "join"
|
|
135
|
+
/\ Exited
|
|
136
|
+
/\ slot' = [i \in Indices |-> IF slot[i] \in {"ready", "failed"} THEN "freed" ELSE slot[i]]
|
|
137
|
+
/\ cpc' = "closed"
|
|
138
|
+
/\ UNCHANGED <<next, consumed, closed, parked, worker, out>>
|
|
139
|
+
|
|
140
|
+
\* Stutter once closed, so that the end of a run is not reported as a deadlock.
|
|
141
|
+
Done == cpc = "closed" /\ UNCHANGED vars
|
|
142
|
+
|
|
143
|
+
Next == \/ \E w \in Workers : Claim(w) \/ Publish(w)
|
|
144
|
+
\/ \E t \in parked : Spurious(t)
|
|
145
|
+
\/ \E c \in {"next", "close"} : Call(c)
|
|
146
|
+
\/ TakeNext \/ Close \/ Join \/ Done
|
|
147
|
+
|
|
148
|
+
Spec == /\ Init /\ [][Next]_vars
|
|
149
|
+
/\ \A w \in Workers : WF_vars(Claim(w)) /\ WF_vars(Publish(w))
|
|
150
|
+
/\ WF_vars(TakeNext) /\ WF_vars(Close) /\ WF_vars(Join)
|
|
151
|
+
|
|
152
|
+
TypeOK == /\ next \in 0..Items /\ consumed \in 0..Items
|
|
153
|
+
/\ slot \in [Indices -> {"free", "building", "ready", "failed", "taken", "freed"}]
|
|
154
|
+
/\ wpc \in [Workers -> {"claim", "wait", "publish", "exit"}]
|
|
155
|
+
/\ item \in [Workers -> 0..Items]
|
|
156
|
+
/\ cpc \in {"idle", "next", "wait", "end", "error", "close", "join", "closed"}
|
|
157
|
+
/\ parked \subseteq Workers \cup {Consumer}
|
|
158
|
+
/\ closed \in BOOLEAN
|
|
41
159
|
InWindow == consumed <= next /\ next <= consumed + Window
|
|
160
|
+
\* Each item is unclaimed, held by exactly one worker while it is built, published, taken by the
|
|
161
|
+
\* consumer, or freed by close().
|
|
162
|
+
Owned == /\ \A i \in Indices : (slot[i] = "free") = (i >= next)
|
|
163
|
+
/\ \A i \in Indices : (slot[i] = "taken") = (i < consumed)
|
|
164
|
+
/\ \A i \in Indices : (slot[i] = "building") = (\E w \in Workers : wpc[w] = "publish" /\ item[w] = i)
|
|
165
|
+
/\ \A v, w \in Workers : v # w /\ wpc[v] = "publish" /\ wpc[w] = "publish" => item[v] # item[w]
|
|
166
|
+
InOrder == out = [k \in 1..consumed |-> k - 1]
|
|
167
|
+
\* next() reports an error only for the next item, after every item ahead of it.
|
|
168
|
+
ErrorInOrder == cpc = "error" => slot[consumed] = "failed"
|
|
169
|
+
\* next() delivers no item after the first one whose build failed.
|
|
170
|
+
NoDeliveryAfterError == \A k \in 1..Len(out) : \A i \in FailAt : out[k] < i
|
|
171
|
+
\* Once close() returns, every worker has exited and every item is unclaimed, taken or freed.
|
|
172
|
+
NoLeak == cpc = "closed" => /\ Exited
|
|
173
|
+
/\ \A i \in Indices : slot[i] \in {"free", "taken", "freed"}
|
|
174
|
+
|
|
175
|
+
\* Each wait in next() returns, close() returns, and a consumer that keeps calling next() reaches the end or the error.
|
|
176
|
+
NextReturns == cpc = "wait" ~> cpc # "wait"
|
|
177
|
+
CloseReturns == cpc = "close" ~> cpc = "closed"
|
|
178
|
+
AllConsumed == []<>(cpc = "next") => <>(cpc \in {"end", "error"})
|
|
179
|
+
|
|
180
|
+
\* States that the properties depend on, for the matrix's reach checks.
|
|
42
181
|
WindowFull == next = consumed + Window
|
|
43
|
-
|
|
182
|
+
WorkerParked == parked \cap Workers # {}
|
|
183
|
+
ConsumerParked == Consumer \in parked
|
|
184
|
+
Failed == cpc = "error"
|
|
44
185
|
====
|
|
@@ -12,7 +12,7 @@ Include the matching meaning from this table where each kind of evidence first a
|
|
|
12
12
|
| A bounded search passes | Every input up to the stated bound was tried. |
|
|
13
13
|
| Mutations detected | Deliberate bugs were planted in copies of the model, and the checks caught each one. For Lean, this shows that existing proofs fail, not that the mutated statements are false. |
|
|
14
14
|
| Past fix detected | The checks fail on the behaviour before a recorded bug fix. For Lean, report proof sensitivity separately from whether a checked counterexample establishes that the property rules out that bug. |
|
|
15
|
-
| Specification unchanged | The baseline comparison preserved each recorded run's inputs and checks, reach check's selected inputs, property and fairness definition, statement record, qualified Kani harness name and function-owned assumption, cover and stub. It does not cover a Kani harness's assertions, input construction,
|
|
15
|
+
| Specification unchanged | The baseline comparison preserved each recorded run's inputs and checks, reach check's selected inputs, property and fairness definition, action subscript such as `vars`, statement record, qualified Kani harness name with the `cfg` attributes that can switch it off, and function-owned assumption, cover and stub. It does not cover a Kani harness's assertions, input construction, the conditions around its assertions or calls to assumption helpers; `git diff` does. |
|
|
16
16
|
| UNAVAILABLE | The tool could not run. This target was not checked; give the printed remedy. |
|
|
17
17
|
| reproduced | A deterministic test or race-detector run fails on the production code. |
|
|
18
18
|
| reachable at shipped settings | The shipped constants and callers permit the counter-example, but no production reproduction has confirmed it yet. |
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Detailed behaviour of the verification scripts under `scripts/`. Run each helper from the target repository using `bash` or `python3` with `<skill-dir>` resolved to the installed `formal-verify` skill directory.
|
|
4
4
|
|
|
5
5
|
- **Setup helper ([`scripts/setup.sh`](../scripts/setup.sh))**: verifies the pinned TLC JAR (`tla`), checks the pinned Kani driver and bundled Rust toolchain (`rust`), and is the only helper that installs a Lean toolchain (`lean`).
|
|
6
|
-
- **Matrix runner ([`scripts/tlc-matrix.sh`](../scripts/tlc-matrix.sh))**: runs TLC with a matrix of constants and prints one `PASS` or `FAIL` per run with its state count, then a `SUMMARY` line with the totals. A failing run prints its error trace reduced by [`scripts/
|
|
6
|
+
- **Matrix runner ([`scripts/tlc-matrix.sh`](../scripts/tlc-matrix.sh))**: runs TLC with a matrix of constants and prints one `PASS` or `FAIL` per run with its state count, then a `SUMMARY` line with the totals. Stops each run after sixty minutes, or after the limit in `TLC_TIMEOUT` as [setup](setup.md) describes, and forwards periodic elapsed-time and `Progress(...)` updates to `stderr` during long runs. A failing run prints its error trace reduced by [`scripts/tlc_trace.py`](../scripts/tlc_trace.py) to the variables each step changed. Copy [`examples/tla-template/`](../examples/tla-template/BoundedQueue.tla) to start a spec and its matrix.
|
|
7
7
|
- **Lean checker ([`scripts/lean-check.sh`](../scripts/lean-check.sh))**: builds every `.lean` file in the pinned Lake project and audits every declaration of every built module. It fails on a build error, a `sorry`, a declaration that rests on an axiom beyond `propext`, `Classical.choice` and `Quot.sound`, or a `.lean` file that no Lake library owns. It checks each `<Property>.witness` theorem against its property's hypotheses, and fails on a witness that states something else, as the [Lean brief](lean-brief.md) describes. It then replays every built module, and every project module it imports, through the Lean kernel with the pin's `leanchecker`, which rejects a declaration that a command added without a kernel check. A pin without `leanchecker`, such as Lean 4.20.0, passes with the replay reported as unavailable. Use `--freeze` before the file names to record statement types and definition bodies in each model's `.statements` file before proving it. Freezing permits `sorry` and reports `FROZEN`, not a proof `PASS`. Later checks enforce those records and permit proof changes and added declarations. Given file names after the project, it checks only those files. Copy [`examples/lean-template/Model/BoundedQueue.lean`](../examples/lean-template/Model/BoundedQueue.lean) to start a model.
|
|
8
8
|
- **Rust checker ([`scripts/kani-check.sh`](../scripts/kani-check.sh))**: runs the pinned Kani on the crate's proof harnesses. It reports each harness's unwind bound and check count, requires a satisfied cover witness in each passing harness, rejects failed checks, and prints concrete playback tests when available. It stops each harness after five minutes, or after the limit in `KANI_HARNESS_TIMEOUT` as [setup](setup.md) describes, and fails a harness that reaches the limit with a message that names the setting. Each harness check, here or in the mutation runner, can take up to that limit, so run the command in the background or with a command timeout longer than the total. When discovery fails because code Kani compiles uses a feature newer than Kani's bundled toolchain (error E0658), the failure names that toolchain, and the [Rust brief](rust-brief.md) says what to rewrite or report. Copy [`examples/kani-template/`](../examples/kani-template/src/lib.rs) for a bounded-queue example.
|
|
9
|
-
- **Mutation runner ([`scripts/mutate.py`](../scripts/mutate.py))**: takes a model's `<Name>.mutations` file and applies each listed bug to a temporary copy of the model. It prints `DETECTED` or `MISSED` per mutation with what failed, `UNCOVERED` for a TLA+ property or a Kani harness in the adjacent Rust file that no mutation targets or for a public theorem in a Lean model's `.statements` file whose proof no mutation makes fail, and a `SUMMARY` line. Lean names are fully qualified. A Lean `DETECTED` line means the existing proof fails; it does not establish that the statement is false or its hypotheses can hold. A Lean mutation that changes the statement of a theorem, example or `#guard`, such as renaming a definition that the statement names, reaches no verdict. So does a Kani mutation whose harness reaches the Rust checker's time limit. A mutation with no verdict stops the run with a `FAIL` line. A Lean model needs its `.statements` file before its mutations run. All three templates include a mutations file.
|
|
10
|
-
- **
|
|
9
|
+
- **Mutation runner ([`scripts/mutate.py`](../scripts/mutate.py))**: takes a model's `<Name>.mutations` file and applies each listed bug to a temporary copy of the model. It prints `DETECTED` or `MISSED` per mutation with what failed, `UNCOVERED` for a TLA+ property or a Kani harness in the adjacent Rust file that no mutation targets or for a public theorem in a Lean model's `.statements` file whose proof no mutation makes fail, and a `SUMMARY` line. Lean names are fully qualified. A Lean `DETECTED` line means the existing proof fails; it does not establish that the statement is false or its hypotheses can hold. A Lean mutation that changes the statement of a theorem, example or `#guard`, such as renaming a definition that the statement names, reaches no verdict, and so does a mutation that edits the text of a theorem whose proof then fails. The runner matches a failing example or `#guard` to one occurrence in the original model, so a failure in an example or `#guard` that the mutation adds, or in one that it cannot match to a single original occurrence, also reaches no verdict. So does a TLA+ mutation whose check reaches the TLC time limit, or a Kani mutation whose harness reaches the Rust checker's time limit. A mutation with no verdict stops the run with a `FAIL` line. A Lean model needs its `.statements` file before its mutations run. All three templates include a mutations file.
|
|
10
|
+
- **Sync helper ([`scripts/sync.py`](../scripts/sync.py))**: takes an existing model's files, the source files its header names as `--source` and the functions and shared variables it covers as `--name`, and lists what changed since the model was last synced. Its `SYNC` line gives the sync commit: the header's `Source read at` commit when `HEAD`'s history contains it, and otherwise the last commit of the model files with the reason the header's commit was not used, or `none`. For a model file that is also given as `--source`, such as a production file with its Kani harness, that fallback is the last commit that changed the code of its `#[cfg(kani)]` items and none of its other code, because a later production edit was never synced with the harness. A commit that changed only another model file, such as the TLA+ spec or the harness's `.mutations` file, does not count, since it never synced the harness. A `#[cfg(kani)]` on a field or an enum variant marks production code, not a harness. The helper reads the last 100 commits of the model files and follows each source back through its renames, so a harness commit made under an earlier name counts. It follows a rename along the renaming commit's parents, each parent of a merge that renamed a source included, so it misses a harness commit on a branch merged after the rename; the `READ` range still covers that branch's commits, and a `SYNC none` line names each such rename and its old path when a branch merged after the rename changed that path. Each parent of a merge that renamed a source is read under the old path that `git diff-tree -M` finds against that parent. Parents that hold the source under different old paths get a walk each. The walks are read together, newest commit first, so the latest commit that any walk finds is the sync commit, and a commit that two walks reach under the same paths counts once toward the limit of 100 commits. A parent that git finds no rename against, such as a branch that grew the file below git's 50% rename similarity, is read under the old path of the first parent with one, and a `SYNC none` line names that parent when it does not hold the path. When git finds no rename to the source against any parent, such as when the merge grew the file below git's 50% rename similarity, the walk stops following that source there, and a `SYNC none` line names the merge and the path. When no commit it reads qualifies, the line is `SYNC none` and says whether it stopped at that limit. Each `PATH` line is a path the covered code has had since that commit: each source file through every rename since then, each file where `git grep -w -F` finds a covered name now, and each file where a commit since then added or removed a covered name as a whole word, which `git log -S` finds. A path that held the code only under another name, such as code renamed as it moved, is not found, or a path where each commit since the sync kept the number of times the name appears, such as one that replaced a mention of the name with its definition. The search leaves out each model file that is not also given as `--source`, such as a Kani harness in a file of its own. It also leaves out documents, such as `.md`, `.txt` and `.tex` files and `README` or `CHANGELOG` with no extension, and TLA+ and Lean model files, which can mention a covered name but cannot define it, unless a source path has the same extension. Other files with no extension, such as a `Makefile`, and data files, such as `.json`, `.yml`, `.toml` or `.html` files, can hold code but seldom define a covered name: the helper lists them as `PATH` lines, but a name found only in them still gets a `MISSING` line. A `MISSING` line names a covered name found in none of the files searched, with the commits since the sync that added or removed it. A name that Rust files mention only in comments and strings also gets one, and those files stay in the `PATH` lines. In other languages, such as C, JavaScript or Python, a mention in a comment or a string still counts as finding the name, since a reader of Rust's comments and strings would hide code in them. The `READ` line is the `git log -p` command over those paths, which includes commits made at an intermediate path and code that moved to another file. It exits 1 outside a git repository, for a `--source` path that no commit has, and when `git grep` fails.
|
|
11
|
+
- **Baseline helper ([`scripts/baseline.py`](../scripts/baseline.py))**: records what each model specifies and later names each part that changed. For TLA+ it records each run's inputs and effective checks, each reach check's selected run and inputs, and the definitions of `Spec`, of the checked and reach operators, and of the operators those reference, including the initial state. It resolves operators through sibling modules named by `EXTENDS`, including transitive imports. A definition inside a `LET` expression stays part of the definition that contains it. When a local `INSTANCE` introduces substitutions or a module has an indented definition outside a `LET`, or a column-0 definition inside one, it compares the complete local module texts with comments removed and multiline layout preserved, so edits to unrelated definitions in those modules also need review. A matrix recorded before layout or import tracking needs review and a fresh record. It shares the matrix runner's execution plan, so a check applies only to the runs after it in its section. It does not follow `Spec` into the actions it names under `[][...]_vars`, `WF_` or `SF_`, because every correction of the transcription changes them. It does follow the subscript of those forms and of `<<A>>_vars`, such as `vars`, in every definition it follows, because the subscript decides which steps may leave the variables unchanged and what fairness requires. An operator that `Spec` names outside those, such as a fairness definition, is followed into its actions. A column-0 definition whose header it cannot read, such as an infix operator, is recorded whether or not a property references it, with the operators it references. For Lean it records the `.statements` file. For Kani it records each qualified harness name with the `#[cfg(...)]` and `#![cfg(...)]` attributes that can switch it off: those on the harness, on its enclosing modules and functions, and at the top of the file, other than `#[cfg(kani)]`, and each `#[cfg_attr(<condition>, cfg(...))]` there, including one nested in another `cfg_attr`'s attribute list. A `cfg(...)` inside another attribute is not recorded, such as the one in `#[cfg_attr(docsrs, doc(cfg(...)))]`, which only labels the documentation. For a harness file that another file declares, it adds those on each out-of-line `mod <name>;` declaration that leads to the file from a crate root, on the inline modules around that declaration and at the top of the declaring file. It follows the declarations from the crate roots as rustc does, through each `#[path = "..."]` attribute and each path that a `#[cfg_attr(<condition>, path = "...")]` may set, and records that `cfg_attr` as a guard. The crate roots are the `lib.rs` and `main.rs` in the nearest directory above the file that holds either, and, in the Cargo package of the nearest directory above it with a `Cargo.toml`, `src/lib.rs`, `src/main.rs`, the `.rs` files and `*/main.rs` files in `src/bin/`, `tests/`, `examples/` and `benches/`, and each `.rs` path that a `path = "..."` or `path = '...'` line of `Cargo.toml` names. A file with neither directory above it adds nothing. A crate root is a route without a guard, since its own crate always compiles it, so a crate root that no declaration leads to adds nothing. A `lib.rs` or `main.rs` that only the nearest-directory rule finds, and that another file declares, is a module instead. A harness file that no route the record reads reaches fails the record. The record does not expand macros, so a `mod` declaration inside a macro, such as `cfg_if!`, or inside a function body, and one that a macro or an attribute macro builds, is not a route that it reads. It follows each `include!("...")` item outside function bodies to the file it names, relative to the including file. As rustc does, a `mod` declaration in that file loads from the file's own directory, whatever inline modules hold the `include!`, and the guards on the `include!` item and on the modules around it are part of the route. It also follows an `include!` whose path is a `concat!` of such strings and `env!("CARGO_MANIFEST_DIR")`, which stands for the directory of the nearest `Cargo.toml` above the crate root that reaches the including file, as Cargo sets it for the crate it compiles. With no `Cargo.toml` there, such an `include!` is not followed. An `include!` of a file that does not exist is skipped, and so is one inside a macro or function body. A reached file that fails to parse is skipped, and so are a declaration whose `#[path]` it cannot read and an `include!` whose path it cannot read, such as `include!(concat!(env!("OUT_DIR"), "/bindings.rs"))`; the failure for a harness file that no route reaches names each of them. When more than one route leads to the file, the record holds each route as its crate root's path relative to the harness file's directory and its guards, such as `routes(lib.rs: unguarded; main.rs: cfg(feature = "slow"))`, so adding, removing or guarding any route, or moving a guard from one route to another, prints CHANGED. It also asks Kani which harnesses it compiles, through the Rust checker's discovery in the Cargo package that holds the harness file. Each harness that Kani compiles from the file must be a recorded harness under the module path of a route that the record reads, so a route that a macro or generated code builds fails with the name Kani gives the harness on it, unless a route that the record reads gives the same name. `record` stores the recorded harnesses that Kani compiles when the package compiles, and prints `not checked against Kani` with the reason when Kani is missing or the package does not compile. `compare` always asks Kani, fails when it cannot, and prints `not compiled harness <name>` for a stored harness that Kani compiles on no route, such as when `Cargo.toml` drops a default feature that a route's `cfg` needs. For a file that `record` could not check, `compare` prints `not checked against Kani at record`, because it cannot see a harness that stopped compiling on a route that the record does not read. A harness file outside any Cargo package is read from its text alone. It also records each `kani::assume`, `kani::any_where`, `kani::cover!` and `#[kani::stub]` with its qualified owning function, including helper functions. The Rust reader supports free functions under inline modules; a Kani form in a macro, implementation or trait body, or another owner it cannot identify, fails the record. A spelling it cannot read, such as an import that renames `kani::assume`, also fails. It does not record a harness's assertions, input construction, the conditions around its assertions or calls to assumption helpers; read `git diff` for those. Create a new record after updating the helper if it reports an unsupported record format. `baseline.py move <record-file> <old file> <new file>` moves a model's record entry to the file the model moved to, reading the record alone, so a later `compare` checks the new file against what the old one specified, including the harnesses that Kani compiled. For a Kani harness moved into a module of its production file, add `--module <old module> <new module>`, each relative to its file, with `crate` for the file's root, such as `--module crate proofs` for harnesses that sat at the old crate's root, even when the production file is `src/queue.rs`. When the new file already has an entry, the two are merged, and an item in both fails the move. Accept a move when `compare` prints `UNCHANGED` and `git diff` shows the old file's harness lines in the new module with only their indentation changed, plus the `use crate as <name>;` line and the `#[cfg(kani)] mod proofs` lines around them. Any other change, such as an edited assertion, needs the evidence its row cites.
|
|
@@ -42,13 +42,13 @@ bash <skill-dir>/scripts/lean-check.sh <absolute-project-path> Model/<Name>.lean
|
|
|
42
42
|
python3 <skill-dir>/scripts/mutate.py <absolute-project-path>/Model/<Name>.mutations
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
The checker enforces the `.statements` file beside each checked source. Changing a theorem type, a definition type or body (including an opaque definition), or deleting a frozen declaration fails with its name. Adding lemmas and definitions and changing proofs is allowed. Re-freeze only after the production code changes, after a production test contradicts the transcription, after reviewing a toolchain bump, or after the main thread accepts a specification correction under step 3 of the skill. Older records that lack opaque body hashes also require reviewing those definitions and explicitly re-freezing before they can pass. Record the evidence, the old and new guarantees, and the reason for re-freezing in the report. Records are specific to the pinned Lean toolchain. Fingerprints use structural expressions, including the module identity of private references. If two private declarations share a name in one model, give them distinct names before freezing. A project-wide check also rejects records whose source files were deleted. Named-file checks remain limited to those files. A model without a record retains the usual proof and axiom checks, so keep the records under version control. Deleting a record removes that protection.
|
|
45
|
+
The checker enforces the `.statements` file beside each checked source. Changing a theorem type, a definition type or body (including an opaque, recursive or `partial` definition), or deleting a frozen declaration fails with its name. Adding lemmas and definitions and changing the proofs of theorems is allowed. A proof written inside a definition is part of its body. The record leaves out what Lean generates only when a proof uses it, such as `f.eq_1` and `f.induct`. Re-freeze only after the production code changes, after a production test contradicts the transcription, after reviewing a toolchain bump, or after the main thread accepts a specification correction under step 3 of the skill. Older records that lack opaque body hashes also require reviewing those definitions and explicitly re-freezing before they can pass. So do older records that list a generated lemma such as `f.eq_1`, which now reads as deleted, or a recursive definition, whose value now reads as changed. Record the evidence, the old and new guarantees, and the reason for re-freezing in the report. Records are specific to the pinned Lean toolchain. Fingerprints use structural expressions, including the module identity of private references. If two private declarations share a name in one model, give them distinct names before freezing. A project-wide check also rejects records whose source files were deleted. Named-file checks remain limited to those files. A model without a record retains the usual proof and axiom checks, so keep the records under version control. Deleting a record removes that protection.
|
|
46
46
|
|
|
47
47
|
The file name limits the Lean checker to your model, so another agent's unfinished file does not fail your check.
|
|
48
48
|
|
|
49
49
|
List plausible bugs in the mutations file, such as `<` instead of `≤`, a missing `+ 1` or a swapped argument. The mutation runner checks each on a copy of the file and names the theorems and `#guard` lines that fail. Expect both the bounded search's `#guard` and the theorem. It rejects a mutation that stops a definition compiling or changes the statement of a theorem, example or `#guard`, such as renaming a definition that a statement names. Revise the properties behind each MISSED line.
|
|
50
50
|
|
|
51
|
-
The mutation runner
|
|
51
|
+
The mutation runner checks the original file against its frozen declarations with the Lean checker before running any mutants. It uses Lean's elaborated names and source ranges to report each frozen public theorem whose proof no mutation makes fail. Structure and class projections and instance declarations are not property targets. Names remain fully qualified, including nested namespaces. A failing `#guard` or example does not cover a named theorem. The runner matches a failing guard or example to one original occurrence and compares their elaborated statements. When an edit overlaps a check, preserve the check’s text so the runner can identify a unique occurrence on both sides of the edit. A failure in a new or ambiguous check gives the mutation no verdict. Add a mutation that breaks the proof by changing the model outside the theorem, or propose a specification correction with evidence for the main thread to accept before re-freezing. A helper lemma that shows here should be `private`; a property marked `private` to hide it is a change the main thread reverts. Lean mutations take no `detects` line. For each fix commit in your row, add a mutation that restores the behaviour the code had before the fix, with the commit's short hash in its label.
|
|
52
52
|
|
|
53
53
|
A broken proof does not establish that the mutated statement is false. Even a theorem with contradictory hypotheses can have a proof that breaks when the implementation changes. Check that each theorem's hypotheses can hold together, using concrete inputs and Lean-checked witnesses where practical, and report where this was not checked. Keep proof sensitivity, hypothesis satisfiability and a checked counterexample as separate evidence. Do not claim non-vacuity or that a historical bug is ruled out from a DETECTED line alone.
|
|
54
54
|
|
|
@@ -2,16 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
Use Kani for a Rust function whose inputs and loops can be bounded. Call the real
|
|
4
4
|
function from one `#[kani::proof]` harness per property. Do not transcribe its
|
|
5
|
-
implementation. Edit an existing harness in place
|
|
5
|
+
implementation. Edit an existing harness in place unless it moves, as "Moving
|
|
6
|
+
a harness" says, and start a new one from
|
|
6
7
|
[the bounded queue template](../examples/kani-template/src/lib.rs).
|
|
7
8
|
|
|
8
9
|
## Files
|
|
9
10
|
|
|
10
11
|
Work in the target repository. `<skill-dir>` means the absolute path to this
|
|
11
12
|
plugin's `skills/formal-verify` directory, not a directory in the target crate.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
Write the harnesses in a `#[cfg(kani)] mod proofs` at the end of the production
|
|
14
|
+
file that defines the function, with the header comment directly above it, as
|
|
15
|
+
the template does. Write `<Name>.mutations` beside that file, where `<Name>` is
|
|
16
|
+
the file's stem, such as `lib`. The mutation runner applies a mutation only to
|
|
17
|
+
the file beside the mutations file and checks the harnesses of that file's
|
|
18
|
+
crate, so a harness in another crate cannot detect a mutation of the production
|
|
19
|
+
code. `#[cfg(kani)]` leaves the module out of every other build, and the main
|
|
20
|
+
thread declares `cfg(kani)` in the crate's `Cargo.toml`; if a check warns about
|
|
21
|
+
an unexpected `cfg` condition named `kani`, report it and leave `Cargo.toml`
|
|
22
|
+
alone. Own only that module and the mutations file, and change no other line of
|
|
23
|
+
the production file unless the user has authorized a production fix. Move a
|
|
24
|
+
harness that an earlier run wrote in a crate of its own into its production
|
|
25
|
+
file, as "Moving a harness" says, unless it copies a production function or
|
|
26
|
+
calls functions from more than one file. Edit such a harness and its mutations
|
|
27
|
+
file where they are.
|
|
15
28
|
|
|
16
29
|
Cite the production source paths and line numbers that each property models in
|
|
17
30
|
the harness header, the functions it calls, and the commit they were read at as
|
|
@@ -31,6 +44,42 @@ main thread under step 3 of the skill. Add a mutation, with `detects`
|
|
|
31
44
|
naming the harness, for each branch or step the update adds. Update the header
|
|
32
45
|
to the code you read.
|
|
33
46
|
|
|
47
|
+
## Moving a harness
|
|
48
|
+
|
|
49
|
+
A harness that an earlier run wrote in a crate of its own can mutate only that
|
|
50
|
+
crate's files, so none of its mutations reach the production code. Move it into
|
|
51
|
+
the production file that defines the functions it calls:
|
|
52
|
+
|
|
53
|
+
1. Move its helpers and harnesses into the `#[cfg(kani)] mod proofs` at the
|
|
54
|
+
end of the production file, creating the module if the file has none, and
|
|
55
|
+
its header comment to directly above that module. Add `use crate as prod;`
|
|
56
|
+
at the top of the module, with the name the old harness gave the
|
|
57
|
+
production crate, so each `use`, stub, assumption and cover that names
|
|
58
|
+
`prod::` keeps its text. Change nothing else in this step: the moved lines
|
|
59
|
+
differ only in indentation. The main thread compares the moved
|
|
60
|
+
harnesses with its record of the old ones and reads any other difference as
|
|
61
|
+
a change that needs the evidence your row cites.
|
|
62
|
+
2. Move its `.mutations` file beside the production file as `<Name>.mutations`,
|
|
63
|
+
or append its mutations to the one already there. Rename each `detects` to
|
|
64
|
+
the harness's new qualified name as Kani prints it, such as
|
|
65
|
+
`proofs::claim_keeps_invariant` for `claim_keeps_invariant`, or
|
|
66
|
+
`queue::proofs::claim_keeps_invariant` in `src/queue.rs`. Replace each mutation that edits the harness
|
|
67
|
+
with one that edits the production function, and replay the row's fix
|
|
68
|
+
commits there.
|
|
69
|
+
3. Leave the old harness file and the rest of its crate in place, so the
|
|
70
|
+
workspace still builds, and name the file and the crate in your report. The
|
|
71
|
+
main thread deletes them.
|
|
72
|
+
4. Run the checker on the production crate and the mutation runner on the new
|
|
73
|
+
mutations file. Then make any update your row asks for, as "Existing model"
|
|
74
|
+
says.
|
|
75
|
+
|
|
76
|
+
Keep the old layout for a harness that names its own crate's items through
|
|
77
|
+
`crate::`, and report it. Stop and restore the old layout when the checker's
|
|
78
|
+
discovery fails in production code or a dependency, as the Check section
|
|
79
|
+
describes, and report it. Report the old module path and the new one, each
|
|
80
|
+
relative to its file, such as the crate root and `proofs`, even when the
|
|
81
|
+
production file is `src/queue.rs`.
|
|
82
|
+
|
|
34
83
|
## Model
|
|
35
84
|
|
|
36
85
|
Use `kani::any()` for inputs and `kani::assume` for caller constraints. Record
|
|
@@ -40,6 +89,9 @@ Put `#[kani::unwind(N)]` on every harness, above its real loop bounds. The check
|
|
|
40
89
|
requires this explicit bound and passes it to Kani. A failed unwinding assertion
|
|
41
90
|
means the bound is too low and fails the check. Discovery and verification both
|
|
42
91
|
enable `-Z stubbing`, so documented `#[kani::stub]` attributes work in either step.
|
|
92
|
+
The checker rejects a harness marked `#[kani::should_panic]` when it would verify
|
|
93
|
+
that harness, before it verifies any. Assert the condition that leads to the panic
|
|
94
|
+
instead.
|
|
43
95
|
|
|
44
96
|
Kani stops a harness at `KANI_HARNESS_TIMEOUT`, five minutes by default. Symbolic
|
|
45
97
|
inputs that reach an error constructor that builds a message with `format!`, or
|
|
@@ -69,7 +121,7 @@ python3 <skill-dir>/scripts/mutate.py /absolute/path/to/crate/src/Name.mutations
|
|
|
69
121
|
|
|
70
122
|
Append fully qualified harness names to check only those properties. The helper
|
|
71
123
|
prints one verdict per harness with the unwind bound and number of checks. It
|
|
72
|
-
requires a complete Kani 0.68.0 bundle and Python 3. It checks and invokes the
|
|
124
|
+
requires a complete Kani 0.68.0 bundle and Python 3.9 or later. It checks and invokes the
|
|
73
125
|
bundle's driver directly, without invoking the auto-installing Cargo wrapper.
|
|
74
126
|
A registered Cargo installer is not required after setup. Relative `KANI_HOME`
|
|
75
127
|
paths resolve against the caller's directory before any temporary work begins.
|
|
@@ -85,7 +137,7 @@ production crate, and report the target as not checked by Kani. A harness in a
|
|
|
85
137
|
separate crate that copies the function checks the copy, not the production
|
|
86
138
|
code, so report it as a model and name the copied source and commit.
|
|
87
139
|
|
|
88
|
-
Put `<Name>.mutations` beside the
|
|
140
|
+
Put `<Name>.mutations` beside the production file `<Name>.rs`. Use
|
|
89
141
|
`detects <fully-qualified-harness>` for each mutation. The mutation runner uses
|
|
90
142
|
the bundled Cargo to find the crate's workspace and local dependencies, copies
|
|
91
143
|
them to temporary storage with their relative paths intact, and checks the
|