newground.domain_transformer module

Necessary for domain inference. In conjunction with the Term-transformer used to infer the domain.

class newground.domain_transformer.DomainTransformer(*args: Any, **kwargs: Any)

Bases: Transformer

Necessary for domain inference. In conjunction with the Term-transformer used to infer the domain.

remove_unnecessary_safe_positions(safe_positions)

If a variable has a ‘’safe’’ position that is a term, then the term-safe-position can be removed, if the variable has at least one more safe-position.

try_upper_boun_left_side(node, new_domain, left, right, comparison_operator)

Check if left side can be upper-bounded.

try_upper_bound_domain(all_variables_present, node, new_domain)

If there is a comparison like X < 5 one can (possibly) make the domain smaller.

try_upper_bound_right_side(node, new_domain, left, right, comparison_operator)

Check if right side can be upper-bounded.

visit_Aggregate(node)

Visits an clingo-AST aggregate.

visit_Function(node)

Visits an clingo-AST function.

visit_Rule(node)

Visits an clingo-AST rule.

visit_SymbolicTerm(node)

Visits an clingo-AST symbolic term (constant).

visit_Variable(node)

Visits an clingo-AST variable. Takes care of most things about domain-inference.