public final class BackTrackingManager
extends java.lang.Object
ChoicePoint
s that can occur during the
evaluation of a feature term, taking care of the different branches offered
by the points, and that is able to systematically explore the resulting
search space and enumerate all resulting rule applications.
ChoicePoint
s have to register themselves (using method
passChoicePoint
) each time they are invoked during evaluation
of the feature term, and are asked by the manager for their branches. The
manager simulates a backtracking behaviour by repeated evaluation of the
feature term.Constructor and Description |
---|
BackTrackingManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
backtrack()
In the end of an evaluation run of a feature term, this method has to be
called for checking whether it is possible to backtrack and whether a
further evaluation run is necessary
|
RuleApp |
getResultingapp() |
void |
passChoicePoint(ChoicePoint cp,
java.lang.Object ticket)
Method that has to be invoked by each feature that represents a choice
point, each time the feature is invoked during evaluation of the feature
term
|
void |
setup(RuleApp initialApp)
Method that has to be called before a sequence of evaluation runs of a
feature term.
|
public void passChoicePoint(ChoicePoint cp, java.lang.Object ticket)
cp
- the ChoicePoint
in question (which does not
have to be the same object as the feature, and which does not
have to be the same object over different evaluations of the
feature term)ticket
- a unique object (as unique as possible) that has to be
provided by the feature in order to ensure that the same
sequence of choice points occurs during the next evaluation
run (after backtracking). The ticket
must not
change between two evaluation runs of the feature termpublic void setup(RuleApp initialApp)
initialApp
- the original rule application in questionpublic boolean backtrack()
true
iff there are paths left to explore, i.e., if
evaluation should run a further timepublic RuleApp getResultingapp()
Copyright © 2003-2019 The KeY-Project.