From 537952b88cbbe4bab1ccc6ebb84f31cc9c83157b Mon Sep 17 00:00:00 2001 From: Nishant Rodrigues Date: Wed, 12 Feb 2020 02:42:53 +0530 Subject: [PATCH] Reap failed goals and children (TODO: This uses `[owise]` --- prover/strategies/core.md | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/prover/strategies/core.md b/prover/strategies/core.md index 07693e8af..3732c7d8b 100644 --- a/prover/strategies/core.md +++ b/prover/strategies/core.md @@ -95,15 +95,37 @@ completed, its result is replaced in the parent goal and the subgoal is removed. goalStrat(ID) => RStrat ... ... - ( ID - true:Bool - PID - RStrat:TerminalStrategy - ... - => .Bag - ) + ID + true:Bool => false + PID + (.K => #reap?) ~> RStrat:TerminalStrategy + ... + ... + + syntax KItem ::= "#reap?" // if goal failed prune goal and children + rule (#reap? => #reap) ~> fail + rule (#reap? => .K ) ~> success + + syntax KItem ::= "#reap" // (always) prune goal and children + rule + PID + #reap ~> RStrat:TerminalStrategy + ... + + + PID + (.K => #reap) ~> Strat:Strategy + ... + + rule + + #reap ~> Strat:Strategy + ... + => .Bag + ... + [owise] ``` Proving a goal may involve proving other subgoals: