class documentation

class ModelCache: (source)

View In Hierarchy

Undocumented

Static Method combine Undocumented
Method __eq__ Undocumented
Method __getstate__ Undocumented
Method __hash__ Undocumented
Method __init__ Undocumented
Method __setstate__ Undocumented
Method eval_ast Eval the ast, replacing symbols by their last value in the model.
Method eval_constraints Returns whether the constraints is satisfied trivially by using the last model.
Method eval_list Evaluate a list of ASTs.
Method filter Undocumented
Instance Variable constraint_only_replacements Undocumented
Instance Variable model Undocumented
Instance Variable replacements Undocumented
Method _leaf_op Undocumented
Method _leaf_op_existonly Undocumented
Class Variable _defaults Undocumented
Instance Variable _hash Undocumented
@staticmethod
def combine(*models): (source)

Undocumented

def __eq__(self, other): (source)

Undocumented

def __getstate__(self): (source)

Undocumented

def __hash__(self): (source)

Undocumented

def __init__(self, model): (source)

Undocumented

def __setstate__(self, s): (source)

Undocumented

def eval_ast(self, ast, allow_unconstrained: bool = True): (source)

Eval the ast, replacing symbols by their last value in the model. :param ast: The AST to evaluate. :param allow_unconstrained: When set to True, we will treat non-existent variables as unconstrained variables and will use arbitrary concrete values for them during evaluation. Otherwise, raise KeyErrors for non-existent variables.

def eval_constraints(self, constraints): (source)

Returns whether the constraints is satisfied trivially by using the last model.

def eval_list(self, asts, allow_unconstrained: bool = True) -> Tuple: (source)

Evaluate a list of ASTs. :param asts: A list of ASTs to evaluate. :param allow_unconstrained: When set to True, we will treat non-existent variables as unconstrained variables and will use arbitrary concrete values for them during evaluation. Otherwise, raise KeyErrors for non-existent variables. :return: A tuple of evaluated results, one element per AST.

def filter(self, variables): (source)

Undocumented

constraint_only_replacements = (source)

Undocumented

Undocumented

replacements = (source)

Undocumented

def _leaf_op(self, a): (source)

Undocumented

def _leaf_op_existonly(self, a): (source)

Undocumented

_defaults: set = (source)

Undocumented

Undocumented