public class LetFeature extends java.lang.Object implements Feature
TermBuffer
to a certain value,
namely to a term that is generated by a ProjectionToTerm
.
This is mostly useful to make feature terms more readable, and to avoid
repeated evaluation of projections.Modifier and Type | Field and Description |
---|---|
private Feature |
body |
private ProjectionToTerm |
value |
private TermBuffer |
var |
Modifier | Constructor and Description |
---|---|
private |
LetFeature(TermBuffer var,
ProjectionToTerm value,
Feature body) |
Modifier and Type | Method and Description |
---|---|
RuleAppCost |
computeCost(RuleApp app,
PosInOccurrence pos,
Goal goal)
Evaluate the cost of a
RuleApp . |
static Feature |
create(TermBuffer var,
ProjectionToTerm value,
Feature body) |
private final TermBuffer var
private final ProjectionToTerm value
private final Feature body
private LetFeature(TermBuffer var, ProjectionToTerm value, Feature body)
public static Feature create(TermBuffer var, ProjectionToTerm value, Feature body)
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).