COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

Similar documents
Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

Logical Agents. Outline

Intelligent Agents. Pınar Yolum Utrecht University

Proof Methods for Propositional Logic

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Logical Agents. Chapter 7

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

7. Logical Agents. COMP9414/ 9814/ 3411: Artificial Intelligence. Outline. Knowledge base. Models and Planning. Russell & Norvig, Chapter 7.

Logical Agents. Santa Clara University

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

Artificial Intelligence Chapter 7: Logical Agents

Introduction to Artificial Intelligence. Logical Agents

Kecerdasan Buatan M. Ali Fauzi

Class Assignment Strategies

Knowledge based Agents

CS 188: Artificial Intelligence Spring 2007

Logical Agent & Propositional Logic

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT

Artificial Intelligence

Artificial Intelligence. Propositional logic

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Artificial Intelligence

CS 771 Artificial Intelligence. Propositional Logic

CS 380: ARTIFICIAL INTELLIGENCE

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Logic. proof and truth syntacs and semantics. Peter Antal

TDT4136 Logic and Reasoning Systems

Inf2D 06: Logical Agents: Knowledge Bases and the Wumpus World

Introduction to Intelligent Systems

Logical Agent & Propositional Logic

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

Logical Agents (I) Instructor: Tsung-Che Chiang

Logical agents. Chapter 7. Chapter 7 1

Propositional Logic: Methods of Proof (Part II)

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Logical Agents. Chapter 7

7 LOGICAL AGENTS. OHJ-2556 Artificial Intelligence, Spring OHJ-2556 Artificial Intelligence, Spring

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9

Introduction to Intelligent Systems

Inference in Propositional Logic

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Foundations of Artificial Intelligence

CSC242: Intro to AI. Lecture 11. Tuesday, February 26, 13

Inference Methods In Propositional Logic

Revised by Hankui Zhuo, March 21, Logical agents. Chapter 7. Chapter 7 1

Propositional Logic: Methods of Proof. Chapter 7, Part II

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Propositional Logic: Methods of Proof (Part II)

Lecture 7: Logic and Planning

Propositional Reasoning

Propositional Logic: Logical Agents (Part I)

AI Programming CS S-09 Knowledge Representation

Logic and Inferences

CS 4700: Foundations of Artificial Intelligence

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Inference Methods In Propositional Logic

Logical Agents: Propositional Logic. Chapter 7

Logical agents. Chapter 7. Chapter 7 1

CS:4420 Artificial Intelligence

Adversarial Search & Logic and Reasoning

Propositional Logic: Methods of Proof (Part II)

CS 4700: Artificial Intelligence

Logic: Propositional Logic (Part I)

Advanced Topics in LP and FP

Propositional Logic: Logical Agents (Part I)

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Last update: March 4, Logical agents. CMSC 421: Chapter 7. CMSC 421: Chapter 7 1

CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

Knowledge-based Agents. CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents. Outline. Knowledge-based Agents

Deductive Systems. Lecture - 3

Propositional Logic Part 1

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Logical Agents. Outline

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Description Logics. Deduction in Propositional Logic. franconi. Enrico Franconi

Deliberative Agents Knowledge Representation I. Deliberative Agents

Lecture 7: Logical Agents and Propositional Logic

Lecture 6: Knowledge 1

Logic & Logic Agents Chapter 7 (& background)

Logic & Logic Agents Chapter 7 (& Some background)

Chương 3 Tri th ức và lập luận

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

CS 7180: Behavioral Modeling and Decision- making in AI

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

7.5.2 Proof by Resolution

Artificial Intelligence

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30)

Learning Goals of CS245 Logic and Computation

Propositional logic. Programming and Modal Logic

Logical Agents. Soleymani. Artificial Intelligence: A Modern Approach, 3 rd Edition, Chapter 7

SAT Solvers: Theory and Practice

Transcription:

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

Last week" Main components of PRM" Collision check for a configuration" Collision check for a line segment" Sampling strategy" 2

Once the state graph is constructed," Given an initial & a goal configurations," Find the vertex q i nearest to the initial configuration, where the straight line segment between initial configuration & q i is collision free." Find the vertex q g nearest to the goal configuration, where the straight line segment between goal configuration & q g is collision free." Find a path from q i to q g using the search algorithms we have discussed (blind/informed search)." When is the state graph construction done? i.e., whatʼs the stopping criteria? Use time limit or interleave" 3

Today" Sampling-based approach without state graph" EST" RRT" Why sampling-based approach works?" 4

We donʼt always need to construct the state graph explicitly" Build a search tree directly." Expansive Space Tree (EST)" Set the initial configuration as a root node." Repeat" Select a node q to expand with probability 1/N(q), where N(q) is #nodes in the tree that are within D distance from q." Sample a configuration qʼ uniformly at random from all possible configurations within D distance from q. " If qʼ is collision-free and the straight line segment between q and qʼ is collision-free, add qʼ as a child node of q. " Usually bidirectional search." 5

A different sampling strategy" Rapidly exploring Random Trees (RRT)" Set the initial configuration as a root node." Repeat" Sample a configuration q uniformly at random from the configuration space." Find a node nearest to q. Suppose this node is qʼ. " Find a configuration q new in line segment qʼq, such that the line segment qʼq new lies entirely in the free space and the distance between qʼ and q new is less than D." Add q new as a child node of qʼ in the tree. " Usually bidirectional search." 6

Today" Sampling-based approach without state graph" EST" RRT" Why sampling-based approach works?" 7

From toy problems to real world problems" Workspace 8

Why Sampling-based Approaches work? (Intuitively)" Abundant solutions." To solve the problem, we only need to find one of the solutions" C-space" G I" 9

Why Sampling-based Approaches work? " In most free spaces of real world problems, every configuration sees a significant fraction of the free space" A configuration q sees another configuration qʼ whenever the straight line segment between q & qʼ lies entirely in the free space. " A relatively small number of vertices & edges are sufficient to cover most free spaces with high probability, and hence solve the given queries." 10 C-space"

Slightly more formal" C-space" F 1! F 2! The lookout of a subset F 1 of the free space is the set of all configurations in F 1 from which it is possible to see a significant fraction of the free space outside F 1." β-lookout(f 1 ): The set of configurations in F 1 from which it is possible to see β fraction of the free space outside F 1. " 11

Slightly more formal" C-space" F 1! F 2! 12 The free space F is expansive if all of its subsets have a large lookout" F is αβ-expansive if for any connected subset F i of F, " "Vol(β-lookout(F i )) αvol(f i )." The number of samples to capture the correct connectivity of the free space with probability at least P is inversely proportional to α, β, and (1-P)." PRM (and its variants) performs well when the free space of the problem has large α and β."

Which one is easier to solve by samplingbased approaches?" C-space" C-space" 13

Slightly more formal Notes " If we know α and β of the free space, we can compute the number of samples to solve a given problem with high probability." But, to compute α and β, we need the geometry of the free space. " PRM is successful exactly because itʼs not computing the geometry of the free space." Practically, we donʼt know α and β, nor the exact #samples to use." So, why bother? " Sometimes, we can guess α and β from the workspace know when to use PRM and when not." Guarantees that we will eventually get a solution (if a solution exists)." 14

Narrow passages problem" The set of valid solutions is much smaller compared to the set of all possible solutions. " When the problem is likely to occur?" Cluttered environments" High dimensional C-space" C-space" 15

Today" Sampling-based approach without state graph" EST" RRT" Why sampling-based approach works?" 16

COMP3702/7702 Artificial Intelligence Week 5: Logic (Russell & Norvig ch. 7)" Hanna Kurniawati"

Today" What is logic?" Propositional logic: Syntax & Semantics" Example of using logic to represent a problem" Two types of problems:" Validity" Satisfiability" 18

What is logic?" A formal language to represent sets of states" A convenient abstraction for dealing with many states." Recall in PRM: We can view a vertex in a roadmap to represent a set of nearby states." Regardless of whether thereʼs a natural notion of near or not (i.e., not a metric space), we can use logic to group different states together." Ex.: " "I have a laptop. Includes any brand & model" "There is a laptop on the table. Can be at any position on the table" 19

Where is Logic used?" Action planning (since the first general purpose mobile robot, Shakeyʼ69)" IC design" Esp. after Pentium FDIV (Floating-point Division) bug in ʻ94." Karnaugh map (K-map)" Database, e.g., SQL" Semantic web" Game player" 20

A formal language" Defined by 2 things: Syntax & Semantics" Syntax" What expressions are legal." Example:" "for (j = 0; j < 3; j++) { }" "Coloring books sleep furiously." Semantics" Meaning of the legal expression." 21

Many types of logic" Propositional logic." Predicate / first order logic." High order logic." 22

Today" What is logic?" Propositional logic: Syntax & Semantics" Example of using logic to represent a problem" Two types of problems:" Validity" Satisfiability" 23

Propositional logic Syntax " Atomic sentence." An expression that is known to either be true or false." Are these propositions?" What is the distance between Mars and Earth?" x + 2 = 2x." x + 2 = 2x when x = 1." 2x < 3x." Often represented with a symbol called propositional variable, e.g., P, Q." 24

Propositional logic Syntax " Complex sentences" Constructed from atomic sentences and logical connectives: bracket ( () ), negation (~), and ( ), or ( ), implication ( ), biconditional ( ). " If S is a sentence, (S) is a sentence." If S is a sentence, ~S is a sentence (negation)." If S 1 and S 2 are sentences, S 1 S 2 is a sentence (conjunction)." If S 1 and S 2 are sentences, S 1 S 2 is a sentence (disjunction)." If S 1 and S 2 are sentences, S 1 S 2 is a sentence (implication)." If S 1 and S 2 are sentences, S 1 S 2 is a sentence (biconditional)." 25

Propositional logic Semantics " Meaning of a sentence: Truth values {True, False}." The truth value of a complex sentence can be derived from the truth values of logical connectives for the given interpretation. " P Q ~P P Q P Q P Q P F F T F F T T F T T F T T F T F F F T F F T T F T T T T Q 26

Propositional logic Semantics " Interpretation: Assignment of truth values to propositional variables." A model of a sentence: An interpretation that makes the sentence to be true. " A sentence A entails another sentence B (denoted as A = B) iff every model of A is also a model of B (A B is true)" All models of A" 27 All models of sentence B" All possible interpretations"

Entailment" Relation between sentences are based on relation between their interpretations" A" entails" B" semantics" semantics" Interpretations" Interpretations" Models of A" subset" Models of B" 28

Some terminology" A sentence is valid: Its truth value is T for all possible interpretations." "Ex.: P ~P" A sentence is satisfiable: Its truth value is T for at least one of the possible interpretations." "Ex.: ~P" "Everything thatʼs valid is also satisfiable." A sentence is unsatisfiable: Its truth value is F for all possible interpretations." "Ex.: P ~P" For propositional logic, we can always decide if a sentence is valid/satisfiable/unsatisfiable in finite time (decidable). "" 29

Today" What is logic?" Propositional logic: Syntax & Semantics" Example of using logic to represent a problem" Two types of problems:" Validity" Satisfiability" 30

An example on how logic is used to represent a problem" Formulate information as propositional logic sentences" Create a knowledge base (KB)." KB: a set of sentences, such that KB is false in models that contradict what the agent knows" Example: The Wumpus World" 31

Example: Wumpus world Representing the problem" 32

Example: Wumpus world Representing the problem" Suppose:" P x,y is true iff thereʼs a pit in (x, y)." B x,y is true iff the agent perceives a breeze in (x, y)." W x,y is true iff thereʼs Wumpus in (x, y)." S x,y is true iff the agent perceives a smell in (x, y)." Go x,y is true iff thereʼs gold in (x,y)." G x,y is true iff the agent perceives glitter in (x,y)." Initial knowledge base:" Rules of the environment, e.g.:" 33 S 1 : B 1,1 <-> (P 1,2 P 2,1 )." S 2 : B 2,1 <-> (P 1,1 P 2,2 P 3,1 )." :"

Example: Wumpus world Representing the problem" Results of perception up to the current time can be added to KB" Ex.: Suppose the agent has only visited (1,1) and perceives:" P 1,1 = F ; B 1,1 = F ; W 1,1 = F ; S 1,1 = F ; Go 1,1 = F ; G 1,1 = F." Then, we can add the following sentences to the initial KB: ~P 1,1, ~B 1,1, ~W 1,1, ~S 1,1, ~Go 1,1, ~G 1,1" 34

Example: Wumpus world What can we use KB for?" Deduce new information: Sentences entailed by the current KB can be added to the KB" Answering questions such as can we conclude thereʼs no pit in (1, 2)?" "Formally:" Given the knowledge base: S 1, S 2, S 3,., S n" Does KB entails ~P 1,2?" Meaning: Is the sentence" "S 1 S 2 S 3 S n ~P 1,2 " "valid?" 35

Today" What is logic?" Propositional logic: Syntax & Semantics" Example of using logic to represent a problem" Two types of problems:" Validity" Satisfiability" 36

Validity Problems" Is a given sentence valid?" The sentence is true under all interpretations" 37

Example: Wumpus world Representing the problem" Question: Can we conclude thereʼs no pit in (1, 2)?" Formally: Does the sentence" " " "S 1 S 2 S 3 S 52 ~P 1,2 " "valid?" Two ways:" Model checking." Check validity by checking all models." Theorem proving" Check validity without checking all models. " 38

(Simple) Model checking" KB:" R 1 : ~P 1,1" R 2 : B 1,1 (P 1,2 V P 2,1 )" R 3 : B 2,1 (P 1,1 V P 2,2 V P 3,1 )" R 4 : ~B 1,1" R 5 : B 2,1" Check if ~P 1,2 is entailed by KB." 39

(Simple) Model checking" Enumerate the models." All true/false values for P 1,1, B 1,1, P 1,2, P 2,1, B 2,1, P 2,2, P 3,1." Check if ~P 1,2 is true in all models where the knowledge base (R 1 R 2 R 3 R 4 R 5 ) is true."

(Simple) Model checking" Sound." The result is correct." Complete" It always gives an answer." Complexity:" Time: O(2 n ). " Space: O(n). " n is #propositional variables." 41

Question: Can we conclude thereʼs no pit in (1, 2)?" Easy for us to see, but how to enable computers see it, too? " Formally: Does the sentence" " " "S 1 S 2 S 3 S 4 S 5 ~P 1,2 " "valid?" Two ways:" Model checking." Check validity by checking all models." Theorem proving" Check validity without checking all models. " 42

Logical equivalences" α, β: Sentence (atomic or complex)." 43

Inference rules" Transformation for logical expressions. " Modus ponens" "α β" "α" "β" Modus tollens" "α β" "~β" "~α" And-elimination" "α β " "α" 44

Theorem proving Natural deduction" Use inference rules to deduce a sentence from the set of sentences in the knowledge base." Example:" KB:" S 1 : ~P 1,1" S 2 : B 1,1 (P 1,2 V P 2,1 )" S 3 : B 2,1 (P 1,1 V P 2,2 V P 3,1 )" S 4 : ~B 1,1" S 5 : B 2,1" Check if ~P 1,2 is entailed by KB." 45

Example " S 1 : ~P 1,1" S 2 : B 1,1 (P 1,2 V P 2,1 )" S 3 : B 2,1 (P 1,1 V P 2,2 V P 3,1 )" S 4 : ~B 1,1" S 5 : B 2,1" S 6 : Biconditional elimination to S 2 :" "(B 1,1 (P 1,2 P 2,1 )) ((P 1,2 P 2,1 ) B 1,1 ) " S 7 : And-elimination to S 6: (P 1,2 P 2,1 ) B 1,1 " S 8 : Modus tollens on S 4 and S 7 : ~(P 1,2 P 2,1 )" S 9 : De Morgan to S 8 : ~P 1,2 ~P 2,1." S 10 : And elimination to S 9 : ~P 1,2" 46

Theorem proving Natural deduction Using Search" State space: " All possible set of sentences." Action space: " All inference rules." World dynamics: " Apply the inference rule to all sentences that match the above the line part of the inference rule. Become the sentence that lies below the line of the inference rule." Initial state: " Initial knowledge base." Goal state: " The state contains the sentence weʼre trying to prove." 47

Theorem proving Natural deduction" Sound." May not be complete." Depend on whether we can provide a complete list of inference rules." When we can, the branching factor can be very high." 48

Resolution" A single inference rule." "α β" "~β α " α, β: Sentence (atomic or complex)." But, the single inference rule is sound & complete only when applied to propositional logic sentences written in Conjunctive Normal Form (CNF)." 49

Conjunctive Normal Form (CNF)" Conjunctions of disjunctions." Example: (~A B) (C D) (E F)." Some terminologies" Clause: A disjunctions of literals, e.g., (~A B)." Literals: variables or the negation of variables, e.g., ~A and B." 50

Converting to CNF" Every sentence in propositional logic can be written in CNF." Three steps conversion:" Eliminate arrows using definitions." Drive in negations using De Morganʼs Laws." Distribute OR over AND." 51

Example" Convert (A B) (C D) to CNF" Eliminate arrows: " "~(A B) (~C D)" Drive in negations: " "(~A ~B) (~C D)" Distribute OR over AND:" "(~A ~C D) (~B ~C D)" 52

Theorem proving -- Resolution refutation " Three steps:" Convert all sentences into CNF." Negate the desired conclusion." Apply resolution rule until" Derive false (a contradiction)." Canʼt apply the rule anymore. " Sound & complete (for propositional logic)." If we derive a contradiction, the conclusion follows from the axioms." If we canʼt apply any more, the conclusion cannot be proved from the axioms. " 53

Example" Knowledge base: (P Q) (P R) (Q R)." Does the knowledge base entails R?" Knowledge base: P ~P" Does the knowledge base entails R?" 54

Today" What is logic?" Propositional logic: Syntax & Semantics" Example of using logic to represent a problem" Two types of problems:" Validity" Satisfiability" 55

Satisfiability Problems " Is a given sentence satisfiable?" There is at least one interpretation that makes the sentence to be True." Various applications" Many problems can be phrase as a list of constraints, and a solution is an assignment that satisfies all constraints." Verify air-traffic controller" Write the rules as a set of logical sentences." Check whether the set of sentences and the sentence two airplanes on the same runway at the same time is satisfiable?" Satisfiable: the rules are followed, two airplanes may still happens. " 56

More efficient Model Checking for Satisfiability Problem" Essentially: Assign & simplify" Consider a search tree where at each level we consider the possible assignments to one variable, say V. " On one branch, we assume V is False and on the other that it is True." Given an assignment for a variable, we can simplify the sentence and then repeat the process for another variable." 57

Example" (A B) (~C V A) (C V B)" (P Q) (P ~Q R) (T ~R) (~P ~T) (P S) (T R S) (~S T )" 58

SAT Solvers " Program that automatically detects if a propositional logic sentence is satisfiable." Ex.: Davis Putnam Logeman Loveland (DPLL) Recursive DFS" Speed & memory consumption depend a lot on:" Which symbol is being assigned first " Which assignment is being followed first" A lot of methods have been proposed." Check sec. 7.6.1 of R&N" 59

Today" What is logic?" Propositional logic: Syntax & Semantics" Example of using logic to represent a problem" Two types of problems:" Validity" Satisfiability" 60

Next week" Second part of the class!!!" Making decisions when information are inaccurate & limited" Please review your probability (also uploaded in the readings part of the class website)" 61