Skip to content

Commit d247113

Browse files
committed
TODO: ApplyResult
1 parent 190dca9 commit d247113

File tree

1 file changed

+12
-40
lines changed

1 file changed

+12
-40
lines changed

kore/src/Kore/Strategies/Goal.hs

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,18 @@ class Goal goal where
213213
=> goal
214214
-> Strategy.TransitionT (Rule goal) m goal
215215

216+
{- TODO (thomas.tuegel): applyClaims and applyAxioms should return:
217+
218+
> data ApplyResult goal
219+
> = ApplyRewritten !goal
220+
> | ApplyRemainder !goal
221+
222+
Rationale: ProofState is part of the implementation of transitionRule, that
223+
is: these functions have hidden knowledge of how transitionRule works
224+
because they tell it what to do next. Instead, they should report their
225+
result and leave the decision up to transitionRule.
226+
227+
-}
216228
applyClaims
217229
:: MonadSimplify m
218230
=> [goal]
@@ -225,18 +237,6 @@ class Goal goal where
225237
-> goal
226238
-> Strategy.TransitionT (Rule goal) m (ProofState goal)
227239

228-
deriveSeq
229-
:: MonadSimplify m
230-
=> [Rule goal]
231-
-> goal
232-
-> Strategy.TransitionT (Rule goal) m (ProofState goal)
233-
234-
derivePar
235-
:: MonadSimplify m
236-
=> [Rule goal]
237-
-> goal
238-
-> Strategy.TransitionT (Rule goal) m (ProofState goal)
239-
240240
type AxiomAttributes = Attribute.Axiom.Axiom Symbol VariableName
241241

242242
class ClaimExtractor claim where
@@ -307,25 +307,10 @@ instance Goal OnePathRule where
307307

308308
applyAxioms axioms = deriveSeqOnePath (concat axioms)
309309

310-
deriveSeq = deriveSeqOnePath
311-
312-
derivePar = deriveParOnePath
313-
314310
isTriviallyValid = isTriviallyValid' _Unwrapped
315311

316312
strategy _ _ _ = onePathFirstStep :> Stream.iterate id onePathFollowupStep
317313

318-
deriveParOnePath
319-
:: MonadSimplify simplifier
320-
=> [Rule OnePathRule]
321-
-> OnePathRule
322-
-> Strategy.TransitionT (Rule OnePathRule) simplifier
323-
(ProofState OnePathRule)
324-
deriveParOnePath rules =
325-
derivePar' _Unwrapped OnePathRewriteRule rewrites
326-
where
327-
rewrites = unRuleOnePath <$> rules
328-
329314
deriveSeqOnePath
330315
:: MonadSimplify simplifier
331316
=> [Rule OnePathRule]
@@ -379,9 +364,6 @@ instance Goal AllPathRule where
379364
| all isTriviallyValid proofState = pure Proven
380365
| otherwise = pure proofState
381366

382-
derivePar = deriveParAllPath
383-
deriveSeq = deriveSeqAllPath
384-
385367
strategy _ _ _ = allPathFirstStep :> Stream.iterate id allPathFollowupStep
386368

387369
deriveParAllPath
@@ -433,16 +415,6 @@ instance Goal ReachabilityRule where
433415
isTriviallyValid (AllPath goal) = isTriviallyValid goal
434416
isTriviallyValid (OnePath goal) = isTriviallyValid goal
435417

436-
derivePar rules (AllPath goal) =
437-
allPathTransition $ fmap AllPath <$> derivePar (map coerce rules) goal
438-
derivePar rules (OnePath goal) =
439-
onePathTransition $ fmap OnePath <$> derivePar (map coerce rules) goal
440-
441-
deriveSeq rules (AllPath goal) =
442-
allPathTransition $ fmap AllPath <$> deriveSeq (map coerce rules) goal
443-
deriveSeq rules (OnePath goal) =
444-
onePathTransition $ fmap OnePath <$> deriveSeq (map coerce rules) goal
445-
446418
applyClaims claims (AllPath goal) =
447419
applyClaims (mapMaybe maybeAllPath claims) goal
448420
& fmap (fmap AllPath)

0 commit comments

Comments
 (0)