Declarative Solver Development:
                
        
            
                    
                    
                    
                    
                    
                    
                    
Case Studies
            
    
        
                
                
                
                
                
                
                
            
            
                
                    Bart Bogaerts, Tomi Janhunen, Shahab Tasharrofi
                
        
            
                    
                    
                    
                    
                    
                    
                    
(Aalto University)
            
    
        
                
                
                
                
                
                
                
            
Get the slides: slides.com/krr/2016/live
Knowledge Representation (and Reasoning): Status
- Many interesting KR formalisms
 - Often without solvers
 - Users cannot readily benefit from the formalism
 
Abstract Argumentation
- 1995: +/- 4 semantics (Dung)
 - Later: many more semantics
 - Now: solver development
 
KR 2016
Many new formalisms without solver
Why is no-one building solvers?
Take-home message
- 
                
Building a solver should not be hard (anno 2016)
 - 
                
A high-level description of semantics should suffice
 
If you can describe your semantics in second-order logic,
you get a solver for free
Second-order logic
- Well-known
 - Clear informal semantics
 - Not an end target
 
What's next
- 
                Applications
                
- Abstract argumentation
 - Logic programming
 - Propositional logics
 
 - Efficiency
 - Under the hood
 - Conclusion & future work
 
1. Applications
Abstract argumentation
Abstract argumentation
- Argumentation framework: graph (A,R)
 - R represents an attack relation between arguments
 
Abstract argumentation
- We implemented 
                four semantics:
	
                
- grounded semantics
 - stable semantics
 - complete semantics
 - preferred semantics
 
 - For each semantics, we implemented 
                four inference methods:
	
                
- Finding some extension
 - Enumerating extensions
 - Credulous inference
 - Skeptical inference
 
 
Abstract argumentation
An interpretation S is conflict-free if S attacks no argument in S
Abstract argumentation
An interpretation S is conflict-free if S attacks no argument in S
Abstract argumentation
- A node x is attacked by S if S contains at least one of x's attackers
 - A node x is defended by S if S attacks all x's attackers
 
With S={b,d}:
Abstract argumentation
- A node x is attacked by S if S contains at least one of x's attackers
 - A node x is defended by S if S attacks all x's attackers
 
Abstract argumentation
Stable semantics: An interpretation S is a stable extension if S consists exactly of all arguments not attacked by S
Abstract argumentation
Stable semantics An interpretation S is a stable extension if S consists exactly of all arguments not attacked by S
Abstract argumentation
Similar theories for:
- Grounded extensions
 - Preferred extensions
 - Complete extensions
 
Abstract argumentation
Different reasoning modes:
- Finding an extension
 - Finding all extensions
 - Credulous inference: Does x hold in some extension
 - Skeptical inference: Does x hold in all extensions
 
Abstract argumentation
Different reasoning modes:
- Credulous inference: Does x hold in some extension
 - Skeptical inference: Does x hold in all extensions
 
Abstract argumentation
Implementation: We only give the solver an ASCII representation of the second-order theory
? s: 
    (?N: in_test(N) & s(N)) & 
     ! N: in_node(N) => (~s(N) <=> ( ? M: in_attack(M,N) & s(M) ) ).
    Logic Programming
Logic Programming
Second-order theories for
- Stable semantics of disjunctive logic programs
 - Grounded fixpoint semantics of normal logic programs
 
Logic Programming
Disjunctive logic program: set of rules of the form
An interpretation I (a set of atoms) is a stable model if it is a (subset)minimal model of the reduct
Logic Programming
An interpretation I (a set of atoms) is a stable model if it is a (subset)minimal model of the reduct
Logic Programming
- In the paper, generalised for parametrised programs
 - From the second-order theories, we obtain a solver for
 - Stable semantics
 - Grounded fixpoint semantics
 
Propositional logics
Propositional logics
Second-order theories for:
- 
                    Monotone logics
	
                
                
                    
                    
                    
- Classical propositional logic
 - The logic of here and there
 
 - 
                    Non-monotone logics
	
                
                
                    
                    
                    
- Equilibrium logic
 - Supported models
 - Parallel Circumscription
 
 
Obtained a solver for each of these semantics
2. Efficiency
Efficiency
- All good and well but... how does it scale?
 - Is it good enough for prototyping?
 - 
                    Experiments: only for argumentation
            
                
                    
                    
- Reran last year's competition
                            
                            
- 8 * 192 + 8 * 576 instances
 - 600 second time limit
 - Intel Xeon E5-4652
 
 - Compared with CoQuiAAS (last year's winner)
 
 - Reran last year's competition
                            
                            
 
| S2S-CoQuiAAS | Some Ext | All Ext | Cred | Skep | 
|---|---|---|---|---|
| Complete | 192 - 192 | 191 - 191 | 576 - 575 | 576 - 576 | 
| Preferred | 192 - 191 | 190 - 189 | 576 - 576 | 576 - 576 | 
| Grounded | 192 - 192 | 192 - 192 | 576 - 576 | 576 - 576 | 
| Stable | 192 - 192 | 192 - 191 | 576 - 576 | 576 - 576 | 
3. Under the Hood
Under the Hood
- SAT-to-SAT: QBF-like solver based on nested SAT solvers + lazy clause generation
 - We extended it with a grounder for second-order logic
 
SAT-to-SAT
Grounding to SAT-to-SAT
4. Conclusion & Future Work
Declarative solver development is feasable
- 
                
Wide variety of logics
 - 
                
Reasonably efficient
 
Language should be extended
- Second-order logic: not always sufficient
 - Types
 - Arithmetic
 - Aggregates
 - Recursive definitions
 - ...
 
Giving the user more control
- Control in the grounding process
 - Control in the 
                solver
                
- Heuristics
 - Clause learning/explanation mechanism
 - ...
 
 
| 
                         | 
                    
                         | 
                    
                         | 
                
|---|---|---|
| paper | webpage | slides | 
Declarative Solver Development: Case Studies
By krr
Declarative Solver Development: Case Studies
Presentation for the KR'16 paper
- 2,316