File tree Expand file tree Collapse file tree 1 file changed +36
-7
lines changed Expand file tree Collapse file tree 1 file changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -95,15 +95,44 @@ completed, its result is replaced in the parent goal and the subgoal is removed.
95
95
<strategy> goalStrat(ID) => RStrat ... </strategy>
96
96
...
97
97
</goal>
98
- ( <goal> <id> ID </id>
99
- <active> true:Bool </active>
100
- <parent> PID </parent>
101
- <strategy> RStrat:TerminalStrategy </strategy>
102
- ...
103
- </goal> => .Bag
104
- )
98
+ <goal> <id> ID </id>
99
+ <active> true:Bool => false </active>
100
+ <parent> PID </parent>
101
+ <strategy> (.K => #reap?) ~> RStrat:TerminalStrategy </strategy>
102
+ ...
103
+ </goal>
105
104
...
106
105
</prover>
106
+
107
+ syntax KItem ::= "#reap?" // if goal failed prune goal and children
108
+ rule <strategy> (#reap? => #reap) ~> fail </strategy>
109
+ rule <strategy> (#reap? => .K ) ~> success </strategy>
110
+
111
+ syntax KItem ::= "#reap" // (always) prune goal and children
112
+ rule <goal>
113
+ <id> PID </id>
114
+ <strategy> #reap ~> RStrat:TerminalStrategy </strategy>
115
+ ...
116
+ </goal>
117
+ <goal>
118
+ <parent> PID </parent>
119
+ <strategy> (.K => #reap) ~> Strat:Strategy </strategy>
120
+ ...
121
+ </goal>
122
+ rule <prover>
123
+ <goal>
124
+ <id> ID </id>
125
+ <strategy> #reap ~> Strat:Strategy </strategy>
126
+ ...
127
+ </goal> => .Bag
128
+ ...
129
+ </prover>
130
+ requires notBool hasChildren(ID)
131
+
132
+ syntax Bool ::= hasChildren(GoalId) [function]
133
+ rule [[ hasChildren(ID) => true ]]
134
+ <parent> ID </parent>
135
+ rule hasChildren(ID) => false [owise]
107
136
```
108
137
109
138
Proving a goal may involve proving other subgoals:
You can’t perform that action at this time.
0 commit comments