1 / 21

Tableaux Implemented

Tableaux Implemented. A Tableaux Prover Representation of tableaux Translate tableaux rules to Prolog Bring together this week‘s results in a combined demo system to see whether our efforts have been worthwhile. Representing Signed Formulae in Prolog. true(walk(john) v talk(john))

ismolen
Download Presentation

Tableaux Implemented

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tableaux Implemented • A Tableaux Prover • Representation of tableaux • Translate tableaux rules to Prolog • Bring together this week‘s results in a combined demo system to see whether our efforts have been worthwhile

  2. Representing Signed Formulae in Prolog true(walk(john) v talk(john)) false(walk(john)v talk(john))

  3. Preprocessing • Use logical equivalences: • A  B  (A  B) • A  B  (A  B) • true(walk(john) v talk(john)) => true(~(~walk(john)&~talk(john))) • A simple prolog predicate does this for us (naonly/2).

  4. The Driver Predicate theorem(Formula) :- naonly(Formula,ConvFormula), \+ tabl(false(ConvFormula),[],_). There is no way of falsifying the converted input Formula. If tabl/3 succeeds: Formula not valid. If tabl/3 fails: Formula valid. How is the tableaux represented?

  5. We collect literals. One list per branch: [L1,L2,L3] [L1,L2,L4,L5] [L1,L2,L4,L6] …no more representation of the whole tableau. Representation of Tableaux L1 L2 L3 L4 L5 L6

  6. Tableaux Rules in Prolog Scheme: tabl(InFormula,InBranch,OutBranch) :- … For each connective and sign: tabl(false(~A),InBranch,OutBranch) :- … tabl(true(A&B),InBranch,OutBranch) :- … The tabl/3 rules are straightforward translations of the tableaux rules. But some details are tricky. Input 1: The formula to be analyzed Input 2: A list of literals (branch above) Output: Literals from above plus literals from analyses of InFormula

  7. Conjunctive Expansion: Negation tabl(true(~A),InBranch,OutBranch) :- !,tabl(false(A),InBranch,OutBranch). tabl(false(~A),InBranch,OutBranch) :- !,tabl(true(A),InBranch,OutBranch). Negation of input Formula is eliminated by a recursive tabl/3 call with reversed sign.

  8. Conjunctive Expansion: Conjunction tabl(true(A&B),InBranch,OutBranch) :- !,tabl(true(A),InBranch,K), tabl(true(B),K,OutBranch). true(sleep(john)&~snort(john)) A=sleep(john) InBranch = [true(sleep(mary))] B=~snort(john) K = [true(sleep(mary)),true(sleep(john))] OutBranch = [true(sleep(mary)),true(sleep(john)), false(snort(john))] Two recursive calls of tabl/3. One for each conjunct. Intermediate branch is „handed over“ in variable K.

  9. General Idea: Test branches one after another. Advantage: Two alternatives. If we come to the right branch, we can forget about the left one. Disjunctive Expansion I F2 F3 F4 … F5 … …

  10. Disjunctive Expansion II tabl(false(A & _),InBranch,OutBranch) :- tabl(false(A),InBranch, OutBranch). tabl(false(_ & B),InBranch,OutBranch) :- !,tabl(false(B),InBranch, OutBranch). • If we succeed on the left branch to „prove“ false(A) without a clash, we stop (a model for the negation of our suspected theorem has been found). • Else, we have to try the right branch. • Use Prolog‘s backtracking mechanism to test one branch and then the other. • Two clauses for tabl(false(A&B),…)

  11. Base Case: Atomic Formula tabl(AF,InBranch,OutBranch) :- OutBranch = [AF|InBranch], \+ clash(OutBranch). clash(Branch) :- member(true(A),Branch), member(false(A),Branch). • If we reach a literal on some branch and there is no clash, we stop: a counter model has been found. • Else, we fail. This triggers backtracking for further „waiting“ disjunctive expansions.

  12. Main Ideas of Our Implementation • No explicit representation of the whole tableaux: We always work on one branch at a time. • Branches are represented as lists of literals (nothing else matters). • Use a sequence of Prolog calls to do tableaux construction: • Conjunctive expansion: one clause per conjunctive/sign with recursive call(s). • Disjunctive expansion: two clauses with a recursive call, backtracking if fail in first clause (i.e. no model found on left branch).

  13. tabl(true(~A),InBranch,OutBranch) :- !,tabl(false(A),InBranch,OutBranch). tabl(false(~A),InBranch,OutBranch) :- !,tabl(true(A),InBranch,OutBranch). tabl(true(A & B),InBranch,OutBranch) :- !,tabl(true(A),InBranch,K), tabl(true(B),K,OutBranch). tabl(false(A & _),InBranch,OutBranch) :- tabl(false(A),InBranch,OutBranch). tabl(false(_ & B),InBranch, OutBranch) :- !,tabl(false(B),InBranch,OutBranch). tabl(AF,InBranch,OutBranch) :- OutBranch = [AF|InBranch], \+ clash(OutBranch).

  14. Online Tableaux Interface • See example: Interface.htm • Course Page • Link to tableaux interfaced • All Prolog code for download • The reader • This week‘s slides • Corrected page of reader • Do not hesitate to email us Try it out!

  15. The Proof of the Pudding is in the Eating Towards the end of this course… … we show a system that combines semantics construction with our tableaux prover. Given a model, we check whether a sentence is • Informative (is the information not already contained in the model) • Contradictory • Consistent

  16. Conversational Maxims • Speaker and hearer obey some rules • H.P. Grice: • Maxim of Quality: Tell the truth! • Maxim of Manner: Be relevant! • … • Maximes (and violation hereof) is used in conversations (studied by Pragmatics) A:„Did you tell her you love her?“ B:„Oh, nice weather today“

  17. Our System • Example model M: • John is a man. • John does not smoke. • Every man is human. • Every human works. • As large conjunctive Formula: man(john)&forall(x,human(x)>work(x))&forall(y,man(y)>human(y))&~smoke(john)

  18. check :- lambda(F), M = man(john)&forall(x,human(x)>work(x))&forall(y,man checkFormula(F,M). checkFormula(F,M) :- theorem(M>F), nl, write('I know, I know...'). checkFormula(F,M) :- theorem(~(M&F)), nl, write('Impossible!'). checkFormula(_,_) :- nl, write('If you say so...').

  19. Checking Consistency theorem(~(M&F)) Why does this ckeck whether F is inconsistent with M? • Mcontains no contradictions. • If  (M  F) is a theorem, then M  F is a contradiction. This must be due to F because of (1). System Demo

  20. Extending our System • Argumentation, Syllogisms • Model extension • Extend model with NL input • Question answering • Question semantics, extend DCG… • Check it out! • Other Systems using NLP and inference • Curt (Blackburn/Bos) • Doris (Bos)

  21. Thanks for your Interest... …enjoy Computational Semantics!

More Related