class Solver: (source)
The solver class is instantiated for a given "problem" instance. It maintains a cache of solutions for subproblems to be able to recall them if they reoccur in the solving process.
Method | __init__ |
Initialize a solver instance. Every instance has their own cache. |
Method |
|
Try to solve the given problem. |
Instance Variable | program |
Undocumented |
Method | _ |
Find a sequence of assignments that would solve the given state. |
Method | _ |
Memoized version of FindSolution(). |
Class Variable | _cache |
Undocumented |
Class Variable | _goals |
Undocumented |
Instance Variable | _path |
Undocumented |
Instance Variable | _solved |
Undocumented |
Initialize a solver instance. Every instance has their own cache. Arguments: program: The program we're in.
Try to solve the given problem. Try to prove one or more bindings starting (and going backwards from) a given node, all the way to the program entrypoint. Arguments: start_attrs: The assignments we're trying to have, at the start node. start_node: The CFG node where we want the assignments to be active. Returns: True if there is a path through the program that would give "start_attr" its binding at the "start_node" program position. For larger programs, this might only look for a partial path (i.e., a path that doesn't go back all the way to the entry point of the program).