1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Ch6 logic agent kho tài liệu bách khoa

82 160 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Logical Agents 05/2005 Nội dung • Knowledge‐based agents • Một ví dụ: Wumpus world • Logic tổng qt – mơ hình (models) và phép suy diễn (entailment) • Logic mệnh đề (Propositional logic) – Tương đương logic (Equivalence), Hằng đúng (validity), Khả thỏa  (satisfiability) • Suy luận logic (Inference rules) và chứng minh định lý  (theorem proving) • Thuật tốn Vương Hạo • Phương pháp hợp giải (Resolution) • Lập luận tiến (Forward chaining) • Lập luận lùi (Backward chaining) 05/2005 Knowledge Bases Agent • Cơ sở tri thức (Knowledge Base) – Tập hợp các tri thức đặc tả miền đối tượng nào đó – Các "câu" (sentences) khẳng định về giới thực, biểu diễn  bằng một ngơn ngữ thuận tiện cho máy tính gọi là ngơn ngữ biểu diễn tri thức • Cơ sở tri thức được xây dựng từ: – agent được cung cấp các tri thức ban đầu về miền (declarative) – agent khám phá tri thức mới (learning) • Các thao tác chính của knowledge‐based agents: – TELL : nhận các thơng tin từ các cảm nhận (percept) – ASK : suy diễn để chọn hành đơng hợp lý phải thực hiện • Câu trả lời sẽ suy ra từ các tri thức đã cung cấp (TELLED) trước đây • Động cơ suy diễn (Inference engine) – gồm các thuật toán độc lập với miền đối tượng dùng để xác  định các tri thức mới hay hành động được suy ra từ KB 05/2005 A simple knowledge‐based agent function KB-AGENT(percept) returns an action static: KB, a knowledge base t , a counter, initially 0, indicating time TELL(KB, MAKE-PERCEPT-SENTENCE(percept, t)) action  ASK(KB, MAKE-ACTION-QUERY(t)) TELL(KB, MAKE-ACTION-SENTENCE(action, t)) tt+1 return action • Agent phải có thể : – – – – – 05/2005 Biểu diễn trạng thái, hành động, … Thu nạp các nhận thức mới Cập nhật biểu diễn bên trong về giới  Suy luận ra các thuộc tính ẩn của thế giới Suy luận để chọn các hành động tương ứng Knowledge‐based agents: Wumpus World Wumpus 05/2005 • Mơi trường của Wumpus world là một hang động gồm nhiều phòng  nối với nhau bởi các hành lang • Ẩn dấu một nơi nào đó trong hang  động là wumpus, một con thú ăn  thịt bất cứ ai vào phòng của nó.  • Agent có duy nhất một mũi tên mà dùng để bắn wumpus • Trong một số phòng có chứa  những hố sâu khơng đáy  (bottomless pits) sẽ đánh bẫy bất  ai lang thang vào những phòng  này.  • Mục đích của agent là tìm phòng  chứa vàng và mang nó trở về nơi  xuất phát mà khơng bị giết Wumpus World PEAS description • Performance measure – gold +1000, death ‐1000 – ‐1 per step, ‐10 for using the arrow • Environment – A grid of rooms surrounded by walls can contain agent and object – The agent always starts in the square labeled [1, 1] – The locations of the gold and the wumpus are chosen randomly, • Sensors: (Stench, Breeze, Glitter, Bump, Scream) – In the squares directly (not diagonally) adjacent squares to the wumpus, the  agent will perceive a stench (mù hơi thối) – In the squares directly adjacent to a pit, the agent will perceive a breeze (gió) – In the square where the gold is, the agent will perceive a glitter (ánh sáng lấp  lánh) – When an agent walks into a wall, it will perceive a bump (va chạm) – When the wumpus is killed, it emits a woeful scream (thiếng thét) that can be  perceived anywhere in the cave 05/2005 Wumpus World PEAS description • Actuators: – Left turn – Right turn – Forward – đi tới • Moving forward has no effect if there is a wall in front of the agent – Grab – nhặt • to pick up an object that is in the same square as the agent.  – Shoot – bắn • to fire an arrow in the direction the agent is facing. The arrow continues until it either hits and kills the wumpus or hits a wall.  • The agent only has one arrow, so only the first Shoot has effect – Release – • to leave the cave;  • it is effective only when the agent is in the start square 05/2005 Wumpus world characterization • Fully Observable – No – only local perception • Deterministic – Yes – outcomes exactly specified • Episodic – No – sequential at the level of actions • Static – Yes – Wumpus and Pits do not move • Discrete – Yes • Single‐agent? – Yes – Wumpus is essentially a natural feature 05/2005 Exploring a wumpus world A Agent B Breeze G Glliter, Gold OK Safe Square P Pit S Stench V Visitted W Wumpus The first percept [None, None, None, None, None] There was no stench or breeze in [1,1], the agent can infer that [1,2] and [2,1] are free of dangers They are marked with an OK 05/2005 Exploring a wumpus world A Agent B Breeze G Glliter, Gold OK Safe Square P Pit S Stench V Visitted W Wumpus Agent decides to move forward to [2,1] After moving, percept is [None, Breeze, None, None, None] 05/2005 10 Backward chaining example 05/2005 68 Backward chaining example 05/2005 69 Backward chaining example 05/2005 70 Backward chaining example 05/2005 71 Backward chaining example 05/2005 72 Backward chaining example 05/2005 73 Backward chaining example 05/2005 74 Backward chaining example 05/2005 75 Backward chaining example 05/2005 76 Backward chaining example 05/2005 77 Forward vs. backward chaining • FC is data‐driven, automatic, unconscious  processing, – e.g., object recognition, routine decisions • May do lots of work that is irrelevant to the goal  • BC is goal‐driven, appropriate for problem‐solving, – e.g., Where are my keys? How do I get into a PhD  program? • Complexity of BC can be much less than linear in  size of KB 05/2005 78 Inference‐based agents in the wumpus world • Initial KB of a wumpus‐world agent using propositional  logic: P1,1 W1,1 Bx,y  (Px,y+1  Px,y‐1  Px+1,y  Px‐1,y)  Sx,y  (Wx,y+1  Wx,y‐1  Wx+1,y  Wx‐1,y) • There is only one wumpus: W1,1  W1,2  …  W4,4 W1,1  W1,2 W1,1  W1,3 …  64 distinct proposition symbols, 155 sentences 05/2005 82 05/2005 83 Expressiveness limitation of propositional logic • KB contains "physics" sentences for every single  square • For every time t and every location [x,y], t x, y L  facingRight  forward  L t t t x  1, y • Rapid proliferation of clauses 05/2005 84 Summary • Logical agents apply inference to a knowledge base to derive  new information and make decisions • Basic concepts of logic: – – – – – – syntax: formal structure of sentences semantics: truth of sentences wrt models entailment: necessary truth of one sentence given another inference: deriving sentences from other sentences soundness: derivations produce only entailed sentences completeness: derivations can produce all entailed sentences • Wumpus world requires the ability to represent partial and  negated information, reason by cases, etc • Resolution is complete for propositional logic Forward, backward chaining are linear‐time, complete for  Horn clauses • Propositional logic lacks expressive power 05/2005 85 ... tri thức được xây dựng từ: – agent được cung cấp các tri thức ban đầu về miền (declarative) – agent khám phá tri thức mới (learning) • Các thao tác chính của knowledge‐based agents: – TELL : nhận các thơng tin từ... wumpus, the  agent will perceive a stench (mù hơi thối) – In the squares directly adjacent to a pit, the agent will perceive a breeze (gió) – In the square where the gold is, the agent will perceive a glitter (ánh sáng lấp ... Moving forward has no effect if there is a wall in front of the agent – Grab – nhặt • to pick up an object that is in the same square as the agent.   – Shoot – bắn • to fire an arrow in the direction the agent is facing. The arrow

Ngày đăng: 08/11/2019, 19:15

Xem thêm:

TỪ KHÓA LIÊN QUAN

Mục lục

    A simple knowledge-based agent

    Knowledge-based agents: Wumpus World

    Wumpus World PEAS description

    Wumpus World PEAS description

    Exploring a wumpus world

    Exploring a wumpus world

    Exploring a wumpus world

    Exploring a wumpus world

    Exploring a wumpus world

    Exploring a wumpus world

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w