§ Implementing Nelson Oppen
§ Disjoint theories
- Two theories are disjoint of they do not share predicates and function symbols, except for =.
§ Ensuring Disjointness and Purification
- Transform a formula in Σ1∪Σ2 into an equisatisfiable formula F1∧F2 with F1∈T1 and F2∈T2
- Introduce fresh symbols for shared subterms.
- Algorithmically, to purify a formula f(x1,…) to be in theory T1:
repeat until fixpoint:
u = gesym()
Purify[f(..., t, ...)] => Purify[f(..., u, ...)] /\ u = t
x + 2 == y, f(Store(A, x, 3)[y - 2]) != f(y - x + 1)
- Purify, introduce new constants:
- Purified:
Functions: f(v1) != f(v2)
Arrays: v1 == v3[v4], v3 == Store(x, y, v5)
Arithmetic: x + 2 == y, v2 == y - x + 1, v4 == y - 2, v5 == 2
§ Convex Theory
- Let F be a conjunctive formula.
- Let F⟹x1=y1∨x2=y2.
- Then we must have F⟹x1=y1 or F=x2=y2.
- Generalize to n disjuncts.
- Inutitively, if F implies a disjunction of equalities, then it implies at least one equality.
- LIA is not convex: suppose F=1≤x≤2. Then we have F⟹x=1∨x=2. But, F does not imply either x=1 or x=2.
- Convexity reduces what we need to handle: If we want to show x1=y1∨x2=y2, we can try to prove each disjunct first.
- See that in the case of LIA, If we want A⟹B to be true, if we view A,B as sets, then we want ¬A∨Bto be the whole space, which means that B covers whatever A used to cover, so we need A⊆B.
- Another way to look at the LIA thing: A⟹B is us saying that x∈A⟹x∈B for arbitrary x, and thus we need A⊆B!.
- Let us now view this in terms of F⟹H1∨H2.
- F is a conjunctive formula, so it is geometricaly a convex set.
- H1,H2 are equalities of the form xi=yi, so they are hyperplanes.
- To have F⟹H1∨H2 be true, we need F⊂H1∪H2.
- We now want that F⊂H1∪H2, which can only happen if F⊂H1 or F⊂H2, since a convex set can be a subset of hyperplanes only if it is contained in any hyperplane! Otherwise, we can "interpolate" a point x1∈H1 and x2∈H2 and get a point (x1+x2)/2 that lies in neither.
§ Convex theory w/ Non Trivial Model is Stably Infinite
- Suppose a theory T has a non-trivial model, and is convex.
- Then we need to show that it's stably infinite.
- Theory T is stably infinite iff for every ground quantifier free formula F that is satisfiable, there is an infinite model.
- So we are given a ground formaul F that's true in some model M of T, and we need to show that it's true in an infinite model.
- If the model M is the trivial model M=∗, then the formula F must hold in a larger model (why?)
- Suppose size of M≥2.
- We will build an infinite model for F by compactness.
- For every n∈N, we know that Mlog2n will have cardinality greater than or equal to n.
§ References