Skip to content

Commit 1e3a3a1

Browse files
authored
kore-exec: make --strategy all default; clean-up (#2209)
* strategy: make all default strategy * strategy: remove heat-cool strategy options * Remove heat-cool code * Address review comment
1 parent 9dd3714 commit 1e3a3a1

File tree

7 files changed

+5
-311
lines changed

7 files changed

+5
-311
lines changed

kore/app/exec/Main.hs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,13 @@ parseKoreExecOptions startTime =
367367
option (readSum "strategy" strategies)
368368
( metavar "STRATEGY"
369369
<> long "strategy"
370-
-- TODO (thomas.tuegel): Make defaultStrategy the default when it
371-
-- works correctly.
372-
<> value ("any", priorityAnyStrategy)
370+
<> value ("all", priorityAllStrategy)
373371
<> help "Select rewrites using STRATEGY."
374372
)
375373
where
376374
strategies =
377375
[ ("any", priorityAnyStrategy)
378376
, ("all", priorityAllStrategy)
379-
, ("any-heating-cooling", heatingCooling priorityAnyStrategy)
380-
, ("all-heating-cooling", heatingCooling priorityAllStrategy)
381377
]
382378
breadth =
383379
option auto

kore/src/Kore/Attribute/Axiom.hs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Maintainer : thomas.tuegel@runtimeverification.com
99

1010
module Kore.Attribute.Axiom
1111
( Axiom (..)
12-
, HeatCool (..)
1312
, ProductionID (..)
1413
, Priority (..)
1514
, Owise (..)
@@ -61,7 +60,6 @@ import Kore.Attribute.Axiom.Symbolic
6160
import Kore.Attribute.Axiom.Unit
6261
import Kore.Attribute.Comm
6362
import Kore.Attribute.Functional
64-
import Kore.Attribute.HeatCool
6563
import Kore.Attribute.Idem
6664
import Kore.Attribute.Label
6765
import Kore.Attribute.Overload
@@ -95,9 +93,7 @@ import qualified SQL
9593
-}
9694
data Axiom symbol variable =
9795
Axiom
98-
{ heatCool :: !HeatCool
99-
-- ^ An axiom may be denoted as a heating or cooling rule.
100-
, productionID :: !ProductionID
96+
{ productionID :: !ProductionID
10197
-- ^ The identifier from the front-end identifying a rule or group of rules.
10298
, priority :: !Priority
10399
-- ^ A number associated to each rule,
@@ -148,8 +144,7 @@ data Axiom symbol variable =
148144
instance Default (Axiom symbol variable) where
149145
def =
150146
Axiom
151-
{ heatCool = def
152-
, productionID = def
147+
{ productionID = def
153148
, priority = def
154149
, assoc = def
155150
, comm = def
@@ -177,8 +172,7 @@ instance
177172
where
178173
from =
179174
mconcat . sequence
180-
[ from . heatCool
181-
, from . productionID
175+
[ from . productionID
182176
, from . priority
183177
, from . assoc
184178
, from . comm
@@ -207,9 +201,6 @@ instance From (Axiom symbol variable) PriorityAttributes where
207201
, simplificationAttr = simplification
208202
}
209203

210-
instance From (Axiom symbol variable) HeatCool where
211-
from Axiom { heatCool } = heatCool
212-
213204
instance SQL.Column (Axiom SymbolOrAlias VariableName) where
214205
-- TODO (thomas.tuegel): Use a foreign key.
215206
defineColumn tableName _ =
@@ -234,8 +225,7 @@ parseAxiomAttribute
234225
-> Axiom SymbolOrAlias VariableName
235226
-> Parser (Axiom SymbolOrAlias VariableName)
236227
parseAxiomAttribute freeVariables attr =
237-
typed @HeatCool (parseAttribute attr)
238-
Monad.>=> typed @ProductionID (parseAttribute attr)
228+
typed @ProductionID (parseAttribute attr)
239229
Monad.>=> typed @Priority (parseAttribute attr)
240230
Monad.>=> typed @Assoc (parseAttribute attr)
241231
Monad.>=> typed @Comm (parseAttribute attr)

kore/src/Kore/Attribute/HeatCool.hs

Lines changed: 0 additions & 104 deletions
This file was deleted.

kore/src/Kore/Step.hs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module Kore.Step
1616
, priorityAnyStrategy
1717
, TransitionRule
1818
, transitionRule
19-
, heatingCooling
2019
-- * Re-exports
2120
, RulePattern
2221
, Natural
@@ -46,9 +45,6 @@ import qualified Kore.Step.RewriteStep as Step
4645
import Kore.Step.RulePattern
4746
( RewriteRule (..)
4847
, RulePattern
49-
, isCoolingRule
50-
, isHeatingRule
51-
, isNormalRule
5248
)
5349
import qualified Kore.Step.Simplification.Pattern as Pattern
5450
( simplifyTopConfiguration
@@ -171,24 +167,3 @@ priorityAnyStrategy rewrites =
171167
anyRewrite sortedRewrites
172168
where
173169
sortedRewrites = sortOn Attribute.getPriorityOfAxiom rewrites
174-
175-
{- | Heat the configuration, apply a normal rewrite, and cool the result.
176-
-}
177-
-- TODO (thomas.tuegel): This strategy is not right because heating/cooling
178-
-- rules must have side conditions if encoded as \rewrites, or they must be
179-
-- \equals rules, which are not handled by this strategy.
180-
heatingCooling
181-
:: From rule Attribute.HeatCool
182-
=> ([rule] -> Strategy (Prim rule))
183-
-- ^ 'allRewrites' or 'anyRewrite'
184-
-> [rule]
185-
-> Strategy (Prim rule)
186-
heatingCooling rewriteStrategy rewrites =
187-
Strategy.sequence [Strategy.many heat, normal, Strategy.try cool]
188-
where
189-
heatingRules = filter isHeatingRule rewrites
190-
heat = rewriteStrategy heatingRules
191-
normalRules = filter isNormalRule rewrites
192-
normal = rewriteStrategy normalRules
193-
coolingRules = filter isCoolingRule rewrites
194-
cool = rewriteStrategy coolingRules

kore/src/Kore/Step/ClaimPattern.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ instance TopBottom ClaimPattern where
146146
instance From ClaimPattern Attribute.PriorityAttributes where
147147
from = from @(Attribute.Axiom _ _) . attributes
148148

149-
instance From ClaimPattern Attribute.HeatCool where
150-
from = from @(Attribute.Axiom _ _) . attributes
151-
152149
freeVariablesRight
153150
:: ClaimPattern
154151
-> FreeVariables RewritingVariableName

kore/src/Kore/Step/RulePattern.hs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ module Kore.Step.RulePattern
1414
, UnifyingRule (..)
1515
, rulePattern
1616
, leftPattern
17-
, isHeatingRule
18-
, isCoolingRule
19-
, isNormalRule
2017
, applySubstitution
2118
, topExistsToImplicitForall
2219
, isFreeOf
@@ -238,9 +235,6 @@ instance TopBottom (RulePattern variable) where
238235
instance From (RulePattern variable) Attribute.PriorityAttributes where
239236
from = from @(Attribute.Axiom _ _) . attributes
240237

241-
instance From (RulePattern variable) Attribute.HeatCool where
242-
from = from @(Attribute.Axiom _ _) . attributes
243-
244238
-- | Creates a basic, unconstrained, Equality pattern
245239
rulePattern
246240
:: InternalVariable variable
@@ -271,30 +265,6 @@ leftPattern =
271265
where
272266
(left, condition) = Pattern.splitTerm pattern'
273267

274-
{- | Does the axiom pattern represent a heating rule?
275-
-}
276-
isHeatingRule :: forall rule. From rule Attribute.HeatCool => rule -> Bool
277-
isHeatingRule rule =
278-
case from @rule @Attribute.HeatCool rule of
279-
Attribute.Heat -> True
280-
_ -> False
281-
282-
{- | Does the axiom pattern represent a cooling rule?
283-
-}
284-
isCoolingRule :: forall rule. From rule Attribute.HeatCool => rule -> Bool
285-
isCoolingRule rule =
286-
case from @rule @Attribute.HeatCool rule of
287-
Attribute.Cool -> True
288-
_ -> False
289-
290-
{- | Does the axiom pattern represent a normal rule?
291-
-}
292-
isNormalRule :: forall rule. From rule Attribute.HeatCool => rule -> Bool
293-
isNormalRule rule =
294-
case from @rule @Attribute.HeatCool rule of
295-
Attribute.Normal -> True
296-
_ -> False
297-
298268
-- | Converts the 'RHS' back to the term form.
299269
rhsToTerm
300270
:: InternalVariable variable
@@ -522,9 +492,6 @@ instance
522492
instance From (RewriteRule variable) Attribute.PriorityAttributes where
523493
from = from @(RulePattern _) . getRewriteRule
524494

525-
instance From (RewriteRule variable) Attribute.HeatCool where
526-
from = from @(RulePattern _) . getRewriteRule
527-
528495
instance TopBottom (RewriteRule variable) where
529496
isTop _ = False
530497
isBottom _ = False

0 commit comments

Comments
 (0)