.


:




:

































 

 

 

 


23.4.




% ebg{ Goal, GeneralizedGoal, SufficientCondition;

SufficientCondition, % , , GeneralizedGoal, Goal, % . GeneralizedGoal

ebg (true, true, true):-!.

(Goal, GenGoai, GenGoal):-operational(GenGoal}, call) Goal).

ebg((Goall,Goal2), (Genl,Gen2), Cond}:-!, ebg (Goall, Gen]., Condi), ebg(Goal2, Gen2, Cond2), and{ Condi, Cond2, Cond). * Cond = (Condi,CondZ)

(Goal,Body)), % % [GenGoal,GenBody)

ebg(Goal, GenGoal, Cond):-not operational! Goal), clause! GenGoal, GenBody), copy_term([GenGoal,GenBody),

ebg(Body, GenBody, Cond).

% and(Condi, CondH, Cond)

I Cond Condi Cond2

(, )

and[ true, Cond, Cond):-!. % [true and Cond) <==> Cond

and[ Cond, true, Cond,-:-!. % (Cond and true) <==> Cond.

cffl*f Condi, - COTid-2-; - f ■ Coud /--}--.-............................................................................... -

. , , , Moves, , . (3, 6, Moves)

ebg :

?- Goal - { 3, 6, Moves), GenGoal - (Levell, LeveI2, GenMoves), ebg(Goal, GenGoal, Condition), asserta((GenGoal:- Condition)). Goal = got 3, 6, [ up, up, up]) GenGoal - go (Levell, Level2, (up, up, up]) Condition = (0+1 + 1 + 1=:= Level2 - Levell) Moves = [ up, up, up]



II. Prolog


, , :

go(Leveil, Level2, [ up. Up, up]):-0 + 1 + 1 + 1 =-:- Level2 - Level 1.

EBG , . (3, , Moves), (up) (down). (, (7, 10, Moves}) , - .

ebg, 23.4, , 23.1. copyterm. copy_term{ Term, Copy)

Term . , , . , .

ebg .

clause! GenGoal, GenBody)

, . , . : copy_term((GenGoal, GenBody), I Goal, Body))

, GenGoal Goal . GenGoai, . , , , (), (Goal). . EBG , GenGoai, Goal. .

, . , KBG "" . , "" . . : -, , , -, , , , , ,


23.



. EBG , .

23.3. , , EBG, , , , , . ( "" ). EBG , . , , , EBG, ( ).





:


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


:

:

, .
==> ...

1561 - | 1440 -


© 2015-2024 lektsii.org - -

: 0.008 .