90 likes | 480 Vues
. . Agenda. What is prologSay that rule consists of head and body and that may contain variablesSimple ProgramConstants and variablesAnonymous variables; and .Why querying?Queries with ;Prolog and quantified statementsUniversal quantifierExistential quantifiers. Does the sequence of instr
E N D
1. Introduction to Prolog Dragoljub Pokrajac
2003
2.
3. Agenda What is prolog
Say that rule consists of head and body and that may contain variables
Simple Program
Constants and variables
Anonymous variables
; and .
Why querying?
Queries with ;
Prolog and quantified statements
Universal quantifier
Existential quantifiers Does the sequence of instructions matter?
Recursions, Barbers paradox
Discuss execution tree and its depth-first search
4. What is Prolog? Prolog is non-procedural programming language
We specify what to be done and not how
Invented in 1970s
We will use Prolog to specify rules for rule-based systems
5. Prolog References Prolog textbook
I. Bratko, Prolog Programming for Artificial Intelligence, 3rd Edition, 2000
Prolog compiler
http://www.swi-prolog.org
Prolog tutorial
http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/pt_framer.html
First-Order logic site (rather involved)
http://www.cs.wisc.edu/~dyer/cs540/notes/fopc.html
6. What Prolog Program Consists Of? It consists of rules
Each rule specify first-order quantified logical statement
Rules can also be viewed as relations
7. Simple Prolog Program
8. Example-Family Matters
9. Example: Bush Family Show that _ means independent quantifiers