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, toStringprivate 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()
AbstractBuiltInRuleAppcomplete in interface RuleAppcomplete in class AbstractBuiltInRuleApppublic boolean cannotComplete(Goal goal)
goal - the current goal.true iff the rule application cannot be completed for the current goal.public boolean isSufficientlyComplete()
IBuiltInRuleAppisSufficientlyComplete in interface IBuiltInRuleAppisSufficientlyComplete in class AbstractBuiltInRuleApppublic AbstractBuiltInRuleApp replacePos(PosInOccurrence newPos)
replacePos in interface IBuiltInRuleAppreplacePos in class AbstractBuiltInRuleApppublic IBuiltInRuleApp setIfInsts(ImmutableList<PosInOccurrence> ifInsts)
setIfInsts in interface IBuiltInRuleAppsetIfInsts in class AbstractBuiltInRuleApppublic AbstractBuiltInRuleApp tryToInstantiate(Goal goal)
IBuiltInRuleAppUserInterfaceControl 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 IBuiltInRuleApptryToInstantiate in class AbstractBuiltInRuleApp