Skip to content

Commit cfe274a

Browse files
committed
Remove Prim type family
The associated type family Prim was only ever instantiated at a single type.
1 parent a390ba7 commit cfe274a

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

kore/src/Kore/Strategies/Goal.hs

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ License : NCSA
44
-}
55
module Kore.Strategies.Goal
66
( Goal (..)
7+
, Prim
78
, FromRulePattern (..)
89
, ClaimExtractor (..)
910
, TransitionRuleTemplate (..)
@@ -201,9 +202,9 @@ proven
201202
-> Bool
202203
proven = Foldable.null . unprovenNodes
203204

204-
class Goal goal where
205-
type Prim goal
205+
type Prim goal = ProofState.Prim (Rule goal)
206206

207+
class Goal goal where
207208
goalToRule :: goal -> Rule goal
208209
default goalToRule
209210
:: Coercible goal (Rule goal)
@@ -278,8 +279,6 @@ Things to note when implementing your own:
278279
-}
279280

280281
instance Goal OnePathRule where
281-
type Prim OnePathRule = ProofState.Prim (Rule OnePathRule)
282-
283282
goalToRule =
284283
OnePathRewriteRule
285284
. mkRewritingRule
@@ -337,8 +336,6 @@ instance ClaimExtractor OnePathRule where
337336
_ -> Nothing
338337

339338
instance Goal AllPathRule where
340-
type Prim AllPathRule = ProofState.Prim (Rule AllPathRule)
341-
342339
goalToRule =
343340
AllPathRewriteRule
344341
. mkRewritingRule
@@ -396,8 +393,6 @@ instance ClaimExtractor AllPathRule where
396393
_ -> Nothing
397394

398395
instance Goal ReachabilityRule where
399-
type Prim ReachabilityRule = ProofState.Prim (Rule ReachabilityRule)
400-
401396
goalToRule (OnePath rule) =
402397
ReachabilityRewriteRule
403398
$ mkRewritingRule
@@ -592,7 +587,6 @@ logTransitionRule rule prim proofState =
592587
transitionRuleTemplate
593588
:: forall m goal
594589
. MonadSimplify m
595-
=> Prim goal ~ ProofState.Prim (Rule goal)
596590
=> TransitionRuleTemplate m goal
597591
-> TransitionRule m goal
598592
transitionRuleTemplate
@@ -676,10 +670,7 @@ transitionRuleTemplate
676670

677671
transitionRuleWorker _ state = return state
678672

679-
onePathFirstStep
680-
:: Prim goal ~ ProofState.Prim (Rule goal)
681-
=> [Rule goal]
682-
-> Strategy (Prim goal)
673+
onePathFirstStep :: [Rule goal] -> Strategy (Prim goal)
683674
onePathFirstStep axioms =
684675
(Strategy.sequence . map Strategy.apply)
685676
[ CheckProven
@@ -696,11 +687,7 @@ onePathFirstStep axioms =
696687
, TriviallyValid
697688
]
698689

699-
onePathFollowupStep
700-
:: Prim goal ~ ProofState.Prim (Rule goal)
701-
=> [Rule goal]
702-
-> [Rule goal]
703-
-> Strategy (Prim goal)
690+
onePathFollowupStep :: [Rule goal] -> [Rule goal] -> Strategy (Prim goal)
704691
onePathFollowupStep claims axioms =
705692
(Strategy.sequence . map Strategy.apply)
706693
[ CheckProven
@@ -1026,7 +1013,6 @@ debugProofStateBracket
10261013
. MonadLog monad
10271014
=> ToReachabilityRule goal
10281015
=> Coercible (Rule goal) (RewriteRule RewritingVariableName)
1029-
=> Prim goal ~ ProofState.Prim (Rule goal)
10301016
=> ProofState goal
10311017
-- ^ current proof state
10321018
-> Prim goal
@@ -1053,7 +1039,6 @@ debugProofStateFinal
10531039
=> MonadLog monad
10541040
=> ToReachabilityRule goal
10551041
=> Coercible (Rule goal) (RewriteRule RewritingVariableName)
1056-
=> Prim goal ~ ProofState.Prim (Rule goal)
10571042
=> ProofState goal
10581043
-- ^ current proof state
10591044
-> Prim goal
@@ -1075,7 +1060,6 @@ withDebugProofState
10751060
. MonadLog monad
10761061
=> ToReachabilityRule goal
10771062
=> Coercible (Rule goal) (RewriteRule RewritingVariableName)
1078-
=> Prim goal ~ ProofState.Prim (Rule goal)
10791063
=> TransitionRule monad goal
10801064
-> TransitionRule monad goal
10811065
withDebugProofState transitionFunc =

kore/test/Test/Kore/Strategies/AllPath/AllPath.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,6 @@ newtype instance Goal.Rule Goal =
318318
deriving (Eq, GHC.Generic, Show)
319319

320320
instance Goal.Goal Goal where
321-
type Prim Goal = ProofState.Prim (Goal.Rule Goal)
322-
323321
strategy _ goals rules =
324322
firstStep :> Stream.iterate id nextStep
325323
where

0 commit comments

Comments
 (0)