newground.term_transformer module
Preliminary transformer module/class. Necessary for domain inference, and strongly-connected-component computation.
- class newground.term_transformer.TermTransformer(*args: Any, **kwargs: Any)
Bases:
Transformer
Preliminary transformer module/class. Necessary for domain inference, and strongly-connected-component computation.
- add_predicate_name_to_dependency_graph(predicate, rule, predicate_name)
Adds a predicate in the dependency graph.
- dependency_graph_update(predicate, rule)
Add node/predicate and relevant edges to dependency graph. Note that it is assumed that the head predicates are always considered first.
- update_predicate_in_dependency_graph(predicate, rule, predicate_name)
Updates a predicate in the dependency graph.
- visit_Aggregate(node)
Visits an aggregate in clingo AST.
- visit_Comparison(node)
Visits a clingo-AST comparison.
- visit_Function(node)
Visits a clingo-AST function (similar to non-negated literals). Calls relevant children (terms/variables/constants). Important for dependency (SCC) graph updates.
- visit_HeadAggregateElement(node)
Visits a clingo-AST head-aggregate.
- visit_Interval(node)
Visits an clingo-AST interval. Adds relevant domains.
- visit_Literal(node)
Visits a clingo-AST literal (negated/non-negated).
- visit_Program(node)
Visits a program block in clingo AST. Detects relevant keywords.
- visit_Rule(node)
Visits a rule in the clingo-AST. Ensures that children are visited. Assumes head is (single) literal.
- visit_ShowSignature(node)
Ensures that signature is only written to cmd-line, if no_show if false.
- visit_SymbolicTerm(node)
Visits symbolic-term and adds relevant domains.
- visit_Variable(node)
Visits a clingo-AST variable. Determines safeness of variables.