- 4


24.2

Prod([1, 2,3], [7,8,9], Res) X=1, Y=7, Xs=[2,3], Ys=[8,9], Res=S S=X*Y+Sp S=1*7+43=50
Prod([2,3],[8,9],Sp) X'=2, Y'=8, Xs'=[3], Ys'=[9], S=Sp Sp=X'*Y'+Sp' Sp=2*8+27=43
Prod([3],[9],Sp') X"=3, Y"=9, Xs"=[], Ys"=[], Sp=Sp' Sp'=X"*Y"+Sp" Sp'=3*9+0=27
Prod([],[],Sp") Xs"=[],Ys"=[], Sp"=0 Sp"=0

-, : , , , , . .

domains

Sp1, Sp= integer*

P, U, Z, Z1, N1, N, N2, X, F, P1, Q = integer

predicates

edit_list window(Sp, P) view_list(Sp)

make_list(Sp) delete_list(Sp)

process(X,Sp,P) insert_sort(Sp,Sp)

322

attent_windowcreate(N,Sp,Z)

list(Sp,integer) insert(integer,Sp,Sp) inversion(Sp,Sp)

split(integer,integer,Sp,Sp,Sp)connect(Sp,Sp,Sp)

add_list(Sp) goto(Sp,integer) prt(char,Sp)

qrt(char,Sp) delete(integer,Sp) sound1 sound2

goal

edit_list.

clauses

/*------------------------------------ ------------------------------------*/

edit_list:-window([],0).

window(Sp,P):-makewindow(1,31)7l"MEH

",0, 0, 25, 80), cursor(5,15),

write(" -1 "),cursor(7,15),

write(" POCMOTP - 2"),cursor(9,15),

write(" - 3"),cursor(11,15),

write(" - 4"),cursor( 13,15),

write(" -5"),cursor(15,15),

write("B - 6"),cursor(20,10),

write(" :"),sound1,

readint(X),sound(8, 2000), X

process(1 ,Sp,0):-make_list(Sp).