Not sure if this should be optional or the default, but a common pattern in building theories has raised an issue...
T = true
T &= <constraint 1>
T &= <constraint 2>
...
This ends up creating a theory T such as And(<constraint 1>, And(<constraint 2>, And ( ... ))). With any moderately sized theory, the recursion depth is hit in a variety of ways (checking height, simplifying, etc). The workaround was to just store the constraints in a list of conjuncts and then wrap as And(conjuncts), but something like the following might be reasonable behaviour:
- If taking the
And of two theories with And as their root, return the And of their children. I.e., And(T1.children, T2.children)
- If just one theory (wlog, assume
T1) is an And, add the other theory as a child of it. I.e., And(T1.children, T2)
- If neither theory is an
And, do as normal. I.e., And(T1, T2)
- Same for disjunctions.
Not sure if this should be optional or the default, but a common pattern in building theories has raised an issue...
This ends up creating a theory
Tsuch asAnd(<constraint 1>, And(<constraint 2>, And ( ... ))). With any moderately sized theory, the recursion depth is hit in a variety of ways (checking height, simplifying, etc). The workaround was to just store the constraints in a list ofconjunctsand then wrap asAnd(conjuncts), but something like the following might be reasonable behaviour:Andof two theories withAndas their root, return theAndof their children. I.e.,And(T1.children, T2.children)T1) is anAnd, add the other theory as a child of it. I.e.,And(T1.children, T2)And, do as normal. I.e.,And(T1, T2)