.


:




:

































 

 

 

 





, . , . , -



II. Prolog


. , , , . .

, . 17.1. , Start - . 17.1. : planC Start, [ (a, b), on (, )], Plan, _)

, , .

Plan - [ move , 3, ),

move! b, , 3),

move (, a, 2),

movet a, 1, b),

move [ a, b, 1),

movet b, 3, ),

mqve[ a, 1, b)]

, , , ! . , . , , , .

< b, 3, ), (, )

move(, , >, clear [ )

Bovef , , 2), clear [ )

move (, 1, ) movet , 1, ), on i , ) move< a, 1), clear(bj

move (b, 3, ) move(b, 3, ), on (, ) () movet , 1, , on(ar b) ()

, , . , on (b, ), , , on (a, b). on [ b, ). , on { ). , on (, on (, ). :

plant Start, [ Clear; 2), clear (3) ], Plan, _)

.

itewi , 3, 2J, clear< 3}

movet , 2, 3>, clear(2

move! b, 3, 2), clear 3

move (b, 2 3), clear(2)

. , , b 2 3 .

, . ,


17.



, . plan, : plant State, Goals, ProtectedGoals, Plan, FinalState)

ProtectedGoals - , "" Plan. , Plan ProtectedGoals. . , 17.4, (. 17,3) . 2 3 , :

move) , 3, 2), clear (3} move! b, 2, 4), clear (2) clear (3)

17.4. , . satisfied.select, achieves apply 17.3

, %

plan{ InitialState, Goals, Plan, FinalState}:-plan! InitialState, Goals, [], Plan, FinalState).

% plan(InitialState, Goals, ProtectedGoals, Plan, FinalState):

Goals FinalState, Plan

plan[ State, Goals, _, [], State):-

satisfiedt State, Goals). % Goals

% State

plant State, Goals, Protected, Plan, FinalState*:-

conct Preplan, [Action PostPlan], Plan), %

select(State, Goals, Goal), %

achieves! Action, Goal),

can(Action, Condition),

preserves | Action, Protected), % He

plant State, Condition, Protected, Preplan, MidStatel),

apply; Midstatel, Action, MidState2),

planf Midstate2, Goals, [Goal Protected], PostPlan, FinalState).

% preserves Action, Goals):

% Action Goals

preserves(Action, Goals):- % Action Goals deletes (Action, Relations), not [member! Goal, Relations), member(Goal, Goals]),

, , , , - move (, 3, 4).

, . . .



I I. Prolog






:


: 2015-10-01; !; : 501 |


:

:

,
==> ...

1690 - | 1627 -


© 2015-2024 lektsii.org - -

: 0.01 .