Constructs a Dependency graph for the provided list of Derivations.
Constructs a Dependency graph for the provided list of Derivations. Each Derivation will yield a Node describing its output and other Nodes requiring its output.
a List of all possible Derivations
a Set of Nodes which reference their dependent Nodes
Determines the order in which Facts should be calculated, based on their inputs.
Determines the order in which Facts should be calculated, based on their inputs. It takes a Derivation-graph as constructed by FactEngine.constructGraph and orders them in levels. Each level contains Derivation-nodes for which the inputs will have been determined in an earlier level. Following these levels while running a derivation cycle will guarantee correct causality between individual Derivations.
the Set of Nodes describing the dependency graph between Derivations
a List of levels that produce facts required for subsequent levels. Each level is a list of Nodes that can be evaluated once all previous levels have been evaluated
Runs the provided Derivations and yields the resulting Context as well as a List of all Steps computed.
Runs the provided Derivations and yields the resulting Context as well as a List of all Steps computed.
initial Context containing all input values.
a List of Derivations to consider with all the input values.
a tuple containing the resulting Context and a List of all Steps taken.
Takes a List of Derivations an abstract initial situation and an evaluation function.
Takes a List of Derivations an abstract initial situation and an evaluation function. This then creates an evaluation graph and starts evaluating the nodes. Each actual evaluation is delegated to the evaluator argument.
type of state used by the evaluator function. The algorithm is oblivious to the structure of the state and will only pass it to the evaluator function.
initial state to pass into the evaluator function when visiting the first node. Any subsequent invocations of the evaluator function will be provided with the result of processing the previous node.
a List of all Derivations to consider. The function will try to call all derivations for which inputs become available.
the function to process a node. This function is provided the current state and the derivation of the current node. It must return a new state to be used for the next node.
the resulting state of the last invocation to the evaluator function.
Runs the provided Derivations and yields the resulting Context containing all inputs as well as all computed values.
Runs the provided Derivations and yields the resulting Context containing all inputs as well as all computed values.
initial Context containing all the input values.
a List of Derivations to consider with all the input values.
a Context containing all input values and all computed values.