{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ai-prolog

# ai-prolog - Logic Programming Languages featuring Prolog...

This preview shows pages 1–10. Sign up to view the full content.

Logic Programming  Languages featuring Prolog, your new favorite  language

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Prolog PRO gramming in  LOG ic It is the most widely used logic  programming language Its development started in 1970 What’s it good for? Knowledge representation Natural language processing State-space searching (Rubik’s cube) Expert systems, deductive databases, Agents
3 Overview of Logic Programming Main idea:  Ask the computer to solve  problems using principles of logic: Program states the known facts To ask a question, you make a statement  and ask the computer to search for a proof  that the statement is true Additional mechanisms are provided to  guide the search to find a proof

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Declarative vs. Imperative Languages used for logic programming are called  declarative  languages because programs written in  them consist of declarations rather than assignment  and flow-of-control statements. These declarations  are statements, or  propositions , in symbolic logic.  Programming in imperative languages (e.g., Pascal,  C) and functional languages (e.g., Lisp) is  procedural which means that the programmer knows what is to  be accomplished by the program and instructs the  computer on exactly how the computation is to be  done.
5 Logic Programming Programming in logic programming  languages is non-procedural.  Programs in such languages do not state how  a result is to be computed. Instead, we supply  the computer with: relevant information (facts and rules) a method of inference for computing desired  results. Logic programming is based on the  predicate  calculus.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 Logic background Horn clauses General form: IF (A1 and A2 and A3 …) THEN H Head = H  Body = A1 and A2 and …. E.g. “If X is positive, and Y is negative,  then Y is less than X”
7 The Predicate Calculus: Proposition Proposition: A proposition is a logical statement, made  up of objects and their relationships to  each other, which may or may not be true. Examples: man ( john ) likes ( pizza baseball functor parameters

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
8 The Predicate Calculus: Logical Connectors A compound proposition consists of 2 or more  propositions connected by logical connectors,  which include  Negation: ¬ a (“not a”) Conjunction:    b (“a and b”) Disjunction:     b (“a or b”) Equivalence:  b (“a is equivalent to b”) Implication:  b (“a implies b”)          b (“b implies a”)
9 The Predicate Calculus: Quantifiers Variables may appear in formulas, but only  when introduced by

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}