numberize - rewrite only positive leaves, add map value numberization - #15801
numberize - rewrite only positive leaves, add map value numberization#15801lukaszsamson wants to merge 2 commits into
numberize - rewrite only positive leaves, add map value numberization#15801Conversation
| case fun.(leaf) do | ||
| ^leaf -> bdd_node_new(leaf, left, union, right) | ||
| new_leaf when right == :bdd_bot -> bdd_node_new(new_leaf, left, union, :bdd_bot) | ||
| new_leaf -> bdd_union(bdd_intersection(new_leaf, left), bdd_union(union, right)) |
There was a problem hiding this comment.
Now I am thinking... isn't our bdd_map inherently wrong because it may rewrite the leafs which means they have a different ordering? I am thinking everything needs to be written as in this formula... which would also make numberize too expensive...
There was a problem hiding this comment.
I recall one of AI reviews flagged the order not being preserved as an issue. I wasn’t able to produce code where it would surface as an evident bug. I dismissed the proposed fix with BDD rebuilds everywhere as a bad tradeoff
|
@lukaszsamson I am thinking a better solution here would be have a field in the context called numberize. So when we assemble the type here: We set this value in the stack and we interpret all integers/floats in the literal as numbers. This makes it correct by construction and we can remove numberize. We still have to address 3 from 15799 though... perhaps we have a version of disjoint that ignores numbers... but that may be complicated. |
Addresses 1 and 2 from #15799
Extracted from #15800
AssistedBy: Claude Fable 5, GPT 5.6 Sol