deeplog.formula.deeplogformulafactory
Abstract factory for building DeepLog formulas.
Concrete implementations live alongside (e.g. symbolic_factory.py,
circuit_factory.py).
Attributes
Classes
The fold algebra over the formula AST. |
Module Contents
- T
- class DeepLogFormulaFactory[source]
Bases:
abc.ABCThe fold algebra over the formula AST.
Each method is an eliminator of one formula-AST node kind: it receives the already-built results (carrier type
T) of that node’s children and returns aT. It does not operate on AST nodes directly — that is the job offold(), which drives an instance of this class over a materialized tree.Concrete algebras choose
T:strforSymbolicFormulaFactory(→ text),FormulaNodeforCircuitFactory(→ circuit lumps).- abstractmethod create_aggregation( ) T[source]
Build an aggregation node over
bindersapplyingoperationtochild.
- abstractmethod create_aggregation_op(operation: str, operands: Sequence[T]) T[source]
Build an aggregation applying
operationtooperands, of which there is one at least.
- abstractmethod create_transformation(structure: str, child: T) T[source]
Build a structure-conversion node that maps
childtostructure.
- abstractmethod create_binary_node(operator: str, lhs: T, rhs: T) T[source]
Combine
lhsandrhswith a binary operator.
- abstractmethod create_unary_node(operator: str, operand: T) T[source]
Apply a unary operator to
operand.
- abstractmethod embed_circuit(node: CircuitNode) T[source]
Eliminate a
CircuitNodelump.A lump is a compiled region of a circuit, so it is spliced in as it is: the circuit builder returns it, and text interpreters reject it, since a compiled lump has no surface syntax.