Skip to main content

Lecture 8 Exercises

Laura Kovács

Problem 8.1​

Let ff be unary, gg binary, a,b,ca,b,c constants, and x,y,zx,y,z variables. The weight function satisfies w(s)=1w(s) = 1 for every symbol and variable, and the precedence is g≫f≫c≫b≫ag \gg f \gg c \gg b \gg a. Using KBO (extended to literals/clauses), answer:

  1. Do C1C_1 and C2C_2 make C3C_3 redundant? C1:a≠b∨f(a)≠aC2:f(f(x))=aC3:f(f(b))≠b∨f(a)≠a\begin{aligned} C_1 &: a \neq b \lor f(a) \neq a\\ C_2 &: f(f(x)) = a\\ C_3 &: f(f(b)) \neq b \lor f(a) \neq a \end{aligned}
  2. Does C4C_4 make C5C_5 redundant? C4:f(g(x,a))≠f(y)C5:f(g(x,z))≠f(g(y,b))∨f(g(x,b))≠f(g(a,b))\begin{aligned} C_4 &: f\big(g(x,a)\big) \neq f(y)\\ C_5 &: f\big(g(x,z)\big) \neq f\big(g(y,b)\big) \lor f\big(g(x,b)\big) \neq f\big(g(a,b)\big) \end{aligned}
  3. Does C6C_6 make C7C_7 redundant? C6:g(x,y)≠f(x)C7:g(f(x),f(z))≠f(f(x))∨g(a,b)≠c\begin{aligned} C_6 &: g(x,y) \neq f(x)\\ C_7 &: g(f(x),f(z)) \neq f(f(x)) \lor g(a,b) \neq c \end{aligned}
Solution
  1. Yes. Clause C3C_3 is ground. Instantiating C2C_2 with {x↦b}\{x \mapsto b\} yields f(f(b))=af(f(b)) = a, and together with ground C1C_1 these clauses entail C3C_3. Both supporting clauses are strictly smaller than C3C_3 under KBO, so every ground instance of C3C_3 (namely C3C_3 itself) is redundant.
  2. Yes. The ground instance f(g(a,a))≠f(g(a,a))f(g(a,a)) \neq f(g(a,a)) of C4C_4 lies in C4∗C_4^*, is unsatisfiable, and is smaller than any ground instance of C5C_5. Therefore each ground instance of C5C_5 is redundant with respect to C4∗C_4^*.
  3. Yes. Renaming zz to yy shows g(f(x),f(z))≠f(f(x))g(f(x),f(z)) \neq f(f(x)) is an instance of g(x,y)≠f(x)g(x,y) \neq f(x). For any ground instance of C7C_7, the literal g(f(s),f(t))≠f(f(s))g(f(s),f(t)) \neq f(f(s)) is implied by the corresponding ground instance of C6C_6 and is strictly smaller than the full clause, so C6C_6 renders C7C_7 redundant.

Problem 8.2​

Consider the inference (in SUP\mathbb{SUP}, no BR\mathbb{BR}):

x=f(c)∨p(x)f(h(b))=h(g(y,y))∨h(g(d,b))≠f(c)p(h(g(d,b)))∨f(h(b))=h(g(y,y))\frac{x = f(c) \lor p(x)\qquad f(h(b)) = h(g(y,y)) \lor h(g(d,b)) \neq f(c)}{p\big(h(g(d,b))\big) \lor f(h(b)) = h(g(y,y))}

with predicate symbol pp, function symbols f,g,hf,g,h, constants b,c,db,c,d, and variables x,yx,y.

  1. Prove the inference is sound.
  2. Is it a simplifying inference of SUP\mathbb{SUP} for some KBO? Justify.
Solution
  1. Let MM satisfy both premises. If M⊨f(h(b))=h(g(y,y))M \models f(h(b)) = h(g(y,y)), the conclusion is immediate. Otherwise the second premise forces M⊨h(g(d,b))≠f(c)M \models h(g(d,b)) \neq f(c), which combined with the first premise yields M⊨p(h(g(d,b)))M \models p\big(h(g(d,b))\big), again making the conclusion true. Hence the inference is sound.

  2. No. A simplifying inference would make at least one premise redundant given the other premise and the conclusion. However:

    • Model M1M_1 with domain {a,b}\{\mathsf a,\mathsf b\}, interpreting pp as false everywhere and all f,g,hf,g,h results as a\mathsf a, satisfies C2C_2 and the conclusion but not C1C_1.
    • Model M2M_2 with domain {b,c,d,f,g,h}\{\mathsf b,\mathsf c,\mathsf d,\mathsf f,\mathsf g,\mathsf h\}, interpreting pp as the entire domain and assigning f,g,hf,g,h as in the LaTeX solution, satisfies C1C_1 and the conclusion but not C2C_2.

    Therefore neither premise becomes redundant, so the inference is not simplifying for any KBO.

Problem 8.3​

Consider the superposition inference (with lθ=l′l\theta = l' and l′=tl'=t selected):

l=rl′=t∨D(rθ=t)∨D\frac{l = r \qquad l' = t \lor D}{(r\theta = t) \lor D}

subject to l≻rl \succ r, l′≻tl' \succ t, rθ≻tr\theta \succ t, (l=r)θ≻D(l = r)\theta \succ D, (l′=t)≻D(l' = t) \succ D, and a well-behaved selection function.

  1. Is (rθ=t)∨D≻l′=t∨D(r\theta = t) \lor D \succ l' = t \lor D always true?
  2. Does l′=t∨Dl' = t \lor D necessarily become redundant after applying the inference?
Solution
  1. No. Because ≻\succ is a simplification ordering, l≻rl \succ r implies lθ≻rθl\theta \succ r\theta. Since lθ=l′l\theta = l', we obtain l′≻rθl' \succ r\theta. Multiset extension then gives l′=t∨D≻rθ=t∨Dl' = t \lor D \succ r\theta = t \lor D, so the conclusion is strictly smaller, not larger.
  2. No. Redundancy would require that every ground instance of l′=t∨Dl' = t \lor D be entailed by smaller ground instances from the premises. When l,r,tl,r,t are ground, we have l=l′l = l' and, because rθ=tr\theta = t is smaller, l=r≻l′=tl = r \succ l' = t. Hence l′=t∨Dl' = t \lor D is not larger than l=rl = r, contradicting the ordering requirement for redundancy. Thus the premise need not become redundant.

Problem 8.4​

🎬 Related animation: Review first-order resolution before analysing this inference.

In SUP\mathbb{SUP} (with BR\mathbb{BR}), consider

f(a,b)≠g(x)∨f(x,y)=g(a)f(y,b)=g(y)∨f(x,a)=g(x)∨f(y,y)=g(z)f(a,a)=g(a)\frac{f(a,b) \neq g(x) \lor f(x,y) = g(a) \qquad f(y,b) = g(y) \lor f(x,a) = g(x) \lor f(y,y) = g(z)}{f(a,a) = g(a)}

where f,gf,g are function symbols, x,y,zx,y,z variables, and a,ba,b constants.

  1. Prove the inference is sound.
  2. Is it simplifying for any KBO? Justify.
Solution
  1. Instantiate both premises with θ={x↦a,y↦a}\theta = \{x \mapsto a, y \mapsto a\}. Binary resolution yields f(a,a)=g(a)∨f(a,a)=g(a)∨f(a,a)=g(z)f(a,a) = g(a) \lor f(a,a) = g(a) \lor f(a,a) = g(z). Two applications of equality factoring generate f(a,a)=g(a)∨g(a)≠g(a)f(a,a) = g(a) \lor g(a) \neq g(a) and then f(a,a)=g(a)∨g(a)≠g(a)∨g(a)≠g(a)f(a,a) = g(a) \lor g(a) \neq g(a) \lor g(a) \neq g(a). Two equality-resolution steps reduce this to f(a,a)=g(a)f(a,a) = g(a). Therefore the conclusion follows by sound SUP\mathbb{SUP} rules, so the inference is sound.
  2. No. A simplifying inference would make at least one premise redundant. Consider:
    • Model I1I_1 with domain {a,b}\{a,b\}, interpreting f(x,a)=xf(x,a) = x, f(x,b)=bf(x,b) = b, and g(x)=xg(x) = x. Then I1⊨f(a,a)=g(a)I_1 \models f(a,a) = g(a) and I1⊨f(x,a)=g(x)I_1 \models f(x,a) = g(x), so I1I_1 satisfies the second premise and the conclusion, but I1⊭f(a,b)≠g(x)∨f(x,y)=g(a)I_1 \not\models f(a,b) \neq g(x) \lor f(x,y) = g(a) for {x↦b,y↦b}\{x \mapsto b, y \mapsto b\}; hence the first premise is not redundant.
    • Model I2I_2 with domain {a,b}\{a,b\}, interpreting f(x,y)=af(x,y) = a and g(x)=xg(x) = x. Then I2I_2 satisfies the first premise and the conclusion but falsifies the second premise for {x↦b,y↦b,z↦b}\{x \mapsto b, y \mapsto b, z \mapsto b\}. Therefore the second premise is not redundant either.

Thus the inference is not simplifying under any KBO.

Problem 8.5 (Hands-on Vampire)​

Show that the inverse of a dense order is dense. Outline a TPTP formalisation and the key steps in Vampire’s refutation (-av off).

Solution

Encode strict total order axioms and density for r1(x,y)r_1(x,y), plus clauses asserting r2(y,x)r_2(y,x) iff r1(x,y)r_1(x,y). Negate density for r2r_2 by adding a clause stating that there exist a,ba,b with no cc such that r2(a,c)r_2(a,c) and r2(c,b)r_2(c,b). Running Vampire (-av off) produces a refutation: the proof repeatedly superposes the inverse-direction axioms with the negated density clause until it forces a contradiction with density of r1r_1. Recording the premises, substitutions, and derived clauses from those superposition steps shows precisely how the contradiction—and therefore the density of the inverse relation—arises.

Problem 8.6 (Hands-on Vampire)​

Using the group axioms (associativity, left identity, inverses), prove that the left identity element ee is also a right identity. Provide a TPTP encoding (axioms plus negated goal) and describe the main superposition steps in Vampire’s refutation (-av off).

Solution

Encode the axioms:

  • Associativity: ![X,Y,Z]:mult(mult(X,Y),Z)=mult(X,mult(Y,Z))! [X,Y,Z] : mult(mult(X,Y),Z) = mult(X,mult(Y,Z)).
  • Left identity: ![X]:mult(e,X)=X! [X] : mult(e,X) = X.
  • Inverses: ![X]:mult(inv(X),X)=e! [X] : mult(inv(X),X) = e.

Add the negated goal ![X]:mult(X,e)≠X! [X] : mult(X,e) \neq X. Vampire refutes the set by chaining superposition steps: for example, superposing the inverse axiom with the negated goal yields clauses equating mult(inv(X),mult(X,e))mult(inv(X), mult(X,e)) with ee, which then rewrite to contradictions with the left-identity clause. Documenting the key superposition inferences (premises, mgus, conclusions) explains how the empty clause is ultimately derived, establishing that ee must also be a right identity.