Non-cyclic sorts for first-order satisfiability (or how to win first

Non-cyclic sorts for first-order satisfiability
(or how to win first-order satisfiability at CASC)
Konstantin Korovin1
The University of Manchester
[email protected]
FroCoS 2013
1 supported
by a Royal Society University Fellowship
First-order satisfiability
The problem: Given a set of first-order sentences S check whether S is
satisfiable.
Complementary to proof finding: Given a set of first-order sentences
check whether it is unsatisfiable.
Where satisfiability checking is used?
I
in verification for finding errors in systems
I
in combinatorial reasoning: scheduling, planning, etc.
for finding solutions
I
in checking consistency of ontologies, theories, axiomatisations
I
disproving conjectures
I
...
2 / 18
First-order satisfiability
The problem: Given a set of first-order sentences S check whether S is
satisfiable.
Complementary to proof finding: Given a set of first-order sentences
check whether it is unsatisfiable.
Where satisfiability checking is used?
I
in verification for finding errors in systems
I
in combinatorial reasoning: scheduling, planning, etc.
for finding solutions
I
in checking consistency of ontologies, theories, axiomatisations
I
disproving conjectures
I
...
2 / 18
Methods for finite model finding
General first-order satisfiability is not recursively enumerable.
Restrict to finite model finding (FMF).
I
Finite model finding is recursively enumerable.
I
But usual first-order reasoning methods such
resolution/superposition are incomplete for finite model finding
Methods for finite model finding are based on encodings into:
I
Propositional logic (FINDER, MACE, Paradox)
[Slaney; McCune; Claessen, Sörensson]
Paradox has been winning satisfiability at CASC for the last 10 years.
I
Geometric logic (Geo) [de Nivelle, Meng]
I
Effectively propositional logic (EPR) (DarwinFM, iProver)
[Baumgartner, de Nivelle, Fuchs, Tinelli]
3 / 18
Methods for finite model finding
General first-order satisfiability is not recursively enumerable.
Restrict to finite model finding (FMF).
I
Finite model finding is recursively enumerable.
I
But usual first-order reasoning methods such
resolution/superposition are incomplete for finite model finding
Methods for finite model finding are based on encodings into:
I
Propositional logic (FINDER, MACE, Paradox)
[Slaney; McCune; Claessen, Sörensson]
Paradox has been winning satisfiability at CASC for the last 10 years.
I
Geometric logic (Geo) [de Nivelle, Meng]
I
Effectively propositional logic (EPR) (DarwinFM, iProver)
[Baumgartner, de Nivelle, Fuchs, Tinelli]
3 / 18
Methods for finite model finding
General first-order satisfiability is not recursively enumerable.
Restrict to finite model finding (FMF).
I
Finite model finding is recursively enumerable.
I
But usual first-order reasoning methods such
resolution/superposition are incomplete for finite model finding
Methods for finite model finding are based on encodings into:
I
Propositional logic (FINDER, MACE, Paradox)
[Slaney; McCune; Claessen, Sörensson]
Paradox has been winning satisfiability at CASC for the last 10 years.
I
Geometric logic (Geo) [de Nivelle, Meng]
I
Effectively propositional logic (EPR) (DarwinFM, iProver)
[Baumgartner, de Nivelle, Fuchs, Tinelli]
3 / 18
Methods for finite model finding
General first-order satisfiability is not recursively enumerable.
Restrict to finite model finding (FMF).
I
Finite model finding is recursively enumerable.
I
But usual first-order reasoning methods such
resolution/superposition are incomplete for finite model finding
Methods for finite model finding are based on encodings into:
I
Propositional logic (FINDER, MACE, Paradox)
[Slaney; McCune; Claessen, Sörensson]
Paradox has been winning satisfiability at CASC for the last 10 years.
I
Geometric logic (Geo) [de Nivelle, Meng]
I
Effectively propositional logic (EPR) (DarwinFM, iProver)
[Baumgartner, de Nivelle, Fuchs, Tinelli]
3 / 18
Effectively Propositional Logic (EPR)
EPR: No functions except constants: P(x, y ) ∨ ¬Q(c, y )
Transitivity: ¬P(x, y ) ∨ ¬P(y , z) ∨ P(x, z)
Symmetry: P(x, y ) ∨ ¬P(y , x)
Verification:
∀A(wrenh1 ∧ A = wraddrFunc →
∀B(range[35,0] (B) → (imem0 (A, B) ↔ iwrite(B)))).
Applications many problems can be encoded into the EPR:
I
Hardware Verification (Intel)
I
Planning/Scheduling
I
Finite model finding
Instantiation-based methods excel in the EPR fragment.
4 / 18
Effectively Propositional Logic (EPR)
EPR: No functions except constants: P(x, y ) ∨ ¬Q(c, y )
Transitivity: ¬P(x, y ) ∨ ¬P(y , z) ∨ P(x, z)
Symmetry: P(x, y ) ∨ ¬P(y , x)
Verification:
∀A(wrenh1 ∧ A = wraddrFunc →
∀B(range[35,0] (B) → (imem0 (A, B) ↔ iwrite(B)))).
Applications many problems can be encoded into the EPR:
I
Hardware Verification (Intel)
I
Planning/Scheduling
I
Finite model finding
Instantiation-based methods excel in the EPR fragment.
4 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x)))
⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
Step1. Flattening: replacing complex terms by flat terms:
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x)))
⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
Step1. Flattening: replacing complex terms by flat terms:
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x)))
⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
Step1. Flattening: replacing complex terms by flat terms:
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x))) ⇒ g (x) 6' y1 ∨ Q(f (y1 ))
⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
Step1. Flattening: replacing complex terms by flat terms:
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x))) ⇒ g (x) 6' y1 ∨ Q(f (y1 )) ⇒
f (y1 ) 6' y2 ∨ g (x) 6' y1 ∨ Q(y2 ) ⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
Step1. Flattening: replacing complex terms by flat terms:
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x))) ⇒ g (x) 6' y1 ∨ Q(f (y1 )) ⇒
f (y1 ) 6' y2 ∨ g (x) 6' y1 ∨ Q(y2 ) ⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
Step1. Flattening: replacing complex terms by flat terms:
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x))) ⇒ g (x) 6' y1 ∨ Q(f (y1 )) ⇒
f (y1 ) 6' y2 ∨ g (x) 6' y1 ∨ Q(y2 ) ⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
Step1. Flattening: replacing complex terms by flat terms:
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x))) ⇒ g (x) 6' y1 ∨ Q(f (y1 )) ⇒
f (y1 ) 6' y2 ∨ g (x) 6' y1 ∨ Q(y2 ) ⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
Step1. Flattening: replacing complex terms by flat terms:
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x))) ⇒ g (x) 6' y1 ∨ Q(f (y1 )) ⇒
f (y1 ) 6' y2 ∨ g (x) 6' y1 ∨ Q(y2 ) ⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
Step1. Flattening: replacing complex terms by flat terms:
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x))) ⇒ g (x) 6' y1 ∨ Q(f (y1 )) ⇒
f (y1 ) 6' y2 ∨ g (x) 6' y1 ∨ Q(y2 ) ⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
EPR-based finite model finding [Baumgartner, de Nivelle, Fuchs, Tinelli]
Basic idea: Eliminate functions
Step1. Flattening: replacing complex terms by flat terms:
I
C [t] ⇒ t 6' x ∨ C [x]
I
Q(f (g (x))) ⇒ g (x) 6' y1 ∨ Q(f (y1 )) ⇒
f (y1 ) 6' y2 ∨ g (x) 6' y1 ∨ Q(y2 ) ⇒ ¬Pf (y1 , y2 ) ∨ ¬Pg (x, y1 ) ∨ Q(y2 )
Step2. Replace functions by predicates:
I
f (x1 , . . . , xn ) ' y can be represented by Pf (x1 , . . . , xn , y ) provided:
I
Pf is right-unique:
∀x̄, y [(Pf (x̄, y ) ∧ Pf (x̄, y 0 )) → y ' y 0 ]
function-free EPR (possible to drop)
I
Pf right-total:
∀x̄∃y Pf (x̄, y )
for finite domains can be expressed using domain axiom:
∀x̄[Pf (x̄, 1) ∨ . . . ∨ Pf (x̄, n)]
5 / 18
Is flattening always good ?
Flattening
I
essential for getting minimal wrt. size models
I
but flattening can be bad for performance of reasoning systems
Example: trivial propositional problem
P1 (c1 )
¬P1 (c2 )
¬P1 (c3 )
...
¬P1 (cn )
¬P2 (c1 )
P2 (c2 )
¬P2 (c3 )
...
¬P2 (cn )
¬Pn (c1 )
¬P2 (c2 )
¬P2 (c3 )
...
Pn (cn )
...
Flattening:
¬Pc1 (x) ∨ P1 (x)
...
¬Pcn (x) ∨ ¬Pn (x)
...
Domain k:
¬Pc1 (x) ∨ ¬Pn (x)
...
¬Pcn (x) ∨ Pn (x)
Pc1 (1) ∨ . . . ∨ Pc1 (k)
...
Pcn (1) ∨ . . . ∨ Pcn (k)
Non-trivial after flattening. Next: how to avoid unnecessary flattening
6 / 18
Is flattening always good ?
Flattening
I
essential for getting minimal wrt. size models
I
but flattening can be bad for performance of reasoning systems
Example: trivial propositional problem
P1 (c1 )
¬P1 (c2 )
¬P1 (c3 )
...
¬P1 (cn )
¬P2 (c1 )
P2 (c2 )
¬P2 (c3 )
...
¬P2 (cn )
¬Pn (c1 )
¬P2 (c2 )
¬P2 (c3 )
...
Pn (cn )
...
Flattening:
¬Pc1 (x) ∨ P1 (x)
...
¬Pcn (x) ∨ ¬Pn (x)
...
Domain k:
¬Pc1 (x) ∨ ¬Pn (x)
...
¬Pcn (x) ∨ Pn (x)
Pc1 (1) ∨ . . . ∨ Pc1 (k)
...
Pcn (1) ∨ . . . ∨ Pcn (k)
Non-trivial after flattening. Next: how to avoid unnecessary flattening
6 / 18
Is flattening always good ?
Flattening
I
essential for getting minimal wrt. size models
I
but flattening can be bad for performance of reasoning systems
Example: trivial propositional problem
P1 (c1 )
¬P1 (c2 )
¬P1 (c3 )
...
¬P1 (cn )
¬P2 (c1 )
P2 (c2 )
¬P2 (c3 )
...
¬P2 (cn )
¬Pn (c1 )
¬P2 (c2 )
¬P2 (c3 )
...
Pn (cn )
...
Flattening:
¬Pc1 (x) ∨ P1 (x)
...
¬Pcn (x) ∨ ¬Pn (x)
...
Domain k:
¬Pc1 (x) ∨ ¬Pn (x)
...
¬Pcn (x) ∨ Pn (x)
Pc1 (1) ∨ . . . ∨ Pc1 (k)
...
Pcn (1) ∨ . . . ∨ Pcn (k)
Non-trivial after flattening. Next: how to avoid unnecessary flattening
6 / 18
Extension EPR into many-sorted logic
Observe: if a problem is EPR we do not need to apply flattening.
Can we do more?
EPR is decidable because:
I
the set of all ground terms (the Herbrand universe) is finite
In unsorted first-order logic Herbrand universe is finite if and only if
all function symbols are constants.
Observation: [Abadi, Rabinovich, Sagiv] In the presence of sorts the
Herbrand universe can be finite even in the presence of non-constant
function symbols, under certain conditions.
7 / 18
Extension EPR into many-sorted logic
Observe: if a problem is EPR we do not need to apply flattening.
Can we do more?
EPR is decidable because:
I
the set of all ground terms (the Herbrand universe) is finite
In unsorted first-order logic Herbrand universe is finite if and only if
all function symbols are constants.
Observation: [Abadi, Rabinovich, Sagiv] In the presence of sorts the
Herbrand universe can be finite even in the presence of non-constant
function symbols, under certain conditions.
7 / 18
Non-cyclic sorts
s1
a
1
b
2
c
3
d
4
u
v
s2
s
s3
Restriction: no cyclic dependencies
8 / 18
Non-cyclic fragment
Consider: a signature Σ = hS, F, Pi
I
A sort dependency graph SD(Σ) = hS, →i
where si → s iff there is f ∈ F such that
f : s1 × . . . × si × . . . × sn 7→ s
I
A signature is non-cyclic if there are no cycles in its
sort dependency graph.
I
The non-cyclic clausal fragment consists of sets of clauses over a
non-cyclic signature.
Proposition. In many-sorted logic the Herbrand universe is finite
if and only if the signature is non-cyclic.
Theorem. Non-cyclic fragment is decidable by instantiation
based-methods.
Theorem. There is a linear-time algorithm for checking whether
a clause set is in the non-cyclic fragment.
9 / 18
Non-cyclic fragment
Consider: a signature Σ = hS, F, Pi
I
A sort dependency graph SD(Σ) = hS, →i
where si → s iff there is f ∈ F such that
f : s1 × . . . × si × . . . × sn 7→ s
I
A signature is non-cyclic if there are no cycles in its
sort dependency graph.
I
The non-cyclic clausal fragment consists of sets of clauses over a
non-cyclic signature.
Proposition. In many-sorted logic the Herbrand universe is finite
if and only if the signature is non-cyclic.
Theorem. Non-cyclic fragment is decidable by instantiation
based-methods.
Theorem. There is a linear-time algorithm for checking whether
a clause set is in the non-cyclic fragment.
9 / 18
Non-cyclic fragment
Consider: a signature Σ = hS, F, Pi
I
A sort dependency graph SD(Σ) = hS, →i
where si → s iff there is f ∈ F such that
f : s1 × . . . × si × . . . × sn 7→ s
I
A signature is non-cyclic if there are no cycles in its
sort dependency graph.
I
The non-cyclic clausal fragment consists of sets of clauses over a
non-cyclic signature.
Proposition. In many-sorted logic the Herbrand universe is finite
if and only if the signature is non-cyclic.
Theorem. Non-cyclic fragment is decidable by instantiation
based-methods.
Theorem. There is a linear-time algorithm for checking whether
a clause set is in the non-cyclic fragment.
9 / 18
Non-cyclic fragment
Consider: a signature Σ = hS, F, Pi
I
A sort dependency graph SD(Σ) = hS, →i
where si → s iff there is f ∈ F such that
f : s1 × . . . × si × . . . × sn 7→ s
I
A signature is non-cyclic if there are no cycles in its
sort dependency graph.
I
The non-cyclic clausal fragment consists of sets of clauses over a
non-cyclic signature.
Proposition. In many-sorted logic the Herbrand universe is finite
if and only if the signature is non-cyclic.
Theorem. Non-cyclic fragment is decidable by instantiation
based-methods.
Theorem. There is a linear-time algorithm for checking whether
a clause set is in the non-cyclic fragment.
9 / 18
Back to finite model finding
Observe: We do not need to apply flattening if the problem is in the
non-cyclic fragment.
Unfortunately:
I
Many problems are almost in the non-cyclic fragment.
Main idea: decompose the sort dependency graph into
I
cyclic and non-cyclic sorts.
10 / 18
Back to finite model finding
Observe: We do not need to apply flattening if the problem is in the
non-cyclic fragment.
Unfortunately:
I
Many problems are almost in the non-cyclic fragment.
Main idea: decompose the sort dependency graph into
I
cyclic and non-cyclic sorts.
10 / 18
Back to finite model finding
Observe: We do not need to apply flattening if the problem is in the
non-cyclic fragment.
Unfortunately:
I
Many problems are almost in the non-cyclic fragment.
Main idea: decompose the sort dependency graph into
I
cyclic and non-cyclic sorts.
10 / 18
Sort decomposition
Non-cyclic decomposition: Decompose all sorts into cyclic and non-cyclic.
Sort dependency graph
Non-cyclic decomposition
s0
s2
s1
s0
s2
s1
Theorem There is a linear-time algorithm for non-cyclic decomposition.
The proof is based on Tarjan’s algorithm for decomposing directed
graphs into strongly connected components.
11 / 18
Sort decomposition
Non-cyclic decomposition: Decompose all sorts into cyclic and non-cyclic.
Sort dependency graph
Non-cyclic decomposition
s0
s2
s1
s0
s2
s1
Theorem There is a linear-time algorithm for non-cyclic decomposition.
The proof is based on Tarjan’s algorithm for decomposing directed
graphs into strongly connected components.
11 / 18
Sort decomposition
Non-cyclic decomposition: Decompose all sorts into cyclic and non-cyclic.
Sort dependency graph
Non-cyclic decomposition
s0
s2
s1
s0
s2
s1
Theorem There is a linear-time algorithm for non-cyclic decomposition.
The proof is based on Tarjan’s algorithm for decomposing directed
graphs into strongly connected components.
11 / 18
Sort-restricted finite model finding
Consider:
I
A set of clauses S over a signature Σ and
I
the non-cyclic decomposition of Σ.
Sort-restricted finite model finding:
I
restrict flattening to terms of cyclic sorts,
I
apply instantiation-based methods to the obtained non-cyclic clauses
Theorem. Sort-restricted finite-model finding is complete for
finite satisfiability.
12 / 18
Sort-restricted finite model finding
Consider:
I
A set of clauses S over a signature Σ and
I
the non-cyclic decomposition of Σ.
Sort-restricted finite model finding:
I
restrict flattening to terms of cyclic sorts,
I
apply instantiation-based methods to the obtained non-cyclic clauses
Theorem. Sort-restricted finite-model finding is complete for
finite satisfiability.
12 / 18
Sort-restricted finite model finding
Note: Cyclic and non-cyclic sorts can be interleaved inside a term.
Consider: a signature with function symbols f , g , h, c with one
cyclic sort: valSort(g ) = argSort(1, g ) = argSort(h, 1) = s
f (x, h(g (z, h(x)))) ' f (x, c) ∨ h(x) ' c
13 / 18
Sort-restricted finite model finding
Note: Cyclic and non-cyclic sorts can be interleaved inside a term.
Consider: a signature with function symbols f , g , h, c with one
cyclic sort: valSort(g ) = argSort(1, g ) = argSort(h, 1) = s
f (x, h(g (z, h(x)))) ' f (x, c) ∨ h(x) ' c
⇒
SR Flattening : g (z, h(x)) 6' y ∨ f (x, h(y )) ' f (x, c1 ) ∨ h(x) ' c1
13 / 18
Sort-restricted finite model finding
Note: Cyclic and non-cyclic sorts can be interleaved inside a term.
Consider: a signature with function symbols f , g , h, c with one
cyclic sort: valSort(g ) = argSort(1, g ) = argSort(h, 1) = s
f (x, h(g (z, h(x)))) ' f (x, c) ∨ h(x) ' c
SR Flattening : g (z, h(x)) 6' y ∨ f (x, h(y )) ' f (x, c1 ) ∨ h(x) ' c1
⇒
⇒
¬Pg (z, h(x), y ) ∨ f (x, h(y )) ' f (x, c1 ) ∨ h(x) ' c1
13 / 18
Sort-restricted finite model finding
Note: Cyclic and non-cyclic sorts can be interleaved inside a term.
Consider: a signature with function symbols f , g , h, c with one
cyclic sort: valSort(g ) = argSort(1, g ) = argSort(h, 1) = s
f (x, h(g (z, h(x)))) ' f (x, c) ∨ h(x) ' c
SR Flattening : g (z, h(x)) 6' y ∨ f (x, h(y )) ' f (x, c1 ) ∨ h(x) ' c1
⇒
⇒
¬Pg (z, h(x), y ) ∨ f (x, h(y )) ' f (x, c1 ) ∨ h(x) ' c1
Domain :
Pg (x, y , 1) ∨ . . . ∨ Pg (x, y , n)
13 / 18
Sort-restricted vs EPR transformation
Initial: f (x, h(g (z, h(x)))) ' f (x, c) ∨ h(x) ' c
Sort restricted transformation:
¬Pg (z, h(x), y ) ∨ f (x, h(y )) ' f (x, c1 ) ∨ h(x) ' c1
Pg (x, y , 1) ∨ . . . ∨ Pg (x, y , n)
EPR-transformation:
¬Ph (x, y0 ) ∨ ¬Pg (z, y0 , y1 ) ∨ ¬Ph (y1 , y2 ) ∨ ¬Pc1 (y3 )∨
¬Pf (x, y2 , y4 ) ∨ ¬Pf (x, y3 , y5 ) ∨ ¬Ph (x, y6 )
∨
y4 ' y5 ∨ y6 ' y3
Pg (x0 , 1) ∨ . . . ∨ Pg (x0 , n)
Ph (x0 , 1) ∨ . . . ∨ Ph (x0 , n)
Pc1 (1) ∨ . . . ∨ Pc1 (n)
Pf (x0 , x1 , 1) ∨ . . . ∨ Pf (x0 , x1 , n).
14 / 18
Sort-restricted vs EPR transformation
Initial: f (x, h(g (z, h(x)))) ' f (x, c) ∨ h(x) ' c
Sort restricted transformation:
¬Pg (z, h(x), y ) ∨ f (x, h(y )) ' f (x, c1 ) ∨ h(x) ' c1
Pg (x, y , 1) ∨ . . . ∨ Pg (x, y , n)
EPR-transformation:
¬Ph (x, y0 ) ∨ ¬Pg (z, y0 , y1 ) ∨ ¬Ph (y1 , y2 ) ∨ ¬Pc1 (y3 )∨
¬Pf (x, y2 , y4 ) ∨ ¬Pf (x, y3 , y5 ) ∨ ¬Ph (x, y6 )
∨
y4 ' y5 ∨ y6 ' y3
Pg (x0 , 1) ∨ . . . ∨ Pg (x0 , n)
Ph (x0 , 1) ∨ . . . ∨ Ph (x0 , n)
Pc1 (1) ∨ . . . ∨ Pc1 (n)
Pf (x0 , x1 , 1) ∨ . . . ∨ Pf (x0 , x1 , n).
14 / 18
TPTP benchmarks
TPTP benchmarks: 15, 550 first-order problems.
Unfortunately: all these problems are unsorted.
Solution:
I
infer sorts automatically (linear-time)
[Claessen, Sörensson; Claessen, Lillieström, Smallbone]
I
4, 090 problems have more than one inferred sort.
Non-cyclic/EPR sorts in TPTP
I
1, 383 pure EPR problems
I
2, 578 problems have at least one non-cyclic sort
I
56, 679 collective number of sorts
I
9, 569 EPR sorts
I
18, 502 non-cyclic sorts
I
most problems combine non-cyclic/cyclic/EPR sorts
Summary: Non-cyclic sorts are in more than half of sortified problems.
15 / 18
TPTP benchmarks
TPTP benchmarks: 15, 550 first-order problems.
Unfortunately: all these problems are unsorted.
Solution:
I
infer sorts automatically (linear-time)
[Claessen, Sörensson; Claessen, Lillieström, Smallbone]
I
4, 090 problems have more than one inferred sort.
Non-cyclic/EPR sorts in TPTP
I
1, 383 pure EPR problems
I
2, 578 problems have at least one non-cyclic sort
I
56, 679 collective number of sorts
I
9, 569 EPR sorts
I
18, 502 non-cyclic sorts
I
most problems combine non-cyclic/cyclic/EPR sorts
Summary: Non-cyclic sorts are in more than half of sortified problems.
15 / 18
TPTP benchmarks
TPTP benchmarks: 15, 550 first-order problems.
Unfortunately: all these problems are unsorted.
Solution:
I
infer sorts automatically (linear-time)
[Claessen, Sörensson; Claessen, Lillieström, Smallbone]
I
4, 090 problems have more than one inferred sort.
Non-cyclic/EPR sorts in TPTP
I
1, 383 pure EPR problems
I
2, 578 problems have at least one non-cyclic sort
I
56, 679 collective number of sorts
I
9, 569 EPR sorts
I
18, 502 non-cyclic sorts
I
most problems combine non-cyclic/cyclic/EPR sorts
Summary: Non-cyclic sorts are in more than half of sortified problems.
15 / 18
TPTP benchmarks
TPTP benchmarks: 15, 550 first-order problems.
Unfortunately: all these problems are unsorted.
Solution:
I
infer sorts automatically (linear-time)
[Claessen, Sörensson; Claessen, Lillieström, Smallbone]
I
4, 090 problems have more than one inferred sort.
Non-cyclic/EPR sorts in TPTP
I
1, 383 pure EPR problems
I
2, 578 problems have at least one non-cyclic sort
I
56, 679 collective number of sorts
I
9, 569 EPR sorts
I
18, 502 non-cyclic sorts
I
most problems combine non-cyclic/cyclic/EPR sorts
Summary: Non-cyclic sorts are in more than half of sortified problems.
15 / 18
CASC 2013 – The World Championship for Automated Theorem Proving
16 / 18
CASC 2013
iProver – an instantiation-based reasoner for first-order logic
I
based on the Inst-Gen calculus
I
modular combination of first-order reasoning with MiniSAT
I
redundancy elimination, indexing, ...
I
implemented in OCaml
I
sort-restricted finite model finding, symmetry reduction
First-order satisfiability (FNT) 150 problems
iProver
Paradox
CVC4
E
Nitrox
Vampire
prob
122
99
96
79
79
78
time
52
2
25
20
29
30
I
For the first time in 10 years the reign of Paradox has been
successfully challenged...
I
Paradox is still.... a paradox – very efficient finite model finder.
17 / 18
CASC 2013
iProver – an instantiation-based reasoner for first-order logic
I
based on the Inst-Gen calculus
I
modular combination of first-order reasoning with MiniSAT
I
redundancy elimination, indexing, ...
I
implemented in OCaml
I
sort-restricted finite model finding, symmetry reduction
First-order satisfiability (FNT) 150 problems
iProver
Paradox
CVC4
E
Nitrox
Vampire
prob
122
99
96
79
79
78
time
52
2
25
20
29
30
I
For the first time in 10 years the reign of Paradox has been
successfully challenged...
I
Paradox is still.... a paradox – very efficient finite model finder.
17 / 18
CASC 2013
iProver – an instantiation-based reasoner for first-order logic
I
based on the Inst-Gen calculus
I
modular combination of first-order reasoning with MiniSAT
I
redundancy elimination, indexing, ...
I
implemented in OCaml
I
sort-restricted finite model finding, symmetry reduction
First-order satisfiability (FNT) 150 problems
iProver
Paradox
CVC4
E
Nitrox
Vampire
prob
122
99
96
79
79
78
time
52
2
25
20
29
30
I
For the first time in 10 years the reign of Paradox has been
successfully challenged...
I
Paradox is still.... a paradox – very efficient finite model finder.
17 / 18
Summary
Summary
I
The non-cyclic fragment is decidable by instantiation-based methods.
I
Non-cyclic sort decomposition in linear-time.
I
Sort-restricted flattening and finite model finding.
I
More than half of sortified problems in TPTP
contain non-cyclic sorts.
I
Instantiation + sort-restricted finite model finding is a winning
combination.
Future
I
There is flexibility which sorts to flatten, what is the best way?
I
Can we gain from non-cyclic sorts in theorem proving ?
I
Combination on non-cyclic fragment with other fragments/theories.
I
Integration into iProver-Eq.
18 / 18
Summary
Summary
I
The non-cyclic fragment is decidable by instantiation-based methods.
I
Non-cyclic sort decomposition in linear-time.
I
Sort-restricted flattening and finite model finding.
I
More than half of sortified problems in TPTP
contain non-cyclic sorts.
I
Instantiation + sort-restricted finite model finding is a winning
combination.
Future
I
There is flexibility which sorts to flatten, what is the best way?
I
Can we gain from non-cyclic sorts in theorem proving ?
I
Combination on non-cyclic fragment with other fragments/theories.
I
Integration into iProver-Eq.
18 / 18