gen2sat: a generic tool for reasoning with non … › ~yoniz › gen2sat.pdfgen2sat: a generic tool...
TRANSCRIPT
Gen2sat:A Generic Tool for Reasoning with Non-classical Logics
Yoni Zohar – Tel Aviv University
Joint work with Ori Lahav and Anna Zamansky
AIC @ SRIAugust 24, 2017
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Motivation
Propositional classical logic:A lot of researchUsed in applications
Propositional Non-classical logics:Many-valued and fuzzy logics: v(A) = 0.5Paraconsistent logics: A,¬A 6` BIntuitionistic logic: 6` A ∨ ¬AModal logics: �AA lot of researchFew are used in applications
A possible explanation:Lack of available tools for reasoning with non-classical logicsOne has to develop a reasoning tool from scratch for each logic
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tools for Non-classical Logics
Formula
SequentCalculus
Logic ADecision Procedure
Valid?
Formula
SequentCalculus
Logic BDecision Procedure
Valid?
Formula
SequentCalculus
Logic CDecision Procedure
Valid?
...Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Formula
LogicDecision Procedure Valid?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
Gen2sat Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
Gen2sat Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
Gen2sat Derivable?
Works for Propositional Pure Analytic Sequent Calculiwith “Next” Operators
IN:classical logic3-valued logics4-valued logicsparaconsistent logics...
OUT:intuitionistic logicrelevance logicsfuzzy logicsfirst-order logics...
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
Gen2sat Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
Reduction SATSolver Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
ReductionSemanticInterpretation
SATSolver Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
ReductionSemanticInterpretation Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
ReductionSemanticInterpretation Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
What Are Sequents?
Sequents have the form Γ⇒ ∆, where Γ, ∆ are finite sets of formulas.Intuition:
A1, . . . , An ⇒ B1, . . . , Bm ! A1 ∧ . . . ∧ An → B1 ∨ . . . ∨ Bm
Example
A, B ⇒ A ∧ BA⇒ A ∨ B⇒ A ∨ ¬A
A,¬A⇒⇒ A,¬AA⇒ A, B, C
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
ReductionSemanticInterpretation Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Sequent Calculi
Sequent CalculiProof systems that manipulate sequentsSequent Calculus = finite set of sequent derivation rules
Γ1 ⇒ ∆1, . . . , Γn ⇒ ∆nΓ0 ⇒ ∆0
Example (Thinking of a Sequent Rule)Γ⇒ A Γ⇒ B
Γ⇒ A ∧ BA⇒ ∆
A ∧ B ⇒ ∆B ⇒ ∆
A ∧ B ⇒ ∆
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Sequent Calculi
Sequent CalculiProof systems that manipulate sequentsSequent Calculus = finite set of sequent derivation rules
Γ1 ⇒ ∆1, . . . , Γn ⇒ ∆nΓ0 ⇒ ∆0
Example (Thinking of a Sequent Rule)Γ⇒ A, ∆ Γ⇒ B, ∆
Γ⇒ A ∧ B, ∆Γ, A⇒ ∆
Γ, A ∧ B ⇒ ∆Γ, B ⇒ ∆
Γ, A ∧ B ⇒ ∆
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Examples of Sequent Calculi
The Propositional Fragment of LK [Gentzen 1934]Structural Rules:
(id) Γ, A⇒ A, ∆ (cut)Γ⇒ A, ∆ Γ, A⇒ ∆
Γ⇒ ∆ (weak)Γ⇒ ∆
Γ, Γ′ ⇒ ∆, ∆′
Logical Rules:
(¬ ⇒)Γ⇒ A, ∆
Γ,¬A⇒ ∆ (⇒ ¬)Γ, A⇒ ∆
Γ⇒ ¬A, ∆
(∧ ⇒)Γ, A, B ⇒ ∆
Γ, A ∧ B ⇒ ∆ (⇒ ∧)Γ⇒ A, ∆ Γ⇒ B, ∆
Γ⇒ A ∧ B, ∆
(∨ ⇒)Γ, A⇒ ∆ Γ, B ⇒ ∆
Γ, A ∨ B ⇒ ∆ (⇒ ∨)Γ⇒ A, B, ∆
Γ⇒ A ∨ B, ∆
(⊃ ⇒)Γ⇒ A, ∆ Γ, B ⇒ ∆
Γ, A ⊃ B ⇒ ∆ (⇒⊃)Γ, A⇒ B, ∆
Γ⇒ A ⊃ B, ∆
Analyticity (“subformula property”)Only subformulas of the proved sequent are used
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Examples of Sequent Calculi
Lukasiewicz 3-valued Logic [Avron ’03]A sequent calculus for L3 is obtained by augmenting the positive fragmentof LK with some pure rules for negation. For example:
(¬ ⊃⇒)Γ, A,¬B ⇒ ∆
Γ,¬(A ⊃ B)⇒ ∆
(⇒ ¬ ⊃)Γ⇒ A, ∆ Γ⇒ ¬B, ∆
Γ⇒ ¬(A ⊃ B), ∆
¬-AnalyticityOnly subformulas of the proved sequent and their negations are used
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Examples of Sequent CalculiCalculus for Primal Infon Logic [Gurevich,Neeman ’09]
(∧ ⇒)Γ, A, B ⇒ ∆
Γ, A ∧ B ⇒ ∆ (⇒ ∧)Γ⇒ A, ∆ Γ⇒ B, ∆
Γ⇒ A ∧ B, ∆
(∨ ⇒)���
������
���XXXXXXXXXXXX
Γ, A⇒ ∆ Γ, B ⇒ ∆Γ, A ∨ B ⇒ ∆ (⇒ ∨)
Γ⇒ A, B, ∆Γ⇒ A ∨ B, ∆
(⊃ ⇒)Γ⇒ A, ∆ Γ, B ⇒ ∆
Γ, A ⊃ B ⇒ ∆ (⇒⊃)Γ,��HHA ⇒ B, ∆Γ⇒ A ⊃ B, ∆
Γ⇒ ∆q said Γ⇒ q said ∆ for every principal q
An extremely efficient propositional logic.One of the main logical engines behind MSR DKAL
AnalyticityOnly subformulas of the proved sequent are used
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Scope of Gen2sat
Pure Analytic sequent calculus with “Next” OperatorsPropositional and structuralInclude pure logical rules that allow any Γ and ∆:
X Γ, A⇒ B, ∆Γ⇒ A ⊃ B, ∆ X Γ, A⇒ B
Γ⇒ A ⊃ B
May include impure rules of the form: Γ⇒ ∆∗Γ⇒ ∗∆
Analytic (subformula property and its variants)
TheoremThere is a polynomial reduction from the derivability problem of any suchcalculus to (the complement of) SAT.
corollaryThe derivability problem for every such calculus is in co-NP.
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
ReductionSemanticInterpretation Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Semantics for Pure CalculivaluationsA valuation is a function v : WFF → {t, f}
WarningValuations are defined over all formulas, not only the atomic ones!
G-legal valuationsA valuation is G-legal if it respects the “semantic reading” of G .
Example (Classical Conjunction)⇒ A ⇒ B⇒ A ∧ B
A⇒A ∧ B ⇒
B ⇒A ∧ B ⇒
1 If v(A) = t and v(B) = t then v(A ∧ B) = t2 If v(A) = f then v(A ∧ B) = f3 If v(B) = f then v(A ∧ B) = f
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Semantics for Pure CalculivaluationsA valuation is a function v : WFF → {t, f}
WarningValuations are defined over all formulas, not only the atomic ones!
G-legal valuationsA valuation is G-legal if it respects the “semantic reading” of G .
Example (Sequent Calculus for C1)A⇒⇒ ¬A
A⇒¬¬A⇒
¬A⇒ ¬B ⇒¬(A ∧ B)⇒
1 If v(A) = f then v(¬A) = t2 If v(A) = f then v(¬¬A) = f3 If v(¬A) = f and v(¬B) = f then v(¬(A ∧ B)) = f
This semantics is non-deterministic.Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Semantics for Pure Calculi
Soundness and Completeness [Beziau ‘01]s is provable in G
⇐⇒s is satisfied by every G-legal valuation
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Semantics for Pure Calculi
Soundness and Completenesss is provable in G using F ⊆WFF
⇐⇒s is satisfied by every G-legal valuation with domain F
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Semantics for Pure Calculi
Soundness and Completenesss is provable in G using sub(s)
⇐⇒s is satisfied by every G-legal valuation with domain sub(s)
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Semantics for Pure Calculi
Soundness and Completenesss is provable in G
⇐⇒s is satisfied by every G-legal valuation with domain sub(s)
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
ReductionSemanticInterpretation Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Reduction to SAT
s
Greduction SAT solver
X
X
“I am a G-legalcountermodel of s”
UNSAT
SAT
TheoremCorrectness: s is provable in G iff the generated instance is UNSAT.Complexity:
Translating: O(nk); k depends on G (“usually” k = 1)Solving: Exp in the worse case. Linear for “Horn calculi”
In the presence of Next operators, we use Kripke modelsCorrectness is more challengingYoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Tool for Non-classical Logics
Sequent
SequentCalculus
ReductionSemanticInterpretation Derivable?
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Reduction
A1, . . . , An ⇒ B1, . . . , Bm
rule1
rule2
rule3
rule4
clause 1clause 2
clause 3clause 4clause 5
clause 6
clause 7clause 8
clause 9clause 10
SAT assignment
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Reduction
A1, . . . , An ⇒ B1, . . . , Bm
rule1
rule2
rule3
rule4
clause 1clause 2
clause 3clause 4clause 5
clause 6
clause 7clause 8
clause 9clause 10
SATSAT assignment
A1 = false, A2 = true, . . .
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Reduction
A1, . . . , An ⇒ B1, . . . , Bm
rule1
rule2
rule3
rule4
clause 1clause 2
clause 3clause 4clause 5
clause 6
clause 7clause 8
clause 9clause 10
UNSATUNSAT core
2, 4, 8
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Evaluation
Gen2sat vs. MetTeLinput: The calculus for Lukasiewicz 3-valued logicStructured Problems for Lukasiewicz infinite-valued logic [Rothenberg’07]Random Problems generated by MetTeL
100 200 300
5,000
10,000
N
time
inm
s
Structured Problems
10 15 20100
101
102
103
104
depth
time
inm
s
Random Problems
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
An Idea: Logic Education
Motivation:Gen2sat can be useful for teaching sequent calculiStudents can focus solely on the logical aspectsHeuristics and search are left for the SAT solver
Preliminary Pilot:13 logic students were given a bonus assignment:present a minimal test plan with maximal coverage for Gen2satThey all got 70%-85% coverageSome used 0-ary and 3-ary connectives.Some found (intentionally planted) bugsFeedback from students was encouraging
“it helped me see the variety of different connectives and rules”“for me thinking of the extreme cases was really illuminating”“I wish all of the course assignments were more of this type”...
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Conclusion
We have seen:A generic tool for deciding derivability in analytic pure (and someimpure) sequent calculiThe actual search is done by a SAT-solverBased on a semantic interpretation
Future work:ApplicationsSupport more logics and calculiAutomatically detect analyticity (when possible)Integrate with a theorem prover
Thank you!
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics
Conclusion
We have seen:A generic tool for deciding derivability in analytic pure (and someimpure) sequent calculiThe actual search is done by a SAT-solverBased on a semantic interpretation
Future work:ApplicationsSupport more logics and calculiAutomatically detect analyticity (when possible)Integrate with a theorem prover
Thank you!
Yoni Zohar Gen2sat: A Generic Tool for Reasoning with Non-classical Logics