-


- - . 13



%p
p :
d - ( );
u - ;
s - ( );
c - ( );
g - ;
e - ;
f - ( );
x - ( ).
3.3.
5. , .
domains
i=integer
predicates
process(i)
cube
clauses
cube:- write("Next number,please:"), readint(X), process(X).
process(N):- C=N*N*N, write("Cube",N,"is equal",C,"\n"), cube.
goal
cube.
6.
domains
list=integer*
predicates
readlist(list)
goal
readlist(TheList),write("\n The list is: ", TheList).
clauses
readlist([H|T]):-readint(H),!,readlist(T). readlist([]).
ENTER. ,
, ENTER.
7.
domains
i_list=integer*
n_list=symbol*
predicates
writelist(i_list)
writelist(n_list)
clauses
writelist([]).
writelist([H|T]):- write(H," "),writelist(T).
3.4. .
-:
1.concat(Str1,Str2,Str1_2) - , Str1_2 - Str1 Str2;
.
2.frontchar(Str1_2,Char,Str2) - :



- -  - -  - -