Skip to main content

Lecture 2: Inference Systems and Selection Functions

Laura Kovács and Andrei Voronkov

Inference Systems​

  • Inference has the form F1  …  FnG\displaystyle\frac{F_1 \; \ldots \; F_n}{G}, where n≥0n\geq 0 and F1,…,Fn,GF_1, \ldots, F_n, G are formulas.
  • The formula GG is called the conclusion of the inference;
  • The formulas F1,…,FnF_1, \ldots, F_n are called its premises.
  • An inference rule RR is a set of inferences.
  • Every inference I∈RI \in R is called an instance of RR.
  • An Inference system I\mathbb{I} is a set of inference rules.
  • Axiom: inference rule with no premises.

Inference System: Example​

  • Represent the natural number nn by the string ∣…∣⏟n  timesε\underbrace{|\ldots|}_{n\; \text{times}}\varepsilon

  • The following inference system contains 6 inference rules for deriving equalities between expressions containing natural numbers, addition (++) and multiplication (⋅\cdot).

  • ε=ε\displaystyle\frac{}{\varepsilon=\varepsilon} (ε)(\varepsilon)

  • x=y∣x=∣y\displaystyle\frac{x=y}{|x=|y} (∣)(|)

  • ε+x=x\displaystyle\frac{}{\varepsilon+x=x} (+1)(+_1)

  • x+y=z∣x+y=∣z\displaystyle\frac{x+y=z}{|x+y=|z} (+2)(+_2)

  • ε⋅x=ε\displaystyle\frac{}{\varepsilon \cdot x = \varepsilon} (⋅1)(\cdot_1)

  • x⋅y=u          y+u=z∣x⋅y=z\displaystyle\frac{x\cdot y = u \;\;\;\;\; y+u=z}{|x\cdot y = z} (⋅2)(\cdot_2)

Derivation, Proof​

  • Derivation in an inference system I\mathbb{I}: a tree built from inferences in I\mathbb{I}.
  • If the root of this derivation is EE, then we say it is a derivation of EE.
  • Proof of EE: a finite derivation whose leaves are axioms.
  • Derivation of EE from E1,…,EmE_1 , \ldots , E_m : a finite derivation of EE whose every leaf is either an axiom or one of the expressions E1,…,EmE_1 , \ldots , E_m.

Examples​

For example,

∣∣ε+∣ε=∣∣∣ε∣∣∣ε+∣ε=∣∣∣∣ε\displaystyle\frac{||\varepsilon + |\varepsilon = |||\varepsilon}{|||\varepsilon + |\varepsilon = ||||\varepsilon} (+2)(+_2)

is an inference that is an instance (special case) of the inference rule:

x+y=z∣x+y=∣z\displaystyle\frac{x+y=z}{|x+y=|z} (+2)(+_2).

It has one premise, ∣∣ε+∣ε=∣∣∣ε||\varepsilon + |\varepsilon = |||\varepsilon, and the conclusion ∣∣∣ε+∣ε=∣∣∣∣ε|||\varepsilon + |\varepsilon = ||||\varepsilon.

The axiom

ε+∣∣∣ε=∣∣∣ε\displaystyle\frac{}{\varepsilon + |||\varepsilon = |||\varepsilon} (+1)(+_1)

is an instance of the rule

ε+x=x\displaystyle\frac{}{\varepsilon + x = x} (+1)(+_1)

Proof, Derivation in this Inference System​

Arbitrary First-Order Formulas​

  • A first-order signature (vocabulary): function symbols (including constants), predicate symbols. Equality is part of the language.
  • A set of variables.
  • Terms are built using variables and function symbols. For example, f(x)+g(x)f(x) + g(x).
  • Atoms, or atomic formulas are obtained by applying a predicate symbol to a sequence of terms. For example, p(a,x)p(a, x) or f(x)+g(x)≥2f(x) + g(x) \geq 2.
  • Formulas: built from atoms using logical connectives ¬,∧,∨,→,↔\neg, \land, \lor , \to, \leftrightarrow and quantifiers ∀,∃\forall, \exists. For example, (∀x)x=0∨(∃y)y>x(\forall x)x=0 \lor (\exists y) y>x

Clauses​

  • Literal: either an atom AA or its negation ¬A\neg A.
  • Clause: a disjunction L1∨…∨LnL_1 \lor \ldots \lor L_n of literals, where n≥0n \geq 0.
  • Empty clause, denoted by □\square: clause with 0 literals, that is, when n=0n = 0.
  • A formula in Clausal Normal Form (CNF): a conjunction of clauses.
  • From now on: A clause is ground if it contains no variables.
  • If a clause contains variables, we assume that it implicitly universally quantified. That is, we treat p(x)∨q(x)p(x) \lor q(x) as ∀x(p(x)∨q(x))\forall x(p(x) \lor q(x)).

🎬 Animation: Follow a formula through CNF conversion step by step.

Binary Resolution Inference System​

The binary resolution inference system, denoted by BR\mathbb{BR} is an inference system on propositional clauses (or ground clauses).

It consists of two inference rules:

  • Binary resolution, denoted by BR:
    • p∨C1        ¬p∨C2C1∨C2\displaystyle\frac{p\lor C_1 \;\;\;\; \neg p \lor C_2}{C_1 \lor C_2} (BR)(BR)
  • Factoring, denoted by Fact:
    • L∨L∨CL∨C\displaystyle\frac{L \lor L \lor C}{L \lor C} (Fact)(Fact)

🎬 Animation: See first-order resolution, including the unifier and resolvent.

Soundness​

  • An inference is sound if the conclusion of this inference is a logical consequence of its premises.
  • An inference system is sound if every inference rule in this system is sound.
  • BR\mathbb{BR} is sound.
  • Consequence of soundness:
    • let SS be a set of clauses.
    • If □\square can be derived from SS in BR\mathbb{BR}, then SS is unsatisfiable.

Example​

Consider the following set SS of clauses:

  • {¬p∨¬q,    ¬p∨q,    p∨¬q,    p∨q}\{\neg p \lor \neg q,\;\; \neg p \lor q,\;\; p \lor \neg q,\;\; p \lor q\}

Is S unsatisfiable?

The following derivation derives the empty clause from this set:

Hence, this set SS of clauses is unsatisfiable.

Exercise​

Consider the following set SS of clauses:

  • {¬p∨¬q,    ¬p∨q,    p∨¬q,    p∨q}\{\neg p \lor \neg q,\;\; \neg p \lor q,\;\; p \lor \neg q,\;\; p \lor q\}

Show that there exists an infinite number of different BR\mathbb{BR} derivations of the empty clause □\square from the clauses of SS.

Can this be used for checking (un)satisfiability?​

  1. What happens when the empty clause cannot be derived from SS?
  2. How can one search for possible derivations of the empty clause?

  1. Completeness.
    • Let SS be an unsatisfiable set of clauses.
      • Then there exists a derivation of □\square from SS in BR\mathbb{BR}.
  2. We have to formalize search for derivations.

However, before doing this we will introduce a slightly more refined inference system.

Selection Functions​

A literal selection function is a function that selects literals in a clause.

  • If CC is non-empty, then at least one literal is selected in CC.

We denote selected literals by underlining them, e.g.,

p‾∨¬q \underline{p} \lor \neg q
  • Note: selection function does not have to be a function.
    • It can be any oracle that selects literals.

Binary Resolution with Selection​

We introduce a family of inference systems, parameterised by a literal selection function σ\sigma.

The binary resolution inference system, denoted by BRσ\mathbb{BR}\sigma, consists of two inference rules:

  • Binary resolution, denoted by BRBR
    • p‾∨C1        ¬p‾∨C2C1∨C2\displaystyle\frac{\underline{p}\lor C_1 \;\;\;\; \underline{\neg p} \lor C_2}{C_1 \lor C_2} (BR)(BR)
  • Positive factoring, denoted by FactFact:
    • p‾∨p‾∨Cp∨C\displaystyle\frac{\underline{p} \lor \underline{p} \lor C}{p \lor C} (Fact)(Fact)

Completeness?​

Binary resolution with selection may be incomplete, even when factoring is unrestricted (also applied to negative literals).

Consider this set of clauses:

(1)¬q∨r‾(2)¬p∨q‾(3)¬r∨¬q‾(4)¬q∨¬p‾(5)¬p∨¬r‾(6)¬r∨p‾(7)r∨q∨p‾ \begin{array}{ll} (1) & \neg q \lor \underline{r}\\ (2) & \neg p \lor \underline{q}\\ (3) & \neg r \lor \underline{\neg q}\\ (4) & \neg q \lor \underline{\neg p}\\ (5) & \neg p \lor \underline{\neg r}\\ (6) & \neg r \lor \underline{p}\\ (7) & r \lor q \lor \underline{p}\\ \end{array}

It is unsatisfiable:

(8)q∨p(6,7)(9)q(2,8)(10)r(1,9)(11)¬q(3,10)(12)□(9,11) \begin{array}{ll} (8) & q \lor p & (6,7)\\ (9) & q & (2,8)\\ (10) & r & (1,9)\\ (11) & \neg q & (3,10)\\ (12) & \square & (9,11) \end{array}

Note the linear representation of derivations (used by Vampire and many other provers).

However, any inference with selection applied to this set of clauses give either a clause in this set, or a clause containing a clause in this set.

Literal Orderings​

Take any well-founded ordering ≻\succ on atoms, that is, an ordering such that there is no infinite decreasing chain of atoms:

A0≻A1≻A2≻⋯A_0 ≻ A_1 ≻ A_2 \succ \cdots

In the sequel ≻\succ will always denote a well-founded ordering.

Extend it to an ordering on literals by:

  • If p≻qp \succ q, then p≻¬qp \succ \neg q and ¬p≻q\neg p \succ q;
  • ¬p≻p\neg p \succ p.

Example: Given p6≻p5≻p4≻p3≻p2≻p1p_6 \succ p_5 \succ p_4 \succ p_3 \succ p_2 \succ p_1. What is the extended ordering on literals?

Exercise: prove that the induced ordering on literals is well-founded too.

Orderings and Well-Behaved Selections​

Fix an ordering ≻\succ. A literal selection function is well-behaved if either

  • a negative literal is selected,
OR\text{OR}
  • all maximal literals (w.r.t ≻\succ) must be selected in C.

To be well-behaved, we sometimes must select more than one different literal in a clause. Example: p∨pp \lor p or p(x)∨p(y)p(x) \lor p(y).

Completeness of Binary Resolution with Selection​

Binary resolution with selection is complete for every well-behaved selection function.

Consider our previous example:

(1)¬q∨r‾(2)¬p∨q‾(3)¬r∨¬q‾(4)¬q∨¬p‾(5)¬p∨¬r‾(6)¬r∨p‾(7)r∨q∨p‾\begin{array}{ll} (1) & \neg q \lor \underline{r}\\ (2) & \neg p \lor \underline{q}\\ (3) & \neg r \lor \underline{\neg q}\\ (4) & \neg q \lor \underline{\neg p}\\ (5) & \neg p \lor \underline{\neg r}\\ (6) & \neg r \lor \underline{p}\\ (7) & r \lor q \lor \underline{p}\\ \end{array}

A well-behave selection function must satisfy:

  1. r≻qr \succ q, because of (1)(1)
  2. q≻pq \succ p, because of (2)(2)
  3. p≻rp \succ r , because of (6)(6)

There is no ordering that satisfies these conditions.

Example​

Let p,qp, q be boolean atoms and let SS be the following set of ground formulas:

{¬p∨¬q,    ¬p∨q,    p∨¬q,    p∨q}\{\neg p \lor \neg q,\;\; \neg p \lor q,\;\; p \lor \neg q,\;\; p \lor q\}

Take any ordering such that p ≻ q and any selection function σ\sigma over SS such that

{¬p∨¬q‾,    ¬p‾∨q,    p∨¬q‾,    p‾∨q}\{\neg p \lor \underline{\neg q},\;\; \underline{\neg p} \lor q,\;\; p \lor \underline{\neg q},\;\; \underline{p} \lor q\}

(a) Is σ\sigma a well-behaved selection function over SS? \\ (b) How many inferences of BRσ\mathbb{BR}σ are applicable to SS?