• Aucun résultat trouvé

7 LOGICAL AGENTS

N/A
N/A
Protected

Academic year: 2022

Partager "7 LOGICAL AGENTS "

Copied!
55
0
0

Texte intégral

(1)
(2)

2 INTELLIGENT AGENTS

function TABLE-DRIVEN-AGENT( ) returns an action static: , a sequence, initially empty

, a table of actions, indexed by percept sequences, initially fully specified append to the end of

LOOKUP( , ) return

Figure 2.8

function REFLEX-VACUUM-AGENT( [ , !" ]) returns an action if !" =# $ % then return& !'

else if( =) then return* (+, else if( =- then return. 0/

Figure 2.10

function SIMPLE-REFLEX-AGENT( ) returns an action static: !1, a set of condition–action rules

2 INTERPRET-INPUT( )

!12 RULE-MATCH( 3 ,!" ) RULE-ACTION[!1 ] return

Figure 2.13

2

(3)

function REFLEX-AGENT-WITH-STATE( ) returns an action static: 3 , a description of the current world state

!1 , a set of condition–action rules , the most recent action, initially none

2 UPDATE-STATE( 3 , , )

!12 RULE-MATCH( 3 ,!" ) RULE-ACTION[!1 ] return

Figure 2.16

(4)

3 SOLVING PROBLEMS BY SEARCHING

function SIMPLE-PROBLEM-SOLVING-AGENT(4 ) returns an action inputs:4 , a percept

static: 5, an action sequence, initially empty

3 , some description of the current world state

+, a goal, initially null

6 , a problem formulation

2 UPDATE-STATE( 3 , ) if 5 is empty then do

+ FORMULATE-GOAL( )

4 67 FORMULATE-PROBLEM( 3 ,+)

58 SEARCH(6 ) FIRST( 5 )

59 REST(5) return

Figure 3.2

function TREE-SEARCH(6 , 3+% ) returns a solution, or failure initialize the search tree using the initial state of6

loop do

if there are no candidates for expansion then return failure choose a leaf node for expansion according to 3+%

if the node contains a goal state then return the corresponding solution else expand the node and add the resulting nodes to the search tree

Figure 3.9

4

(5)

function TREE-SEARCH(6;:0/$1+ ) returns a solution, or failure

/0+1<

INSERT(MAKE-NODE(INITIAL-STATE[6 ]),/$1+ ) loop do

if EMPTY?(/$+1 ) then return failure

=2 REMOVE-FIRST(/0+1 )

if GOAL-TEST[6 ] applied to STATE[>=] succeeds then return SOLUTION(= )

/$1+<

INSERT-ALL(EXPAND(= ,6 ),/$1+ ) function EXPAND(>=:6 ) returns a set of nodes

!? the empty set

for each@ , !1 A in SUCCESSOR-FN[6 ](STATE[>= ]) do

B a new NODE

STATE[]C !1 PARENT-NODE[ ]D>=

ACTION[]E

PATH-COST[] PATH-COST[= ] + STEP-COST(>=, , ) DEPTH[ ] DEPTH[= ] + 1

add to!

return!

Figure 3.12

function DEPTH-LIMITED-SEARCH(4 6 ,06F$ ) returns a solution, or failure/cutoff return RECURSIVE-DLS(MAKE-NODE(INITIAL-STATE[6 ]),6 ,$6F$ ) function RECURSIVE-DLS(>= ,6 ,$6F$ ) returns a solution, or failure/cutoff

!1 G !1 =H2

false

if GOAL-TEST[6 ](STATE[>=]) then return SOLUTION(= ) else if DEPTH[>= ] =06F$ then return!" 3IG

else for each! in EXPAND(= ,6 ) do

!1J 4

RECURSIVE-DLS(! ,6 ,$6F$ ) if !1 =!1 IG then!1 IG !1 =H2 true else if !1 LKM /$!1 then return !"

if!1 IG !1 =H then return!" 3IG else return/$!1

Figure 3.17

(6)

6 Chapter 3. Solving Problems by Searching

function ITERATIVE-DEEPENING-SEARCH(6 ) returns a solution, or failure inputs:6 , a problem

for= 0,N 0 toO do

!1J 4

DEPTH-LIMITED-SEARCH(6 ,=4 , ) if !1 LKM cutoff then return!1J

Figure 3.19

function GRAPH-SEARCH(6P:0/$1+ ) returns a solution, or failure

( =Q an empty set

/0+1<

INSERT(MAKE-NODE(INITIAL-STATE[6 ]),/$1+ ) loop do

if EMPTY?(/$+1 ) then return failure

=2 REMOVE-FIRST(/0+1 )

if GOAL-TEST[6 ](STATE[= ]) then return SOLUTION(>= ) if STATE[= ] is not in( = then

add STATE[>= ] to( =

/$1+<

INSERT-ALL(EXPAND(= ,4 6 ),/$1+ )

Figure 3.25

(7)

function RECURSIVE-BEST-FIRST-SEARCH(6 ) returns a solution, or failure RBFS(6 , MAKE-NODE(INITIAL-STATE[6 ]),O )

function RBFS(6 ,>= ,/ $6F0 ) returns a solution, or failure and a newR -cost limit if GOAL-TEST[6 ]( 3 ) then return>=

!? EXPAND(= ,6 ) if !4 is empty then return/$!" ,O for each in! do

R [s]TSVUWYX0Z>XI[]\_^]XI[:

R2`

=a0[

repeat

4 the lowestR -value node in! ifR2` acbC/ J$6F$ then return/$J!1 ,R [ ]

J > $de2

the second-lowestR -value among!

!1J

,R [ ] RBFS(4 6 , ,Sgf(h?X/ 06F$ :i $d[) if !1 LKM /$!1 then return !"

Figure 4.6

function HILL-CLIMBING(6 ) returns a state that is a local maximum inputs:6 , a problem

local variables: !14 , a node

>(+,"

, a node

!1 4

MAKE-NODE(INITIAL-STATE[6 ]) loop do

>(+," 8

a highest-valued successor of!1

if VALUE[neighbor]j VALUE[current] then return STATE[!1 4 ]

!14 4DY+,

Figure 4.13

(8)

8 Chapter 4. Informed Search and Exploration

function SIMULATED-ANNEALING(6 ,, =!1 ) returns a solution state inputs:6 , a problem

,=!1 , a mapping from time to “temperature”

local variables: !14 , a node

>k

, a node

l

, a “temperature” controlling the probability of downward steps

!1 4

MAKE-NODE(INITIAL-STATE[6 ]) for 4 1 toO do

l

C, =!"

[ ]

if l = 0 then return!" 4

>k

a randomly selected successor of!" 4

mon

VALUE[>k ] – VALUE[!" 4 ] if

mgn

b 0 then!14 4DY k

else!14 4DY k only with probabilitypiq2rBsIt

Figure 4.17

function GENETIC-ALGORITHM("!1 , FITNESS-FN) returns an individual inputs:"!1 , a set of individuals

FITNESS-FN, a function that measures the fitness of an individual repeat

>u "!1(

empty set

loop for from 1 to SIZE("!1 ) do

kv RANDOM-SELECTION("4!"(

, FITNESS-FN)

%w RANDOM-SELECTION("!1( , FITNESS-FN)

,$=Q REPRODUCE(k ,% )

if (small random probability) then,$(=v MUTATE(,0(= ) add,$(= toYu "!1(

"!1 xC>u "!1(

until some individual is fit enough, or enough time has elapsed return the best individual in"!1 , according to FITNESS-FN

function REPRODUCE(k ,% ) returns an individual inputs:k ,% , parent individuals

LENGTH(k )

< random number from 1 to

return APPEND(SUBSTRING(k , 1, ), SUBSTRING(% ,y\{z , ))

Figure 4.21

(9)

function ONLINE-DFS-AGENT( ) returns an action inputs: |, a percept that identifies the current state

static: !1 , a table, indexed by action and state, initially empty

!1Y k( =

, a table that lists, for each visited state, the actions not yet tried

!1Y e' 'e =

, a table that lists, for each visited state, the backtracks not yet tried

, , the previous state and action, initially null if GOAL-TEST( |) then return

if | is a new state then!1Yk( = [ |] ACTIONS( |) if is not null then do

!1J

[ ,]D |

add to the front of!1Y e' 'e =

[ |] if!1>k4 =

[ |] is empty then if!1Y e' 'e =

[ |] is empty then return

elsew an action such that !1 [ , |] = POP(!1Y e' 'e =

[ |]) elseL POP(!1Y k( = [ |])

<D |

return

Figure 4.25

function LRTA*-AGENT( |) returns an action inputs: |, a percept that identifies the current state

static: !1 , a table, indexed by action and state, initially empty

}

, a table of cost estimates indexed by state, initially empty

, , the previous state and action, initially null if GOAL-TEST( |) then return

if | is a new state (not in} ) then} [ |]~^ ( |) unless is null

!1J

[ ,]D |

}

[ ] Sofh

ACTIONS‚Iƒ

LRTA*-COST( ,, !" [,],} )

L an action in ACTIONS(|) that minimizes LRTA*-COST(|, , !1 [ ,|],} )

<D

|

return

function LRTA*-COST( , , |,} ) returns a cost estimate if | is undefined then return^?X3„i[

else return… X3„e: †:„ |[g\ˆ‡ `„ |a

Figure 4.29

(10)

5 CONSTRAINT SATISFACTION PROBLEMS

function BACKTRACKING-SEARCH( ) returns a solution, or failure return RECURSIVE-BACKTRACKING(‰9Š , )

function RECURSIVE-BACKTRACKING( (+e46g4 ,3 ) returns a solution, or failure if(+e6g4 is complete then return (+e46g4

d8 SELECT-UNASSIGNED-VARIABLE(VARIABLES[3 ],(+e6g4 , ) for eachdJ!4 in ORDER-DOMAIN-VALUES(d , +46g4 , ) do

ifdJ!4 is consistent with +46g4 according to CONSTRAINTS[3 ] then add‰ d =d!4 Š to(+e6g

!1J 4

RECURSIVE-BACKTRACKING((+e6g ,3 ) if!1J LKM /$J!1 then return !1

remove‰ d =d!4 Š from(+46g return/$J!1

Figure 5.4

10

(11)

function AC-3(3 ) returns the CSP, possibly with reduced domains inputs:3 , a binary CSP with variables‰i‹Œ : ‹gŽ :: ‹o‘Š

local variables: 5!4!4, a queue of arcs, initially all the arcs in3 while5!4! is not empty do

X

‹o’

:

‹F“

[4 REMOVE-FIRST(5!4!4 )

if REMOVE-INCONSISTENT-VALUES(‹ ’: ‹ “ ) then for each‹V” in NEIGHBORS[‹o’] do

add (‹c” : ‹ ’) to5!4!4

function REMOVE-INCONSISTENT-VALUES(‹ ’: ‹ “ ) returns true iff we remove a value

6od =v•/

for eachk in DOMAIN[‹ ’] do

if no value– in DOMAIN[‹ “] allows (k ,% ) to satisfy the constraint between‹ ’ and‹ “ then deletek from DOMAIN[‹ ’]; 6od =vD !4

return 6od =

Figure 5.9

function MIN-CONFLICTS( ,6oik ) returns a solution or failure inputs:3 , a constraint satisfaction problem

6oik , the number of steps allowed before giving up

!1 4

an initial complete assignment for for = 1 to6oik do

if!1 is a solution for then return!14

d8 a randomly chosen, conflicted variable from VARIABLES[ ]

d!<

the valued ford that minimizes CONFLICTS(d ,d ,!1 4 ,3 ) setd M dJ!4 in !" 4

return/$J!1

Figure 5.11

(12)

6 ADVERSARIAL SEARCH

function MINIMAX-DECISION( ) returns— inputs: , current state in game

dw MAX-VALUE(state)

return the in SUCCESSORS( 3 ) with valued function MAX-VALUE( ) returnsF!1 $J$ %˜dJ!4

if TERMINAL-TEST( ) then return UTILITY( )

dwC™

O

for4: in SUCCESSORS( 3 ) do

dw MAX(v, MIN-VALUE( )) returnd

function MIN-VALUE( 3 ) returnsx!1 $0 %˜dJ!4 if TERMINAL-TEST( ) then return UTILITY( )

dw

O

for4: in SUCCESSORS( 3 ) do

dw MIN(v, MAX-VALUE( )) returnd

Figure 6.4

12

(13)

function ALPHA-BETA-SEARCH( ) returns an action inputs: , current state in game

dw MAX-VALUE( ,™ O ,\ O )

return the in SUCCESSORS( 3 ) with valued function MAX-VALUE( ,š ,› ) returnsx!" $J$ %Fd!4

inputs: , current state in game

š , the value of the best alternative for MAXalong the path to

› , the value of the best alternative for MINalong the path to if TERMINAL-TEST( ) then return UTILITY( )

dwC™

O

for4: in SUCCESSORS( 3 ) do

dw MAX(v, MIN-VALUE( ,š ,› )) ifœžŸ› then returnd

š

MAX(š , v) returnd

function MIN-VALUE( 3 ,š ,› ) returnsF!1 $$ %˜d! inputs: , current state in game

š , the value of the best alternative for MAXalong the path to

› , the value of the best alternative for MINalong the path to if TERMINAL-TEST( ) then return UTILITY( )

dw~\

O

for4: in SUCCESSORS( 3 ) do

dw MIN(v, MAX-VALUE( ,š ,› )) ifœžj š then returnd

›

MIN(› , v) returnd

Figure 6.9

(14)

7 LOGICAL AGENTS

function KB-AGENT( ) returns an static:¡¢- , a knowledge base

, a counter, initially 0, indicating time TELL(¡¢- , MAKE-PERCEPT-SENTENCE( , ))

ASK(¡¢- , MAKE-ACTION-QUERY( )) TELL(¡¢- , MAKE-ACTION-SENTENCE( , ))

D + 1 return

Figure 7.2

function TT-ENTAILS?(¡¢- ,š ) returns !4 or/J

inputs:¡¢- , the knowledge base, a sentence in propositional logic

š , the query, a sentence in propositional logic

%6g 2

a list of the proposition symbols in¡¢- andš return TT-CHECK-ALL(¡N- ,š ,%6g ,`a)

function TT-CHECK-ALL(¡¢- ,š ,%6g ,6o=) returns !4 or/ if EMPTY?(%6g ) then

if PL-TRUE?(¡N- ,6o=) then return PL-TRUE?(š ,6o=) else return !4

else do

£

FIRST(%6g ); 4 REST(%6g )

return TT-CHECK-ALL(¡¢- ,š , , EXTEND(£ : !4e:6o=) and TT-CHECK-ALL(¡¢- ,š , , EXTEND(£ :0/J:6o=)

Figure 7.12

14

(15)

function PL-RESOLUTION(¡¢- ,š ) returns !4 or/

inputs:¡¢- , the knowledge base, a sentence in propositional logic

š , the query, a sentence in propositional logic

(!1B the set of clauses in the CNF representation of¡¢-_¤P¥9š

Yu¦

‰9Š

loop do

for each§ ’,§ “ in(!1 do

Jd4 B

PL-RESOLVE(§ ’,§ “ )

ifde4 contains the empty clause then return !4

Yu¦DYu—¨© de

ifYu«ª•(!1 then return/

!"<¬(!1?¨cYu

Figure 7.15

function PL-FC-ENTAILS?(¡¢- ,5 ) returns !4 or/

inputs:¡¢- , the knowledge base, a set of propositional Horn clauses

5 , the query, a proposition symbol

local variables: !14 , a table, indexed by clause, initially the number of premises

$/ =

, a table, indexed by symbol, each entry initially/J

+1= , a list of symbols, initially the symbols known to be true in¡¢- while+>=e is not empty do

­ POP(+1>= ) unless0/ = [ ] do

$/ =

[ ]C !4

for each Horn clause in whose premise appears do decrement!14 [ ]

if!" [ ] = 0 then do

if HEAD[ ] =5 then return !4 PUSH(HEAD[ ],+1>= ) return/

Figure 7.18

(16)

16 Chapter 7. Logical Agents

function DPLL-SATISFIABLE?( ) returns !4 or/ inputs: , a sentence in propositional logic

(!1B the set of clauses in the CNF representation of

%6g 2

a list of the proposition symbols in return DPLL(!1 , %6g J,`a)

function DPLL((!1 ,%6g ,6o=) returns ! or/J if every clause in(!1 is true in6o= then return !4 if some clause in!1 is false in6o= then return/J

®

,dJ!42 FIND-PURE-SYMBOL(%6gJ ,!",6o=)

if® is non-null then return DPLL((!1 , %6g J® , EXTEND(£ :dJ!4:6o=)

®

,dJ!42 FIND-UNIT-CLAUSE((!1 ,6o=)

if® is non-null then return DPLL((!1 , %6g J® , EXTEND(£ :dJ!4:6o=)

®

FIRST(%6g ); 4 REST(%6gJ)

return DPLL(!1 , , EXTEND(® , !4 ,6o=)) or DPLL(!1 , , EXTEND(® ,/ ,6o=))

Figure 7.21

function WALKSAT((!1, ,6oik ¯y ) returns a satisfying model or/$J!1 inputs:(!1 , a set of clauses in propositional logic

, the probability of choosing to do a “random walk” move, typically around 0.5

6oik ¯y

, number of flips allowed before giving up

6o=e a random assignment of !4 // to the symbols in(!1 for M z to6oik ¯y4 do

if6o= satisfies!1 then return6o=

!"2

a randomly selected clause from(!1 that is false in6o=

with probability flip the value in6o= of a randomly selected symbol from(!1 else flip whichever symbol in!1 maximizes the number of satisfied clauses return/$J!1

Figure 7.23

(17)

function PL-WUMPUS-AGENT( ) returns an inputs:4 , a list, [ >, , °i ,+e$ ]

static:¡¢- , a knowledge base, initially containing the “physics” of the wumpus world

k ,% ,34 3 , the agent’s position (initially 1,1) and orientation (initially(+, )

di$$ =

, an array indicating which squares have been visited, initially/ , the agent’s most recent action, initially null

( , an action sequence, initially empty updatek ,% ,4 ,di$$ = based on e if , then TELL(¡¢- ,±?²³´ ) else TELL(¡¢- ,¥—±]²³´ ) if °i then TELL(¡¢- ,µN²³´ ) else TELL(¡¢- ,¥—µ¢²³´ )

if+J$ then ­~+

else if4 is nonempty then POP(( )

else if for some fringe square [, ], ASK(¡¢- ,X¥ £ ’³“ ¤T¥—· ’³“ [) is !4 or for some fringe square [, ], ASK(¡¢- ,X£ ’³“¸ · ’³“ [) is/J then do

4 A*-GRAPH-SEARCH(ROUTE-PROBLEM([k ,% ],34 3 , [, ],di$$ = ))

e ­ POP(( )

else a randomly chosen move return

Figure 7.26

(18)

8 FIRST-ORDER LOGIC

18

(19)

function UNIFY(k ,% ,¹ ) returns a substitution to makek and% identical inputs:k , a variable, constant, list, or compound

% , a variable, constant, list, or compound

¹ , the substitution built up so far (optional, defaults to empty) if¹ = failure then return failure

else ifk =% then return¹

else if VARIABLE?(k ) then return UNIFY-VAR(k ,% ,¹ ) else if VARIABLE?(% ) then return UNIFY-VAR(% ,k ,¹ ) else if COMPOUND?(k ) and COMPOUND?(% ) then

return UNIFY(ARGS[k ], ARGS[% ], UNIFY(OP[k ], OP[% ],¹ )) else if LIST?(k ) and LIST?(% ) then

return UNIFY(REST[k ], REST[% ], UNIFY(FIRST[k ], FIRST[% ],¹ )) else return failure

function UNIFY-VAR(d ,k ,¹ ) returns a substitution inputs:d, a variable

k , any expression

¹ , the substitution built up so far if‰ dº1dŠ¦»7¹ then return UNIFY(d,k ,¹ ) else if‰¼ º"dŠ¦»7¹ then return UNIFY(d ,d,¹ ) else if OCCUR-CHECK?(d ,k ) then return failure else return add‰ d /k Š to¹

Figure 9.2

(20)

20 Chapter 9. Inference in First-Order Logic

function FOL-FC-ASK(¡N- ,š ) returns a substitution or/J inputs:¡¢- , the knowledge base, a set of first-order definite clauses

š , the query, an atomic sentence

local variables:>u , the new sentences inferred on each iteration repeat untilYu is empty

>u—

‰9Š

for each sentence in¡N- do

X

Œ<¤



¤ ‘•½

5[4 STANDARDIZE-APART( )

for each¹ such that SUBST(¹ , Œ ¤  ¤ ‘ ) = SUBST(¹ , |Œ ¤  ¤ ‘| ) for some |Œ ::I ‘| in¡N-

5 |

SUBST(¹ ,5 )

if5 | is not a renaming of some sentence already in¡¢- or>u then do add5 | toYu

¾

UNIFY(5 |,š ) if

¾

is not/$ then return

¾

addYu to¡¢- return/

Figure 9.5

function FOL-BC-ASK(¡¢- ,+J ,¹ ) returns a set of substitutions inputs:¡¢- , a knowledge base

+

, a list of conjuncts forming a query (¹ already applied)

¹ , the current substitution, initially the empty substitution‰9Š

local variables: 4uy, a set of substitutions, initially empty if+ is empty then return‰¹Š

5 |

SUBST(¹ , FIRST(+ ))

for each sentence in¡¢- where STANDARDIZE-APART( ) =X ŒP¤  ¤ ‘ž½À¿ [ and¹ | UNIFY(5 ,5 |) succeeds

>u +JB

` Œ ::I

‘BÁREST(+)a

4uyB FOL-BC-ASK(¡¢- ,Yu + , COMPOSE(¹ |,¹ ))¨Â4uy

returnuy

Figure 9.9

procedure APPEND(k ,% , ,4 $4! )

$ GLOBAL-TRAIL-POINTER()

ifk =`a and UNIFY(% , ) then CALL(4 $!4 ) RESET-TRAIL( $)

L NEW-VARIABLE(); NEW-VARIABLE();°y NEW-VARIABLE()

if UNIFY(ik , [k ]) and UNIFY( , [° ]) then APPEND(k ,% ,° , $4! )

Figure 9.12

(21)

procedure OTTER( ,!" )

inputs:, a set of support—clauses defining the problem (a global variable)

!"

, background knowledge potentially relevant to the problem repeat

clause the lightest member of

move(!1 from to!1

PROCESS(INFER((!1 ,!" ), ) until =`a or a refutation has been found function INFER((!1 ,!1 ) returns clauses

resolve(!1 with each member of!"

return the resulting clauses after applying FILTER

procedure PROCESS((!1 ,) for each(!1 in(!1 do

!"2

SIMPLIFY((!1 ) merge identical literals

discard clause if it is a tautology

< [(!1]

if(!1 has no literals then a refutation has been found if(!1 has one literal then look for unit refutation

Figure 9.19

(22)

10 KNOWLEDGE REPRESENTATION

22

(23)

Ä

$ X

)

X

§ Œ :

&"ÅLÆ

[

¤Ç) X

§ Ž :yÈ

Å2¡

[

¤Ç) X

£ Œ :

&"ÅwÆ

[

¤É) X

£ Ž

:yÈ

Å2¡

[

¤_Ê +4X

§vŒ

[

¤ŸÊ 3+X

§LŽ

[ ¤ ® YX

£ Œ[ ¤ ®

(YX

£ Ž [

¤¦)

$" XÈ

Å2¡

[

¤É) 0" X

&"ÅwÆ [[

Ë

X

)

X

§vŒ

:yÈ

Å2¡

[

¤É) X

§LŽ

:

&1ÅLÆ [[

)

2X

.

e=]X

…

:>Ì]:<†"[:

PRECOND:) X… :2†1[ ¤Ç) X(Ì]:<†"[

¤ˆÊ +X

… [ ¤ ® (>X(Ì[

¤Ç)

$" X†"[

EFFECT:¥¦) X… :2†"[ ¤ Ä 2X… :Ì[[

)

2XÍB4(=]X

…

:Ì]:2†"[:

PRECOND:Ä 2X… :>Ì[ ¤Ç) X(Ì]:<†1[

¤ˆÊ +X

… [ ¤ ® (YX(Ì>[

¤Ç)

$" X†"[

EFFECT:) X… :2†"[ ¤T¥

Ä

2X

…

:Ì[[

)

2X

Å %>X(Ì]:>/6P:y 3[:

PRECOND:) X(Ì?:/ 6c[

¤ ® (>X(Ì[

¤Ç)

$" X(/6V[

¤Ç)

$" XI [

EFFECT:¥¦) X(Ì]:>/6V[

¤É)

X(Ì]:y 3[[

Figure 11.3

(24)

24 Chapter 11. Planning

Ä

$ X

)

X

Å

( :

)

ki[

¤É) X

&

" :

l

!1'"[[

Ë

IX

)

X

&

"e:

)

k[[

)

2X

*

6odeeX

&

" :

l

!""'"[

, PRECOND:) X& " : l !1'"[

EFFECT:¥¦) X& " e: l !1"'[ ¤Ç) X& " : Ë !1>=[[

)

2X

*

6odeeX

Å

:

)

k[, PRECOND:) XÅ : ) ki[

EFFECT:¥¦) XÅ ( : ) k[ ¤Ç) XÅ ( :

Ë

!1>=[[

)

2X

®

!1

Æ

2X

&

" :

)

ki[,

PRECOND:) X & " : Ë !1>=4[ ¤É¥¦) XÅ ( : ) k[

EFFECT:¥¦) X& " :

Ë

!"=4[

¤É) X

&

" e:

)

k[[

)

2X

.

d

Æ

d4(+,

, PRECOND:

EFFECT:¥¦) X& " : Ë !"=4[ ¤T¥¦) X & " : ) ki[ ¤T¥¦) X& " : l !""'"[

¤;¥¦) X

Å

:

Ë

!"=4[

¤T¥¦) X

Å

:

)

ki[[

Figure 11.5

Ä

$ X

Æ

<XÎ:

l

[

¤ˆÆ 2X

µ : l i[

¤ˆÆ 2X

§ : l i[

¤É- ('>XÎN[

¤É- ('>X

µ [

¤É- ('>X

§ [

¤ˆÊ

"XÎN[

¤ŸÊ 1X

µ [

¤ˆÊ

"X

§

[[

Ë

X

Æ

2XÎ:

µ [

¤ˆÆ

<X

µ : § [[

)

2XÏÐdeX3Ñi:

¼ : – [:

PRECOND:Æ 2X3Ñi: ¼ [ ¤ŸÊ 1X3Ñ[ ¤ˆÊ "X– [ ¤É- '>X3Ñ[ ¤

X3Ñ{KM

¼ [ ¤ X3ÑKM

– [ ¤ X¼ KM

– [

,

EFFECT:Æ <X3Ñi: – [ ¤ˆÊ "X¼ [ ¤T¥_Æ 2X3Ñi: ¼ [ ¤É¥_Ê 1X– [[

)

2XÏÐde l l

X3Ñi:

¼

[:

PRECOND:Æ 2X3Ñi: ¼ [ ¤ŸÊ 1X3Ñ[ ¤É- ('>X3Ñ[ ¤ X3Ñ{KM ¼ [, EFFECT:Æ <X3Ñi: l [ ¤ŸÊ 1X¼ [ ¤T¥_Æ <X3Ñi: ¼ [[

Figure 11.7

(25)

) 2X

*

6odeeX

&

" :

l

!""'"[

, PRECOND:) X& " : l !1'"[

EFFECT:¥¦) X & " e: l !1"'[ ¤Ç) X & " : Ë !1>=[[

)

2X

*

6odeeX

Å

:

)

k[, PRECOND:) XÅ : ) ki[

EFFECT:¥¦) XÅ ( : ) k[ ¤Ç) XÅ ( : Ë !1>=[[

)

2X

®

!1

Æ

2X

&

" :

)

ki[,

PRECOND:) X& " : Ë !1>=4[ ¤É¥¦) XÅ ( : ) k[

EFFECT:¥¦) X& " :

Ë

!"=4[

¤Ç) X

&

" e:

)

ki[[

)

2X

.

d

Æ

d4(+,

, PRECOND:

EFFECT:¥¦) X& " : Ë !"=4[ ¤É¥¦) X& " : ) ki[ ¤T¥¦) X& " : l !""'"[

¤;¥¦) X

Å

:

Ë

!"=4[

¤T¥¦) X

Å

( :

)

ki[[

Figure 11.11

Ä

$ X

}

deeX

Ê

'i[[

Ë

X

}

dX

Ê

'[

¤ n 2X

Ê

i'i[[

)

2X

n

X

Ê

i'i[

PRECOND:} dX Ê '[

EFFECT:¥ } deX Ê 'ei[ ¤

n

2X

Ê

'e[)

)

2X

-

i'X

Ê

'[

PRECOND:¥ } dXÊ '[

EFFECT:} deX Ê 'ei[

Figure 11.16

function GRAPHPLAN(6 ) returns solution or failure

+e4,v

INITIAL-PLANNING-GRAPH(6 )

+<

GOALS[4 6 ] loop do

if+J all non-mutex in last level of+ 4, then do

!1

EXTRACT-SOLUTION(+e4, ,+ , LENGTH(+e, )) if!" ÐKM /$!1 then returnJ!1

else if NO-SOLUTION-POSSIBLE(+ 4, ) then return/$!1

+4,Ã EXPAND-GRAPH(+ 4, ,6 )

Figure 11.19

(26)

26 Chapter 11. Planning

function SATPLAN(6 ,l˜Ò2ÓÔ ) returns solution or failure inputs:6 , a planning problem

l˜Ò2ÓÔ

, an upper limit for plan length forl = 0 to l˜Ò2ÓÔ do

/ ,6o$1+Ã TRANSLATE-TO-SAT(6 ,l )

(+46g 4

SAT-SOLVER(/ ) if +46g4 is not null then

return EXTRACT-SOLUTION( (+e46g4 ,6o$+ ) return/$J!1

Figure 11.22

Références

Documents relatifs

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

Instead of trying to localize the original proof in the global case given in [13], we will exploit the non-homogeneous div–curl structure of the leading order vortex-stretching term,

All the same conclusions reached in this section with respect to the limits of groups of type 1 and the lower bound on diameter of the resulting space forms apply

the generic central sets is equivalent to the study of the Maxwell set in the space of smooth functions ([11])2. In this paper a further topological description

idea is to assume the existence of a cocommutative chain theory from topological spaces to coalgebras (which, by abuse of notation, we write as X** X). One then simply translates

This time, instead of k-vector spaces, we will deal with commutative k-AAU 3... The ambiant algebra is that of functions S → R with the ordinary pointwise

But the information used in the present work is scattered in studies written under different perspectives: we have historical accounts of algebraic topology as a whole [29], accounts

• Comments with my personal view to teach the key ideas of induction in version space.. • The outline follows the outline of