ITEC 380 Organization of programming languages Lecture 7 – Prolog
Prolog Review Questions about the exam Review / in-class coding w/ Lisp Binding
Prolog Objectives Introduce Prolog –History –Strengths –Basic principles –Example programs
Prolog History Created in 1972 by Alain Colmerauer Deals with facts, rules, not variables and operations Truth and logical deduction Simple –It is 2:00. Complex –10 layers of rules / facts to deal with Major part of Artificial intelligence
Prolog Environmen t SWI Prolog – Tutorials: Don’t forget book on website
Prolog Facts A true statement Syntax –Factname(identifier that is mapped to factname) –Factname(ident1, ident2) Means that ident1 is the Factname of ident2 Example male(Bob) female(Jill) parent(Jill, Bill) parent(Bob, Bill)
Prolog Rules Use facts to make a particular statement Example Note: :- means if, means and Father(TheDad, TheChild) :- parent(TheDad,TheChild), male(TheDad)
Prolog Why? Ability to ask computer questions, i.e. is Bill the son of Bob? One level isn’t that interesting Multiple levels are –Tax law –Graduation
Prolog Next week More in-depth with prolog Now: – midterm, you have until 9PM to it back to me.