SOGrounder:
Modelling and Solving Second-Order Logic
Matthias van der Hallen, Gerda Janssens
(KU Leuven)
Motivation
Provide expressive languages for modelling problems in logic.
Proposal
Model problems using Second-Order Logic
Solve it with Quantified Boolean Formulas
SOGrounder
A software tool to translate expressive second-order logic theories to quantified boolean formulas.
Second-Order Logic
- Variables: symbols representing
- elements of the domain \(\mathcal{D}\), or
- predicates / functions over this domain
- Terms: First-order variables and function applications
- Atoms: Predicate applications
- Formulas: \(\neg, \lor, \land, \Rightarrow, \Leftrightarrow, \exists, \forall \)
Second-Order Logic
as a modelling language
Introducing types
Second-Order Logic
as a modelling language
type Company = {Barilla; Dececco; Callippo; Star}
type Good = {Pasta; Tonno}
controlledBy :: (Company, Company, Company, Company, Company)
produces :: (Good, Company)
strategicset :: (Company)
non_strat_pair :: (Company, Company)
produces = {Barilla, Pasta; Dececco, Pasta; Callippo, Tonno; Star, Tonno}
controlledBy = {Star, Star, Star, Star, Barilla; Barilla, Barilla, Barilla, Barilla, Dececco}
non_strat_pair = {Barilla, Star}
∀ good :: Good : ∃ prod :: Company : strategicset(prod) & produces(prod, good).
∀ subset :: (Company) : [...]
[...]
Vocabulary:
Structure:
Theory:
Introducing types
Quantified Boolean Formulas
Formulas in quantified propositional logic:
- Prenex form
- Quantifiers can alternate indefinitely
- PCNF if matrix is in CNF
\(\forall a \exists b \exists c \forall d . \psi\)
0
1
2
Quantifier levels
Matrix
Quantifier block
Quantified Boolean Formulas
- Many solvers exist
- Input:
- QDIMACS: textual PCNF
- QCIR: Quantified Circuit representation, dispenses of tseitinization
- ...
- Techniques:
- Conflict driven clause and solution driven cube learning in QDPLL
- Counterexample-guided abstraction refinement (CEGAR)
Implementation
- Push negations
- Unnest terms
- Remove function app. through graphing
- Eliminate \(\Rightarrow, \Leftrightarrow\)
- Ground FO variables
- Introduce unique names through alpha conversion
- Pull quantifiers to front e.g.: \((\exists \alpha : \phi) \land \psi\rightsquigarrow \exists \alpha : (\phi \land \psi)\)
- Tseitinize
- Translate SO:
- Replace atoms \( p(\overline{x}) \) with propositions \( p_{\overline{x}} \)
- Replace quantifications \(\forall p\) with domain \(\mathcal{D}\) with \(\forall p_{d_1}, ..., \forall p_{d_n}\) where \(d_1, ... d_n \in \mathcal{D}\)
Optimizations
We introduce binary quantification
Binary quantification takes two formulas:
type node = {a;b;c;d}
graph :: (node,node)
graph = {a,b; b,c; a,c}
∀ (x,y) :: [graph(x,y)] : graph(y,x).
type node = {a;b;c;d}
graph :: (node,node)
graph = {a,b; b,c; a,c}
graph(b,a) ∧ graph(c,b) ∧ graph(c,a).
- A formula restricting the domain of the quantified variables
- The formula to be instantiated
Experimental Evaluation
The Strategic Companies problem:
- Well-known \(\Sigma_2^P\) problem with ASP encoding and Instantiation Scheme for QBF
- Used in QBF ('06, '10, ...) and ASP competitions ('13)
- Randomly generated instances, # of companies ~ competition
Experimental Evaluation
The Strategic Companies problem
Set of companies and products
-
'joint ownership' relation
-
'produces' relation
Experimental Evaluation
The Strategic Companies problem
Strategic set:
-
produces all products
-
closed under ownership
Minimal strategic sets:
No subset forms its own strategic set
For companies \(c_1, c_2\), is there a minimal strategic set containing \(c_1, c_2\)?\)
Experimental Evaluation
The Strategic Companies problem
Pasta | Tonno | |
---|---|---|
Barilla | x | |
Dececco | x | |
Star |
x |
|
Callippo |
X |
Barilla
Dececco
Star
owns
owns
Minimal strategic sets:
Star, Barilla, and Dececco
Dececco and Callippo
Results: Grounding
- Many grounding optimizations are still to be implemented
- Bottom up grounding
Results: Solving
- Better performance than QBF competition encoding
- Without tseitinization, outperforms clingo
Conclusions
- Easy modelling
- Promising performance
- Many grounding techniques left to investigate and port
SOGrounder: Modelling and Solving Second-Order Logic
By krr
SOGrounder: Modelling and Solving Second-Order Logic
- 1,159