proves
rule_add_with(ex, func)
Distribute max/min over add.
call(+, ~a..., call(max/min, ~b...), ~c...) =>
call(max/min, map(x -> call(+, a..., x, c...), b)...))
Source code in src/finch/finch_notation/proves.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
rule_all_literals(ex)
All args are literals.
Source code in src/finch/finch_notation/proves.py
27 28 29 30 31 32 33 34 35 36 37 38 | |
rule_associative_flatten(ex)
Flatten nested associative ops.
Source code in src/finch/finch_notation/proves.py
57 58 59 60 61 62 63 64 65 66 67 | |
rule_disjoint_flat_pair(ex, func1, func2)
Handle two mins/maxes in max/min.
Source code in src/finch/finch_notation/proves.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
rule_disjoint_flat_single(ex, func1, func2)
Remove min/max from max/min when disjoint.
Source code in src/finch/finch_notation/proves.py
155 156 157 158 159 160 161 162 163 164 165 166 | |
rule_disjoint_nested(ex, func1, func2)
Handle nested max/min in min/max.
Source code in src/finch/finch_notation/proves.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
rule_equal_same(ex)
Match eq(a, a) => True.
Source code in src/finch/finch_notation/proves.py
70 71 72 73 74 | |
rule_ge(ex)
Transform ge(a, b) => eq(a, max(a, b)).
Source code in src/finch/finch_notation/proves.py
77 78 79 80 81 | |
rule_idempotent_unique(ex)
Remove duplicates from idempotent op.
Source code in src/finch/finch_notation/proves.py
41 42 43 44 45 46 47 | |
rule_le(ex)
Transform le(a, b) => eq(max(a, b), b).
Source code in src/finch/finch_notation/proves.py
84 85 86 87 88 | |
rule_single_arg(ex)
Collapse single-arg calls.
Source code in src/finch/finch_notation/proves.py
50 51 52 53 54 | |