simplification
LogicSimplify
Bases: UnvalidatedForm, LogicLoader
Simplify a logic program before it is lowered.
Source code in src/finch/finch_logic/simplification.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
simplify_logic(prgm)
Algebraically simplify a logic program.
annihilate is deliberately left out. An operand of a MapJoin carries the
fields that give the result its extent, so discarding one discards a
dimension.
Source code in src/finch/finch_logic/simplification.py
27 28 29 30 31 32 33 34 35 36 37 38 39 | |
unwrap_literal(node)
Reorder(Literal(v), ()) => Literal(v), and likewise for Relabel.
A literal is zero-dimensional, so reordering or relabelling it by no fields
is the identity. Without this the algebraic rules see nothing: optimize
leaves every literal operand wrapped, so LiteralTerm never matches.
Source code in src/finch/finch_logic/simplification.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |