Artificial Intelligence Programming in Prolog Lecture 1: An Introduction 23/09/04.

Slides:



Advertisements
Similar presentations
Getting started with Prolog
Advertisements

Logic Programming Lecture 1: Course orientation; Getting started with Prolog.
Logic Programming Lecture 1: Getting started. Getting started We’ll use SICStus Prolog Free for UofE students Available on all DICE machines
Logic Programming in Prolog
Software Development Languages and Environments. Programming languages High level languages are problem orientated contain many English words are easier.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
1 Introduction to Prolog References: – – Bratko, I., Prolog Programming.
Introduction to MATLAB Northeastern University: College of Computer and Information Science Co-op Preparation University (CPU) 10/20/2003.
Lecture 1: Overview of Computers & Programming
John Hurley Cal State LA
C Programming for engineers Teaching assistant: Ben Sandbank Home page:
For Friday Read “lectures” 1-5 of Learn Prolog Now: prolog-now/
CS 331 / CMPE 334 – Intro to AI CS 531 / CMPE AI Course Outline.
Symbolic AI Lecture Every Monday 12:30-13:30 Lab Session (two groups) Tuesday 16:30 3P30 Tuesday 17:30 3P30.
COMP171 Data Structures and Algorithm Huamin Qu Lecture 1 (Sept. 1, 2005)
COMP171 Data Structures and Algorithm Qiang Yang Lecture 1 ( Fall 2006)
COMP 110 Introduction to Programming Mr. Joshua Stough August 22, 2007 Monday/Wednesday/Friday 3:00-4:15 Gardner Hall 307.
Introduction to a Programming Environment
Symbolic AI weeks of even numbers Lecture Monday 13:00-14:00 (2Q50) Lab Sessions (five groups, all in 2Q52) Monday.
Introduction to Python: Slides Referenced in Homework 0 CSE-391: Artificial Intelligence University of Pennsylvania Matt Huenerfauth January 2005.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
1 Programming Concepts Module Code : CMV6107 Class Contact Hours: 45 hours (Lecture 15 hours) (Laboratory/Tutorial 30 hours) Module Value: 1 Textbook:
1 Please switch off your mobile phones. 2 Prolog: The Initiation ET: Hey Alice! What is this on your desk? Alice: That’s a digital computer. ET: Digital.
CS110/CS119 Introduction to Computing (Java)
1 Software Development Topic 2 Software Development Languages and Environments.
COMP Introduction to Programming Yi Hong May 13, 2015.
Evolution of Programming Languages Generations of PLs.
Nael Alian Introduction to PHP
COSC 2P93 Logic Programming Instructor: Brian Ross Instructor: Brian Ross Texts: Texts: Prolog Programming for Artificial Intelligence,4e, Ivan Bratko,
©Xiaoying Gao, Peter Andreae First Java Program COMP 102 #2 2014T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
COMP 3438 System Programming
1 Agenda Administration Background Our first C program Working environment Exercise Memory and Variables.
Logic Programming Programming Lecture 1: Getting started with Prolog.
First Java Program COMP 102 #2 2015T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
September 19, 2012Introduction to Artificial Intelligence Lecture 5: Functional Programming with Haskell 1 Functional Programming Symbolic AI is based.
© Xiaoying Gao, Peter Andreae Introduction to Computer Program Design COMP T2. Xiaoying (Sharon) Gao Computer Science Victoria University of Wellington.
1 Please switch off your mobile phones. 2 WELCOME To ESC101N: Fundamentals of Computing Instructor: Mainak Chaudhuri
1 Lecture 6 Logic Programming introduction to Prolog, facts, rules Ras Bodik Shaon Barman Thibaud Hottelier Hack Your Language! CS164: Introduction to.
Catie Welsh January 10, 2011 MWF 1-1:50 pm Sitterson 014.
F28PL1 Programming Languages Lecture 16: Prolog 1.
For Wednesday Read “lectures” 7-10 of Learn Prolog Now Chapter 9, exs 4 and 6. –6 must be in Horn clause form Prolog Handout 2.
CS123 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Spring 2010.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
ARTIFICIAL INTELLIGENCE DR. ABRAHAM AI a field of computer science that is concerned with mechanizing things people do that require intelligent.
© Xiaoying Gao, Peter Andreae Introduction to Computer Program Design COMP T2. Xiaoying (Sharon) Gao Computer Science Victoria University of Wellington.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 3, Lecture 1.
Logical and Functional Programming
Introduction to Prolog. Outline What is Prolog? Prolog basics Prolog Demo Syntax: –Atoms and Variables –Complex Terms –Facts & Queries –Rules Examples.
Web Services Course Introduction Week1 Eva Rose, Ph.D.
Logic Programming Dr. Yasser Nada Fall 2010/2011 Lecture 1 1 Logic Programming.
1 Intro to Artificial Intelligence COURSE # CSC384H1F Fall 2008 Sonya Allin Note: many slides drawn from/inspired by Andrew Moore’s lectures at CMU and.
07/10/04 AIPP Lecture 5: List Processing1 List Processing Artificial Intelligence Programming in Prolog Lecturer: Tim Smith Lecture 5 07/10/04.
Abdul Rahim Ahmad MITM 613 Intelligent System Chapter 10: Tools.
Introduction: What is AI? CMSC Introduction to Artificial Intelligence January 3, 2002.
Introduction: What is AI? CMSC Introduction to Artificial Intelligence January 7, 2003.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
CITS4211 Artificial Intelligence Semester 1, 2013 A/Prof Lyndon While School of Computer Science & Software Engineering The University of Western Australia.
Introduction to Web Technologies Module Introduction to Web Technologies – CS th January 2005 Dr Bogdan L. Vrusias
CS140 – Computer Programming 1 Course Overview First Semester – Fall /1438 – 2016/2017 CS140 - Computer Programming 11.
For Friday No reading Prolog handout 3 Chapter 9, exercises 9-11.
For Wednesday Read “lectures” 7-10 of Learn Prolog Now:
Artificial Intelligence (CS 461D)
Artificial Intelligence (CS 370D)
CS190/295 Programming in Python for Life Sciences: Lecture 1
Welcome to CS 1010! Algorithmic Problem Solving.
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Accelerated Introduction to Computer Science
Dr. Yasser Nada Fall 2010/2011 Lecture 1
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
CS114B Introduction to Computer Science II
Presentation transcript:

Artificial Intelligence Programming in Prolog Lecture 1: An Introduction 23/09/04

16:10 23/09/04Lecture 1: An Introduction2 Contents Course Details References Requirements and Exemptions What is AIPP? What is Prolog? Prolog basics Prolog Demo

16:10 23/09/04Lecture 1: An Introduction3 Introductions I am Tim Smith –Office 9, 2 nd floor/left, 2 Buccleuch Place. –Office Hours 9am-12pm every Tuesday. You are…. –Masters students Informatics, AI, CogSci, SLP

16:10 23/09/04Lecture 1: An Introduction4 Course Details 19 lectures Mondays and Thursdays 16:10-17:00 –A9/11, Ground Floor, Forrest Hill 2hr weekly lab tutorials –Computer Lab West, level 5, Appleton Tower –Wednesday 4-6pm or –Friday 3-5pm Please record preference on sheet.

16:10 23/09/04Lecture 1: An Introduction5 Assessment Summer Examination 70% 2 Assignments –Assignment 1 = 10% Available week 2. Due week 6 –Assignment 2 = 20% Available week 6. Due week 11. Weekly Practical exercises –Not assessed, but –Completion is compulsory.

16:10 23/09/04Lecture 1: An Introduction6 Course Materials Course Notes (primary reference) –Handed out in Monday’s lecture –Contains: Course details Introduction to Prolog Revision exercises Weekly Practical exercises –Must bring to practical sessions On-line Lecture slides –

16:10 23/09/04Lecture 1: An Introduction7 References No course text book Useful references: –Clocksin, W.F. and Mellish, C.S., Programming in Prolog: Using the ISO Standard (5th edition), 2003.Programming in Prolog: Using the ISO Standard (5th edition) –Bratko, I., Prolog Programming for Artificial Intelligence (3rd edition), 2001.Prolog Programming for Artificial Intelligence (3rd edition) –Sterling, L. and Shapiro, E., The Art of Prolog (Second edition), 1994.The Art of Prolog (Second edition)

16:10 23/09/04Lecture 1: An Introduction8 Requirements & Exemptions AIPP is aimed at students with previous programming experience. If you have no, or little experience please take Introduction to Java Programming. If you are required to take AIPP and believe you may struggle with the programming speak to me. You may be exempt from AIPP if: –You have previously taken a Uni course in Prolog –You have used Prolog competently in industry. Speak to Specialism supervisor for exemption.

16:10 23/09/04Lecture 1: An Introduction9 Software Sicstus Prolog Installed on the Informatics DICE network –Type sicstus in a terminal window. Computer labs: 5 th floor, Appleton Tower Free Windows version of sicstus available –Request a copy using the Informatics support form: –All prolog code must be tested on DICE version of sicstus before submission.

16:10 23/09/04Lecture 1: An Introduction10 What is AIPP? A comprehensive introduction to Prolog. Specific focus on Artificial Intelligence programming techniques: –Knowledge representation and manipulation, –Database construction and management, –State-space Search, –Planning, –Meta-programming, –Text parsing and Definite Clause Grammars.

16:10 23/09/04Lecture 1: An Introduction11 What is Prolog? PROgrammation et Logique. Edinburgh syntax is the basis of ISO standard. High-level interactive language. Logic programming language. –Based on Horn Clauses (parent(X,Z) ∧ ancestor(Z,Y)) ⊃ ancestor(X,Y)

16:10 23/09/04Lecture 1: An Introduction12 What is Prolog? (2) Programming languages are of two kinds: –Procedural (BASIC, ForTran, C++, Pascal, Java); –Declarative (LISP, Prolog, ML). In procedural programming, we tell the computer how to solve a problem. In declarative programming, we tell the computer what problem we want solved. (However, in Prolog, we are often forced to give clues as to the solution method).

16:10 23/09/04Lecture 1: An Introduction13 What is Prolog used for? Good at –Grammars and Language processing, –Knowledge representation and reasoning, –Unification, –Pattern matching, –Planning and Search. i.e. Prolog is good at Symbolic AI. Poor at: –Repetitive number crunching, –Representing complex data structures, –Input/Output (interfaces).

16:10 23/09/04Lecture 1: An Introduction14 Basic Elements of Prolog Our program is a database of facts and rules. Some are always true (facts): father( john, jim). Some are dependent on others being true (rules): parent( Person1, Person2 ) :- father( Person1, Person2 ). To run a program, we ask questions about the database.

16:10 23/09/04Lecture 1: An Introduction15 Prolog in English Example Database: John is the father of Jim. Jane is the mother of Jim. Jack is the father of John. Person 1 is a parent of Person 2 if Person 1 is the father of Person 2 or Person 1 is the mother of Person 2. Person 1 is a grandparent of Person 2 if some Person 3 is a parent of Person 2 and Person 1 is a parent of Person 3. Example questions: Who is Jim's father? Is Jane the mother of Fred? Is Jane the mother of Jim? Does Jack have a grandchild?

16:10 23/09/04Lecture 1: An Introduction16 Prolog in Prolog Example Database: father( john, jim ). mother( jane, jim ). father( jack, john ). parent( Person1, Person2 ) :- father( Person1, Person2 ). parent( Person1, Person2 ) :- mother( Person1, Person2 ). grandparent( Person1, Person2 ) :- parent( Person3, Person2 ), parent( Person1, Person3 ). Example questions: ?- father( Who, jim ). ?- mother( jane, fred ). ?- mother( jane, jim ). ?- grandparent( jack, _ ). Example Database: John is the father of Jim. Jane is the mother of Jim. Jack is the father of John. Person 1 is a parent of Person 2 if Person 1 is the father of Person 2 or Person 1 is the mother of Person 2. Person 1 is a grandparent of Person 2 if some Person 3 is a parent of Person 2 and Person 1 is a parent of Person 3. Example questions: Who is Jim's father? Is Jane the mother of Fred? Is Jane the mother of Jim? Does Jack have a grandchild?

16:10 23/09/04Lecture 1: An Introduction17 Using Prolog 1.First, write your program (away from computer!). 2.Then, type it into a file, with a.pl extension. Any text editor will do, but Emacs is recommended. 3.Then, type: sicstus 4.You will be presented with the Prolog prompt |?- 5.Then, `consult' your file (omitting the.pl): |?- consult(yourfilename). or |?- [yourfilename]. or [‘folder/filename’]. 6.The entire content of your file is then stored in the memory of the Prolog interpreter. You can see what is consulted by typing | ?- listing. 7.Then you can ask questions of your database.

16:10 23/09/04Lecture 1: An Introduction18 Using Prolog (2) If you edit your program file (e.g. to correct something), be sure to consult it again afterwards! To exit from Prolog, type |?- halt. or press Control/D The Prolog comment characters: –Single line comments: % % This is a comment This not a comment, but an error –Multiple line comments: /* /* This is a multi-line comment which must be closed with a */

16:10 23/09/04Lecture 1: An Introduction19 Prolog Demo