public class LoopApplyHeadBuiltInRuleApp extends AbstractBuiltInRuleApp
LoopApplyHeadRule
.Modifier and Type | Field and Description |
---|---|
protected ImmutableSet<LoopContract> |
contracts
The loop contracts on which the rule is applied.
|
protected AbstractAuxiliaryContractRule.Instantiation |
instantiation
The instantiation.
|
private LoopApplyHeadRule |
rule
The rule being applied.
|
builtInRule, ifInsts, pio
Constructor and Description |
---|
LoopApplyHeadBuiltInRuleApp(BuiltInRule rule,
PosInOccurrence pio) |
LoopApplyHeadBuiltInRuleApp(BuiltInRule rule,
PosInOccurrence pio,
ImmutableSet<LoopContract> contracts) |
Modifier and Type | Method and Description |
---|---|
boolean |
cannotComplete(Goal goal) |
boolean |
complete()
returns true if all variables are instantiated
|
boolean |
isSufficientlyComplete()
returns true if tryToInstantiate may be able to complete the app
|
AbstractBuiltInRuleApp |
replacePos(PosInOccurrence newPos) |
IBuiltInRuleApp |
setIfInsts(ImmutableList<PosInOccurrence> ifInsts) |
AbstractBuiltInRuleApp |
tryToInstantiate(Goal goal)
Tries to complete the rule application from the available information.
|
execute, forceInstantiate, getHeapContext, ifInsts, posInOccurrence, rule, setMutable, toString
private LoopApplyHeadRule rule
protected ImmutableSet<LoopContract> contracts
protected AbstractAuxiliaryContractRule.Instantiation instantiation
public LoopApplyHeadBuiltInRuleApp(BuiltInRule rule, PosInOccurrence pio)
rule
- the rule being applied.pio
- the position at which the rule is applied.public LoopApplyHeadBuiltInRuleApp(BuiltInRule rule, PosInOccurrence pio, ImmutableSet<LoopContract> contracts)
rule
- the rule being applied.pio
- the position at which the rule is applied.contracts
- the contracts on which the rule is applied.public boolean complete()
AbstractBuiltInRuleApp
complete
in interface RuleApp
complete
in class AbstractBuiltInRuleApp
public boolean cannotComplete(Goal goal)
goal
- the current goal.true
iff the rule application cannot be completed for the current goal.public boolean isSufficientlyComplete()
IBuiltInRuleApp
isSufficientlyComplete
in interface IBuiltInRuleApp
isSufficientlyComplete
in class AbstractBuiltInRuleApp
public AbstractBuiltInRuleApp replacePos(PosInOccurrence newPos)
replacePos
in interface IBuiltInRuleApp
replacePos
in class AbstractBuiltInRuleApp
public IBuiltInRuleApp setIfInsts(ImmutableList<PosInOccurrence> ifInsts)
setIfInsts
in interface IBuiltInRuleApp
setIfInsts
in class AbstractBuiltInRuleApp
public AbstractBuiltInRuleApp tryToInstantiate(Goal goal)
IBuiltInRuleApp
UserInterfaceControl
to complete a built-in rule.
Returns a complete app only if there is exactly one contract.
If you want a complete app for combined contracts, use forceInstantiate
instead.
For an example implementation see e.g. UseOperationContractRule
or UseDependencyContractRule
.tryToInstantiate
in interface IBuiltInRuleApp
tryToInstantiate
in class AbstractBuiltInRuleApp