Skip to content

Commit 4eab015

Browse files
committed
drivers: Initial goal is now populated via subgoal strategy
1 parent d85aa38 commit 4eab015

4 files changed

Lines changed: 29 additions & 42 deletions

File tree

prover/drivers/base.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ module DRIVER-BASE
8787
imports LOAD-NAMED-RULES
8888
8989
rule <k> .CommandLine => .K ... </k>
90+
91+
rule <goals>
92+
<goal>
93+
<id> .K </id>
94+
<expected> .K </expected>
95+
<strategy> .K </strategy>
96+
...
97+
</goal>
98+
</goals>
99+
<exit-code> 1 => 0 </exit-code>
90100
endmodule
91101
92102
module DRIVER-BASE-SYNTAX

prover/drivers/kore-driver.md

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,11 @@ in the subgoal and the claim of the named goal remains intact.
6666
=> claim getFreshClaimName() : PATTERN strategy STRAT
6767
...
6868
</k>
69-
70-
rule <goals>
71-
<k> claim NAME : PATTERN
72-
strategy STRAT
73-
=> .K
74-
...
75-
</k>
76-
( .Bag =>
77-
<goal>
78-
<id> NAME </id>
79-
<active> true:Bool </active>
80-
<parent> .K </parent>
81-
<k> PATTERN </k>
82-
<strategy> subgoal(PATTERN, STRAT) </strategy>
83-
<expected> success </expected>
84-
<local-context> .Bag </local-context>
85-
<trace> .K </trace>
86-
</goal>
87-
)
88-
...
89-
</goals>
90-
```
91-
92-
```k
93-
rule <id> _:ClaimName </id>
94-
<expected> S:TerminalStrategy </expected>
95-
<strategy> S </strategy>
96-
<exit-code> 1 => 0 </exit-code>
69+
rule <k> claim NAME : PATTERN
70+
strategy STRAT
71+
=> subgoal(NAME, PATTERN, subgoal(PATTERN, STRAT))
72+
...
73+
</k>
9774
```
9875

9976
```k

prover/drivers/smt-driver.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -318,24 +318,21 @@ module DRIVER-SMT
318318
rule #containsSpatialPatterns(.Patterns, _) => false
319319
rule #containsSpatialPatterns((P, Ps), S) => #containsSpatial(P, S) orBool #containsSpatialPatterns(Ps, S)
320320
321+
syntax KItem ::= "expect" TerminalStrategy
322+
rule <strategy> S ~> expect S => .K ... </strategy>
323+
321324
rule <goals>
322325
<k> #goal( goal: (\exists{Vs} \and(Ps)) #as PATTERN, strategy: STRAT, expected: EXPECTED)
323326
~> (check-sat)
324327
=> #goal( goal: PATTERN, strategy: STRAT, expected: EXPECTED)
325328
...
326329
</k>
327-
( .Bag =>
328-
<goal>
329-
<id> !N:ClaimName </id>
330-
<active> true:Bool </active>
331-
<parent> .K </parent>
332-
<k> \implies(\and(#filterPositive(Ps)), \and(\or(#filterNegative(Ps)))) </k>
333-
<strategy> STRAT </strategy>
334-
<expected> EXPECTED </expected>
335-
<local-context> .Bag </local-context>
336-
<trace> .K </trace>
337-
</goal>
338-
)
330+
<strategy> .K
331+
=> subgoal(\implies(\and(#filterPositive(Ps)), \and(\or(#filterNegative(Ps))))
332+
, STRAT
333+
)
334+
~> expect EXPECTED
335+
</strategy>
339336
...
340337
</goals>
341338
requires notBool PATTERN ==K \exists { .Patterns } \and ( .Patterns )

prover/strategies/core.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,13 @@ Proving a goal may involve proving other subgoals:
109109

110110
```k
111111
syntax Strategy ::= "subgoal" "(" Pattern "," Strategy ")"
112+
rule <strategy> subgoal(GOAL, STRAT) => subgoal(!ID:Int, GOAL, STRAT) ... </strategy>
113+
114+
syntax Strategy ::= "subgoal" "(" GoalId "," Pattern "," Strategy ")"
112115
rule <prover>
113116
( .Bag =>
114117
<goal>
115-
<id> !ID:Int </id>
118+
<id> ID:Int </id>
116119
<active> true </active>
117120
<parent> PARENT </parent>
118121
<strategy> SUBSTRAT </strategy>
@@ -125,7 +128,7 @@ Proving a goal may involve proving other subgoals:
125128
<goal>
126129
<id> PARENT </id>
127130
<active> true => false </active>
128-
<strategy> subgoal(SUBGOAL, SUBSTRAT) => goalStrat(!ID:Int) ... </strategy>
131+
<strategy> subgoal(ID, SUBGOAL, SUBSTRAT) => goalStrat(ID:Int) ... </strategy>
129132
<local-context> LC::Bag </local-context>
130133
<trace> TRACE </trace>
131134
...

0 commit comments

Comments
 (0)