CPSC 322 Introduction to Artificial Intelligence

Slides:



Advertisements
Similar presentations
CPSC 322 Introduction to Artificial Intelligence September 13, 2004.
Advertisements

CPSC 322 Introduction to Artificial Intelligence November 19, 2004.
CPSC 322, Lecture 11Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Computer Science cpsc322, Lecture 11 (Textbook Chpt 4.0 – 4.2) January,
CPSC 322 Introduction to Artificial Intelligence November 10, 2004.
CPSC 322 Introduction to Artificial Intelligence September 8, 2004.
CPSC 322 Introduction to Artificial Intelligence December 1, 2004.
Formal Aspects of Computer Science – Week 12 RECAP Lee McCluskey, room 2/07
CPSC 433 Artificial Intelligence CPSC 433 : Artificial Intelligence Tutorials T01 & T02 Andrew “M” Kuipers note: please include.
School of Computing and Mathematics, University of Huddersfield Computing Science: WEEK 17 Announcement: next few weeks… 9 nd Feb: Comparative Programming.
CPSC 322 Introduction to Artificial Intelligence November 12, 2004.
Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.
Knowledge and search, page 1 CSI 4106, Winter 2005 Knowledge and search Points Properties of knowledge  Completeness  Objectivity  Certainty  Formalizability.
Assoc. Prof. Abdulwahab AlSammak. Course Information Course Title: Artificial Intelligence Instructor : Assoc. Prof. Abdulwahab AlSammak
Probability 2 Compound Probability.  Now lets consider the following:  2 dice are rolled and the numbers are added together.  What are the numbers.
Engineering Optimization Chapter 3 : Functions of Several Variables (Part 1) Presented by: Rajesh Roy Networks Research Lab, University of California,
KNOWLEDGE BASED SYSTEMS
Abdul Rahim Ahmad MITM 613 Intelligent System Chapter 10: Tools.
COMPUTER SYSTEM FUNDAMENTAL Genetic Computer School INTRODUCTION TO ARTIFICIAL INTELLIGENCE LESSON 11.
3D PUZZLE PYRAMID Example Text This is an example text.
Introduction to Artificial Intelligence Heshaam Faili University of Tehran.
Introduction to Sociology SOC 103. Sociology: Sociology shows us the power of society to guide all of our life decisions in much the same way that the.
Chapter 8: Estimating with Confidence
Chapter 9: Testing a Claim
Computer Science cpsc322, Lecture 20
PART IV: The Potential of Algorithmic Machines.
Chapter 9: Testing a Claim
As the last CC-list represents Maximum Compatible Classes we conclude:
Chapter 9: Testing a Claim
Warm Up In a 5-7-sentence paragraph, describe how you believe the first people ended up coming to America. Why do you think they came here? How and when.
Artificial Intelligence and Lisp Lecture 5 LiU Course TDDC65 Autumn Semester,
Chapter 1 Definition Theory Causality
CPSC 322 Introduction to Artificial Intelligence
Artificial Intelligence
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Assignment-2 due now Enterprise Architecture Conference Sat. Oct 27
Honors Biology MLA Citation Presentation
CPSC 322 Introduction to Artificial Intelligence
CPSC 322 Introduction to Artificial Intelligence
Haskell Tips You can turn any function that takes two inputs into an infix operator: mod 7 3 is the same as 7 `mod` 3 takeWhile returns all initial.
CPSC 433 : Artificial Intelligence Tutorials T01 & T02
Chapter 9: Testing a Claim
Lesson 7 – Expectations for Restroom and Electronics
OPERATIONS WITH INTEGERS: ADD, SUBTRACT, MULTIPLY & DIVIDE.
A General Backtracking Algorithm
CS 416 Artificial Intelligence
Chapter 9: Testing a Claim
Computer Science cpsc322, Lecture 20
Knowledge Representation
Chapter 9: Testing a Claim
CPSC 322 Introduction to Artificial Intelligence
CPSC 322 Introduction to Artificial Intelligence
CPSC 322 Introduction to Artificial Intelligence
Artificial Intelligence
Chapter 9: Testing a Claim
Semantic and Declarative Technologies AIT Budapest
Chapter 9: Testing a Claim
Chapter 9: Testing a Claim
Copyright © Cengage Learning. All rights reserved.
Chapter 9: Testing a Claim
Classroom Introduction
Copyright © Cengage Learning. All rights reserved.
Chapter 9: Testing a Claim
Chapter 9: Testing a Claim
Expert Knowledge Based Systems
Chapter 3 Techniques of Differentiation
Introducing Natural Deduction
Logic for Program Call chapter 7
Reading Models A reading model is
Presentation transcript:

CPSC 322 Introduction to Artificial Intelligence November 17, 2004

Things... Term project is due in less than two weeks from today The final exam will be at noon on Friday, December 10, in MCML 166

Move generation for the peg puzzle A simple observation: if we represent the state of a peg puzzle like this: [b,-,b,-,r,r] then generating a new state that results from moving a blue peg one space to the right is nothing more than replacing a subsequence like this [b,-] with a subsequence like this [-,b]. So by scooting along the list above and collecting a new state every time we find a [b,-] and replace it with [-,b], we get this collection of new states: [[-,b,b,-,r,r],[b,-,-,b,r,r]]

Move generation for the peg puzzle Similarly, a blue peg jumping over a red peg to the right is just this replacement: [b,r,-] is replaced by [-,r,b] Likewise, a red peg moving one space to the left and a red peg jumping over a blue peg to the left are these replacements, respectively: [-,r] is replaced by [r,-] [-,b,r] is replaced by [r,b,-]

Move generation for the peg puzzle So if we can construct a procedure to scoot along a list from left to right and replace one occurrence of a given subsequence with another desired subsequence, AND if we can collect all the different lists that result from making those replacements... ...then we have the basis for a move generator for our beloved peg puzzle.

Move generation for the peg puzzle /* pegpuzzle2.ci */ gen_all_moves(X,Movelist) <- gen_all_blue_moves(X,Bluemoves) & gen_all_red_moves(X,Redmoves) & append(Bluemoves,Redmoves,Movelist). gen_all_blue_moves(X,Bluemoves) <- gen_all_blue_slides(X,Blueslides) & gen_all_blue_jumps(X,Bluejumps) & append(Blueslides,Bluejumps,Bluemoves). gen_all_red_moves(X,Redmoves) <- gen_all_red_slides(X,Redslides) & gen_all_red_jumps(X,Redjumps) & append(Redslides,Redjumps,Redmoves). gen_all_blue_slides(Board,Newboards) <- all_replacements(Board,[b,-],[-,b],Newboards). gen_all_blue_jumps(Board,Newboards) <- all_replacements(Board,[b,r,-],[-,r,b],Newboards). gen_all_red_slides(Board,Newboards) <- all_replacements(Board,[-,r],[r,-],Newboards). gen_all_red_jumps(Board,Newboards) <- all_replacements(Board,[-,b,r],[r,b,-],Newboards).

Move generation for the peg puzzle all_replacements(Board,Oldseq,Newseq,[Newhead|Newrest]) <- replace_subseq(Board,Oldseq,Newseq,Newhead) & all_replacements(Board,Oldseq,Newseq,Newrest) & no_duplicates([Newhead|Newrest]). all_replacements(Board,Oldseq,Newseq,[]). replace_subseq(Oldseq,Oldsubseq,Newsubseq,Newseq) <- append(L1,L2,Oldseq) & append(Oldsubseq,L3,L2) & append(Newsubseq,L3,L4) & append(L1,L4,Newseq).

Move generation for the peg puzzle append([],Z,Z). append([A|X],Y,[A|Z]) <- append(X,Y,Z). no_duplicates([]). no_duplicates([H|T]) <- notmember(H,T) & no_duplicates(T). notmember(X,Y) <- ~member(X,Y). member(H,[H|T]). member(X,[H|T]) <- member(X,T). /* notmember(X,[]). notmember(X,[H|T]) <- X\=H & notmember(X,T). */

Move generation in Prolog /* pegpuzzle.pl */ gen_all_moves(X,Movelist) :- gen_all_blue_moves(X,Bluemoves) , gen_all_red_moves(X,Redmoves) , append(Bluemoves,Redmoves,Movelist). gen_all_blue_moves(X,Bluemoves) :- gen_all_blue_slides(X,Blueslides) , gen_all_blue_jumps(X,Bluejumps) , append(Blueslides,Bluejumps,Bluemoves). gen_all_red_moves(X,Redmoves) :- gen_all_red_slides(X,Redslides) , gen_all_red_jumps(X,Redjumps) , append(Redslides,Redjumps,Redmoves). gen_all_blue_slides(Board,Newboards) :- all_replacements(Board,[b,-],[-,b],Newboards). gen_all_blue_jumps(Board,Newboards) :- all_replacements(Board,[b,r,-],[-,r,b],Newboards). gen_all_red_slides(Board,Newboards) :- all_replacements(Board,[-,r],[r,-],Newboards). gen_all_red_jumps(Board,Newboards) :- all_replacements(Board,[-,b,r],[r,b,-],Newboards).

Move generation in Prolog all_replacements(Board,Oldseq,Newseq,Y) :- bagof(X,replace_subseq(Board,Oldseq,Newseq,X),Y). all_replacements(Board,Oldseq,Newseq,[]). replace_subseq(Oldseq,Oldsubseq,Newsubseq,Newseq) :- append(L1,L2,Oldseq) , append(Oldsubseq,L3,L2) , append(Newsubseq,L3,L4) , append(L1,L4,Newseq). append([],Z,Z). append([A|X],Y,[A|Z]) :- append(X,Y,Z).

Rule-based systems and search

Rule-based systems and search database0 R1 R2 R3 database1 database2 database3 R1 R2 R3 R1 R2 R3 R1 R2 R3 database4 database5 database6 database7 database9 database10 database11 database12 database13

Rule-based systems and search database0 R1 R2 R3 database1 database2 database3 R1 R2 R3 R1 R2 R3 R1 R2 R3 database4 database5 database6 database7 database9 database10 database11 database12 database13

Rule-based systems and search database0 R3 database3 R1 R2 R3 database11 database12 database13

Rule-based systems and search database0 R3 database3 R1 database11

Rule-based systems and search database0 R3 database3 R1 database11 and so on...

Chapter 6 Chapter 6 in your textbook starts out by talking about expert systems, but it quickly turns into a discussion of how to build the CILOG meta-interpreter Rule-based systems are similar in some ways to deductive reasoning systems, but rule-based systems aren’t restricted to logical inference Still, we could write simple rule-based systems in CILOG if CILOG could write to a data base, but no...

...so we’ll wave goodbye to expert systems and move ahead to Chapter 8, which is about...

Actions and Planning There are a number of situations where you’d like your man-made artifacts to have some ability to make a plan and then act according to the plan

Actions and Planning Planners that can do stuff like this....

Actions and Planning

Actions and Planning ...have their beginnings in stuff like this...

Actions and Planning ...have their beginnings in stuff like this...

Actions and Planning So we’ll start at the beginning, and try to figure out how to get a computer to generate a plan to get from here.... B A

Actions and Planning ...to here... A B

Actions and Planning ...and finally to here A B

Actions and Planning Start reading chapter 8 A B