UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Monkey and Bananas Exercise Notes on Exercise 3.10 of Bratko For CSCE 580 Sp03.

Slides:



Advertisements
Similar presentations
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 531 Compiler Construction Final Lecture of the Semester Spring 2010 Marco.
Advertisements

Lecture 10 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Ch.2: Syntax and Semantics Fall 2005.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.6 [P]: Reasoning Under Uncertainty Section.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Blind State-Space Search Notes for Ch.11 of Bratko For CSCE 580 Sp03 Marco.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.5 [P]: Propositions and Inference Sections.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Controlling Backtracking Notes for Ch.5 of Bratko For CSCE 580 Sp03 Marco Valtorta.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Program 1 Fall 2008 Marco Valtorta
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering More Built-in Predicates Notes for Ch.7 of Bratko For CSCE 580 Sp03 Marco Valtorta.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.6: Adversarial Search Fall 2008 Marco Valtorta.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Using Definite Knowledge Notes for Ch.3 of Poole et al. CSCE 580 Marco Valtorta.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.12 [P]: Individuals and Relations Proofs.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Using Definite Knowledge: Two Short Examples Notes for Ch.3 of Poole et al.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Using Definite Knowledge Notes for Ch.3 of Poole et al. CSCE 580 Marco Valtorta.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Introduction to Prolog Notes for Ch.1 of Bratko For CSCE 580 Sp03 Marco Valtorta.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Input and Output Notes for Ch.6 of Bratko For CSCE 580 Sp03 Marco Valtorta.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Haskell Fall 2005 Marco Valtorta
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.6 [P]: Reasoning Under Uncertainty Sections.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 390 Professional Issues in Computer Science and Engineering Ch.3: Philosophic.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering A Hole in Goal Trees Notes for: D.W. Loveland and M. Stickel. “A Hole in Goal.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Problem Spaces and Search Fall 2008 Jingsong.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Using Definite Knowledge Notes for Ch.3 of Poole et al. CSCE 580 Marco Valtorta.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 390 Professional Issues in Computer Science and Engineering Ch.6: The.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Lists, Operators, Arithmetic Notes for Ch.3 of Bratko For CSCE 580 Sp03 Marco.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Syntax and Meaning of Prolog Programs Notes for Ch.2 of Bratko For CSCE 580.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 190 Computing in the Modern World Research Methodologies in Computing.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Bayes-ball—an Efficient Algorithm to Assess D-separation A Presentation for.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Using Structures: Example Programs Notes for Ch.4 of Bratko For CSCE 580 Sp03.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 190 Computing in the Modern World Two Example Bayesian Networks March.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Literate Programming in Haskell Fall.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Introduction to Functional Programming Notes for CSCE 190 Based on Sebesta,
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Dijkstra’s Algorithm: Notes to Complement.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.2 [P]: Agent Architectures and Hierarchical.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Heuristic Search Notes for Ch.12 of Bratko and Ch.2 of Shoham For CSCE 580.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 190 Computing in the Modern World CSE Curricula Spring 2010 Marco Valtorta.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Operations on Data Structures Notes for Ch.9 of Bratko For CSCE 580 Sp03 Marco.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 190 Careers in Computer Science, Computer Engineering, and Computer Information.
Design Review for Senior Project Month Day, Year 1 of 10 Title Name(s) Department of Computer Science and Engineering University of South Florida Tampa,
Departments in Business Business Name 1 Business Name 2.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 781 AILog for Ch.5 Spring 2011 Marco Valtorta
Lecture 5 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
CSCE790: Security and Privacy for Emerging Ubiquitous Communication system Wenyuan Xu Department of Computer Science and Engineering University of South.
Negation Chapter 5. Stating Negative Conditions n Sometimes you want to say that some condition does not hold n Prolog allows this –not/1this is a predicate.
Lecture 15 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
1Computer Sciences Department. Objectives Recurrences.  Substitution Method,  Recursion-tree method,  Master method.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Introduction to Probability (CSCE 317) January 21, 2016 Marco Valtorta SWRG.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 390 Professional Issues in Computer Science and Engineering Three Simple.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Operational Semantics (Slides mainly.
CSCE 390 Professional Issues in Computer Science and Engineering Ch
Trails Carolina
Therapy Programs Provider: Trails Carolina
Trails Carolina: Social Media Profiles
CSCE 390 Professional Issues in Computer Science and Engineering Ch
CSCE 390 Professional Issues in Computer Science and Engineering Ch
EXAMPLE 1-1 Defining the Problem and Developing Alternatives
Project Title This is a sample slide layout
Fall 2014 Marco Valtorta CSCE 390 Professional Issues in Computer Science and Engineering Three Simple Cases by Robert Barger: Absolutist.
CSCE 390 Professional Issues in Computer Science and Engineering Ch
EXAMPLE 1-1 Defining the Problem and Developing Alternatives
Title Go back and review the instructions and hints
CSCE 390 Professional Issues in Computer Science and Engineering Ch
Department of Computer Science & Engineering, HITEC University, Taxila
Fall 2017 Marco Valtorta CSCE 390 Professional Issues in Computer Science and Engineering Three Simple Cases by Robert Barger: Absolutist.
BIT116: Scripting Functions.
A test of Engineering and Cooperation Skills
Spring 2011 Marco Valtorta CSCE 390 Professional Issues in Computer Science and Engineering Three Simple Cases by Robert Barger: Absolutist.
Fall 2016 Marco Valtorta CSCE 390 Professional Issues in Computer Science and Engineering Three Simple Cases by Robert Barger: Absolutist.
CSCE 390 Professional Issues in Computer Science and Engineering Ch
CSCE 390 Professional Issues in Computer Science and Engineering Ch
Presentation transcript:

UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Monkey and Bananas Exercise Notes on Exercise 3.10 of Bratko For CSCE 580 Sp03 Marco Valtorta

UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Bratko’s Solution let canget(State,Actions) be the relation that holds if the monkey can get from State to a state in which it has the bananas by carrying out the moves described in the list Actions. If the monkey already has the bananas, there is nothing that it needs to do. canget( state(_,_,_,has), [ ]). Definition continues on the next slide

UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Bratko’s Solution (ctd.) The monkey can get from State to a state in which it has the bananas by doing Action followed by Actions if –(a) the monkey can move from State to NewState by doing Action, and –(b) the monkey can move from NewState to a state in which it has the bananas by doing Actions. canget( State, [Action|Actions]) :- move( State, Action, NewState), canget( NewState, Actions).

UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Alternate Solution canget1(State, Actions, Path) if the monkey can get the bananas from State by doing the actions in the difference list Path – Actions If the monkey is already in a state in which it can get the bananas, then there is nothing that it needs to do: canget1( state(_,_,_,has), Actions, Actions). Definition continues on the next slide

UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Alternate Solution (Ctd.) The monkey can get the bananas from State1 by doing the Actions in Path - Actions if –(a) the monkey can move to State2 by doing Move, and –(b) the monkey can get the bananas from State2 by doing the actions in Path - (Actions + Move) canget1( State1, Actions, Path) :- move( State1, Move, State2), canget1( State2, [Move | Actions], Path).

UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Alternate Solution (Ctd.) There is a procedural reading to the alternate solution: accumulate the solution path into the Actions list going down the goal tree, then save it at the bottom of the goal tree The solution Path is built backwards! We need: canget( State, Actions) :- canget1( State, [ ], ReverseActions), rev(Actions, ReverseActions). Actions can be thought of as an accumulator. Accumulators and difference lists are good for efficiency, but in this exercise the simpler solution is faster too!