Lattice
oqd_compiler_infrastructure.lattice
¶
LatticeTop
¶
Base class representing the top element of the lattice.
In LatticeBase, nodes are classes that inherit from LatticeTop.
LatticeBottom
¶
Lattice
¶
Bases: ABC, Generic[LatticeType]
Abstract base class for a lattice interface.
Source code in oqd-compiler-infrastructure/src/oqd_compiler_infrastructure/lattice.py
LatticeBase
¶
Bases: Lattice[LatticeType]
Concrete implementation of a lattice interface.
Source code in oqd-compiler-infrastructure/src/oqd_compiler_infrastructure/lattice.py
__init__()
¶
Initializes lattice with top and bottom nodes. The map is a dictionary that maps each node of the lattice to its immediate parent(s).
Source code in oqd-compiler-infrastructure/src/oqd_compiler_infrastructure/lattice.py
is_class_node(t: object) -> bool
¶
add_node(t, parent)
¶
Adds a node to the lattice, by tracking the parent(s) of the node.
atomic_ancestors(t)
¶
Returns the atomic ancestors of a given node.
Source code in oqd-compiler-infrastructure/src/oqd_compiler_infrastructure/lattice.py
leq(t1: LatticeType, t2: LatticeType) -> bool
¶
Returns True if t1 <= t2 in the lattice.
Source code in oqd-compiler-infrastructure/src/oqd_compiler_infrastructure/lattice.py
join(t1: LatticeType, t2: LatticeType) -> LatticeType
¶
Returns the least upper bound of t1 and t2.
Source code in oqd-compiler-infrastructure/src/oqd_compiler_infrastructure/lattice.py
meet(t1: LatticeType, t2: LatticeType) -> LatticeType
¶
Returns the greatest lower bound of t1 and t2.