public class ShannonFeature extends java.lang.Object implements Feature
c ? f1 : f2
, whereby the
condition c
determines whether the value of the whole
expression is f1
(if c
returns zero, or more
general if c
returns a distinguished value
trueCost
) or f2
public RuleAppCost computeCost(RuleApp app, PosInOccurrence pos, Goal goal)
Feature
RuleApp
.computeCost
in interface Feature
app
- the RuleApppos
- position where app
is to be appliedgoal
- the goal on which app
is to be appliedRuleAppCost
object. TopRuleAppCost.INSTANCE
indicates that the rule shall not be applied at all (it is discarded by
the strategy).public static Feature createConditional(Feature cond, RuleAppCost trueCost, RuleAppCost thenValue)
cond
- the feature that decides which value is to be returnedtrueCost
- the value of cond
that is regarded as
true-valuethenValue
- the value of the feature, if cond
returns
trueCost
thenValue
if cond
returns
trueCost
, zero otherwisepublic static Feature createConditional(Feature cond, RuleAppCost trueCost, RuleAppCost thenValue, RuleAppCost elseValue)
cond
- the feature that decides which value is to be returnedtrueCost
- the value of cond
that is regarded as
true-valuethenValue
- the value of the feature if cond
returns
trueCost
elseValue
- the value of the feature if cond
does not
return trueCost
thenValue
if cond
returns
trueCost
, elseValue
otherwisepublic static Feature createConditional(Feature cond, RuleAppCost trueCost, Feature thenFeature)
cond
- the feature that decides which value is to be returnedtrueCost
- the value of cond
that is regarded as
true-valuethenFeature
- the value of the feature if cond
returns
trueCost
thenFeature
if cond
returns trueCost
, zero otherwisepublic static Feature createConditional(Feature cond, RuleAppCost trueCost, Feature thenFeature, RuleAppCost elseValue)
cond
- the feature that decides which value is to be returnedtrueCost
- the value of cond
that is regarded as
true-valuethenFeature
- the value of the feature if cond
returns
trueCost
elseValue
- the value of the feature if cond
does not
return trueCost
thenFeature
if cond
returns trueCost
, elseValue
otherwisepublic static Feature createConditional(Feature cond, RuleAppCost trueCost, Feature thenFeature, Feature elseFeature)
cond
- the feature that decides which value is to be returnedtrueCost
- the value of cond
that is regarded as
true-valuethenFeature
- the value of the feature if cond
returns
trueCost
elseFeature
- the value of the feature if cond
does not
return trueCost
thenFeature
if cond
returns trueCost
, the value of
elseFeature
otherwisepublic static Feature createConditionalBinary(Feature cond, RuleAppCost thenValue)
cond
- the feature that decides which value is to be returnedthenValue
- the value of the feature if cond
returns zerothenFeature
if cond
returns zero, zero otherwisepublic static Feature createConditionalBinary(Feature cond, RuleAppCost thenValue, RuleAppCost elseValue)
cond
- the feature that decides which value is to be returnedthenValue
- the value of the feature if cond
returns zeroelseValue
- the value of the feature if cond
does not
return zerothenValue
if cond
returns zero,
elseValue
otherwisepublic static Feature createConditionalBinary(Feature cond, Feature thenFeature, RuleAppCost elseValue)
cond
- the feature that decides which value is to be returnedthenFeature
- the value of the feature if cond
returns zeroelseValue
- the value of the feature if cond
does not
return zerothenFeature
if cond
returns zero, elseValue
otherwisepublic static Feature createConditionalBinary(Feature cond, Feature thenFeature, Feature elseFeature)
cond
- the feature that decides which value is to be returnedthenFeature
- the value of the feature if cond
returns zeroelseFeature
- the value of the feature if cond
does not
return zerothenFeature
if cond
returns zero, the value of elseFeature
otherwisepublic static Feature createConditionalBinary(Feature cond, Feature thenFeature)
cond
- the feature that decides which value is to be returnedthenFeature
- the value of the feature if cond
returns zerothenFeature
if cond
returns zero, zero otherwiseCopyright © 2003-2019 The KeY-Project.