1 / 4

First-Order Logic (Predicate Calculus)

First-Order Logic (Predicate Calculus). Some statements encode axioms from which other statements can be proven E.g., natural(0) and  x natural(x) → natural(successor(x)) Different constructs make up first-order-logic Constants like 0 or 1 (usually numbers or names)

abel
Download Presentation

First-Order Logic (Predicate Calculus)

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. First-Order Logic (Predicate Calculus) • Some statements encode axioms from which other statements can be proven • E.g., natural(0) and x natural(x)→ natural(successor(x)) • Different constructs make up first-order-logic • Constants like 0 or 1 (usually numbers or names) • Variables like x whose possible values are sets of constants • Predicates like natural that return true or false • Functions like successor that return a constant or variable • Connectives like and, or, not, , and  • Quantifiers like and  that also introduce bound variables • Punctuation symbols like parentheses, commas, periods • Inference rules can produce new (proven) statements • E.g., (a  b) and (b c) allows us to assert(a c)

  2. Execution Order • Resolution in Prolog uses a depth-first search strategy • Replaces goals left-to-right • Works through database top-to-bottom • Sub-goals are considered as soon as possible • Whenever failure occurs, Prolog backtracks to continue • Can exploit this behavior to cause iteration • E.g., to do repetitive searches, show all answers, etc. • Built-in predicate fail forces backtracking • Watch out for unbounded recursion • E.g., need to be sure search will progress to termination

  3. Some Problems with Logic Programming • Occur-check problem • A unification algorithm does not check whether a term that is being unified with a variable contains that variable itself • Can lead to non-progressing iteration (which does not halt) • Negation as failure (and vice versa) • Absence of proof is not proof of absence (but negation can make it appear that way), backtracking may release bindings • Expressive power of Horn clauses is limited • E.g., cannot express existential quantification as in  x p(x) • Problems involving control information • Order of clauses (and statements) affects evaluation order • In terms of pure logic this does not matter • For logic programming this impacts progress, termination

  4. Today’s Studio Exercises • We’ll continue looking at Horn clauses • Building on the parsing examples from last time • Translating from FOL format to a structured list format • In lab 3 we’ll use both unification and resolution (in C++) • Today’s exercises are again all in Scheme • Extracting variables and constants, forming lists (of lists) • Translating lists back into string representations in a file • When done, please email your answers to the studio exercises to the cse425@seas.wustl.edu course account, with subject “Logic Programming Studio II”

More Related