§ 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 (ie, the formula is a tautology, so it's true in all models).
- Then we must have F⟹x1=y1 or F=x2=y2.
- Inutitively, if F implies a disjunction of equalities, then it implies at least one equality. (Generalize to n disjuncts.)
§ Convex Theory in Terms of Geometry
- 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.
- For a (non) example, we can take F a square: x≥0∧x≤1∧y≥0∧y≤1. But a point being in a square does not imply equality of the point to any coordinate!
- So we must have a tight constraint, ie, the convex set must itself be a point.
- If the convex set itself is a point, like x≥1∧x≤1∧y≥1∧y≤1, then we can indeed have a disjunction of equalities it implies, and only one of these disjncts will be true!
§ Non Convex Theory: LIA
- For a example, we can take F a square: x≥0∧x≤1∧y≥0∧y≤1. But a point being in a square in the integers does imply facts about coordinates! For example, it implies that x=1∨x=2.
- However, we cannot conclude from this that "point in square implies x=1" or "point in square implies x=2" in all models (ie, the two statements are not tautologies).
- Example 2 of LIA is not convex: suppose F=1≤x≤2. Then, to be convex, 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.
- Another intuition: membership in a bounded set in LIA has a finite disjunctive formula that witnesses it, by enumerating integer points in the bounded set. This can be used as the disjunctive RHS.
- But such a splitting is necessarily forcing a case split :)
- On the other hand, in the case of rationals, there is no such finite disjuntive formula, so any implied equalities really do hold in all models (points that are in the sets)
§ 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