. , , ,

,,,

- " " Prolog — ,

CODE=12050

/* **************************

* ߠ *

* *

* ࠠ ࠠ *

* *

**************************

*/

domains

z,i,n,n1,n,no,dat,datv=integer

gor,fio,se,j=symbol

database -svod1

svod1(n,j,dat,gor,se,no,datv)

database -lolo

lolo(n,fio,dat,gor,j,no,datv)

database -kuku

kuku(n,fio,dat,gor,se,i,datv)

database-svod

svod(n,fio,dat,gor,se,no,datv)

predicates

start

patch

load

select(i)

sel(i,i)

process(i)

procedure(i)

sve(i)

lod(i)

repeat

goal

start.

clauses

/* */

start:-

makewindow(1,2,7," ",0,0,25,80),

clearwindow,

load,

patch.

/* */

patch:-

repeat,

cursor(7,0),

write(" 0 - pp... "),nl,

write(" 1 - "),nl,

write(" 2 - "),nl,

write(" 3 - "),nl,

write(" 4 - "),nl,

write(" 5 - "),nl,

write(" 6 - "),nl,

write(" 7 - "),nl,

write(" 8 - -"),nl,

write(" 9 - "),nl,

write(" =>"),

readint(Choice),

Choice >= 0,

Choice < 10,

clearwindow,

process(Choice),

clearwindow,

Choice = 9,

retractall(_),

removewindow.

/* */

load:-

existfile("mak.dat"),

consult("mak.dat"),

cursor(1,2),

write(" ").

load:-

cursor(1,2),

write(" ").

/*pp */

process(7):-

makewindow(1,2,7," ",0,0,25,80),

nl,

write(" 𠠠 :"),readint(K),nl,

write(" , :"),readln(O),nl,

write(" , :"),readint(I),nl,

write(" :"),readln(Y),nl,

write(" :"),readln(T),nl,

write(" :"),readint(V),nl,

write(" (,,):"),readint(A),nl,

N1=K,FIO1=O,DAT1=I,GOR1=Y,SE1=T,NO1=V,DATV1=A,

assertz(svod(N1,FIO1,DAT1,GOR1,SE1,NO1,DATV1)),

removewindow,

fail.

/* -*/

process(8):-

makewindow(1,2,7,"-",0,0,25,80),

nl,

write(" :"),readint(A),nl,nl,

svod(N,FIO,DAT,GOR,SE,NO,DATV),

A=N,

write(" 蠠 :"),write(A),nl,

write(",, :"),write(FIO),nl,

write(",, :"),write(DAT),nl,

write(" :"),write(GOR),nl,

write(" :"),write(SE),nl,

write(" :"),write(NO),nl,

write(" (,,):"),write(DATV),nl,nl,nl,nl,nl,

write(" "),

readchar(_),

removewindow,

!.

process(8):-

write(" "),nl,nl,nl,

write(" ."),

write(" :"),

readint(A),nl,

A=N1,

write(" , :"),readln(F),nl,

write(" , :"),readint(Y),nl,

write(" :"),readln(J),nl,

write(" :"),readln(G),nl,

write(" :"),readint(E),nl,

write(" (,,):"),readint(Z),nl,

FIO1=F,DAT1=Y,GOR1=J,SE1=G,NO1=E,DATV1=Z,

assertz(svod(N1,FIO1,DAT1,GOR1,SE1,NO1,DATV1)),

removewindow,

fail.

/*pp pp*/

process(0):-

makewindow(1,2,7," pp...",0,0,25,80),

write(" p-p "),nl,nl,

write(" "),nl,nl,

write(" -TURBO-PROLOG v.2.0. "),nl,nl,

write(" p:o . "),nl,nl,

write(" , p.-1-94 () 1995 . "),nl,nl,nl,nl,

write(" "),

readchar(_),

removewindow.

/* */

process(1):-

makewindow(1,2,7,"pp ",0,0,25,80),

nl,

select(N),

X=N,

svod(X,FIO,DAT,GOR,SE,NO,DATV),

write(" 蠠 :"),write(N),nl,

write(",, :"),write(FIO),nl,

write(",, :"),write(DAT),nl,

write(" :"),write(GOR),nl,

write(" :"),write(SE),nl,

write(" :"),write(NO),nl,

write(" (,,):"),write(DATV),nl,nl,nl,nl,nl,

nl,

write(" , :"),readln(FIO1),nl,

write(" , :"),readint(DAT1),nl,

write(" :"),readln(GOR1),nl,

write(" :"),readln(SE1),nl,

write(" :"),readint(NO1),nl,

write(" (,,):"),readint(DATV1),nl,

X1=X,

retract(svod(X,FIO,DAT,GOR,SE,NO,DATV)),

assert(svod(X1,FIO1,DAT1,GOR1,SE1,NO1,DATV1)),

!,

removewindow.

/* */

process(2):-

makewindow(1,2,7," ",0,0,25,80),

nl,

select(N),

X=N,

svod(X,FIO,DAT,GOR,SE,NO,DATV),

retract(svod(X,FIO,DAT,GOR,SE,NO,DATV)),!,

removewindow.

/* */

process(3):-

makewindow(1,2,7,"p ",0,0,25,80),

nl,

write("____________________________________________________________________________!"),

write(" Š Š "),

nl,

write("----------------------------------------------------------------------------!"),

nl,

write("!! .. ! , ! ! ! 蠠 !"),

nl,

write("! ! !,,! !!!,,!"),

nl,

write("-----------------------------------------------------------------------------"),

nl,

svod(N,FIO,DAT,GOR,SE,NO,DATV),

cursor(Z,_),

cursor(Z,0),write(N),

cursor(Z,7),write(FIO),

cursor(Z,25),write(DAT),

cursor(Z,41),write(GOR),

cursor(Z,49),write(SE),

cursor(Z,55),write(NO),

cursor(Z,61),write(DATV),

cursor(Z,76),write("!"),

nl,

fail.

process(3):-

write("-----------------------------------------------------------------------------"),

nl,

write(" "),

readchar(_),

removewindow.

/* */

process(4):-

nl,

makewindow(2,15,4,"",5,5,20,70),

write("1 - "),nl,

write("2 - mak.dat"),nl,

write("3 - "),nl,

write("==>"),

readint(C),

C>0,C<4,

lod(C),

!,

removewindow.

/* */

process(5):-

nl,

makewindow(2,15,4,"",5,5,20,70),

write("1 - "),nl,

write("2 - mak.dat"),nl,

write("3 - "),nl,

write("==>"),

readint(I),

I>0,I<4,

sve(I),!,

removewindow.

/* */

process(6):-

nl,

makewindow(3,2,7," ",0,0,25,80),

write("1 - , "),nl,

write("2 - "),nl,

write("3 - "),nl,

write("4 - "),nl,

write("==>"),

readint(O),

O>0,O<5,

procedure(O),

removewindow.

process(_).

/* */

procedure(1):-

makewindow(1,2,7," , ",0,0,25,80),

nl,

cursor(7,10),

retractall(_,svod1),

nl,

write(" , "),

nl,

write(" , :"),

readln(X),

svod(N,FIO,DAT,GOR,SE,NO,DATV),

S=FIO,

S=X,

N1=N,DAT1=DAT,GOR1=GOR,SE1=SE,NO1=NO,DATV1=DATV,

assert(svod1(N1,S,DAT1,GOR1,SE1,NO1,DATV1)),

fail.

procedure(1):-

write(" "),nl,

write("____________________________________________________________________________!"),

write(" Š Š "),

nl,

write("----------------------------------------------------------------------------!"),

nl,

write("!! .. ! , ! ! ! 蠠 !"),

nl,

write("! ! !,,! !!!,,!"),

nl,

write("-----------------------------------------------------------------------------"),

nl,

svod(N,S,DAT,GOR,SE,NO,DATV),

cursor(Z,_),

cursor(Z,0),write(N),

cursor(Z,7),write(S),

cursor(Z,25),write(DAT),

cursor(Z,41),write(GOR),

cursor(Z,49),write(SE),

cursor(Z,55),write(NO),

cursor(Z,61),write(DATV),

cursor(Z,76),write("!"),

nl,

fail.

procedure(1):-

write("-----------------------------------------------------------------------------"),

save("nov.dat",svod1),

nl,

write(" nov.dat"),

nl,

write(" "),

readchar(_),

removewindow,

!.

procedure(1):-

write("-----------------------------------------------------------------------------"),

nl,

write(" "),

nl,

write(" "),

readchar(_),

makewindow(1,2,7," ",0,0,25,80).

procedure(2):-

makewindow(1,2,7," ",0,0,25,80),

nl,

cursor(7,10),

retractall(_,lolo),

nl,

write(" , "),nl,

write(" :"),

readln(X),

svod(N,FIO,DAT,GOR,SE,NO,DATV),

S=SE,

S=X,

N1=N,FIO1=FIO,DAT1=DAT,GOR1=GOR,NO1=NO,DATV1=DATV,

assert(lolo(N1,FIO1,DAT1,GOR1,S,NO1,DATV1)),

fail.

procedure(2):-

write(" "),nl,

write("____________________________________________________________________________!"),

write(" Š Š "),

nl,

write("----------------------------------------------------------------------------!"),

nl,

write("!! .. ! , ! ! ! 蠠 !"),

nl,

write("! ! !,,! !!!,,!"),

nl,

write("-----------------------------------------------------------------------------"),

nl,

svod(N,FIO,DAT,GOR,S,NO,DATV),

cursor(Z,_),

cursor(Z,0),write(N),

cursor(Z,7),write(FIO),

cursor(Z,25),write(DAT),

cursor(Z,41),write(GOR),

cursor(Z,49),write(S),

cursor(Z,55),write(NO),

cursor(Z,61),write(DATV),

cursor(Z,76),write("!"),

nl,

fail.

procedure(2):-

write("-----------------------------------------------------------------------------"),

save("nov1.dat",lolo),

nl,

write(" nov1.dat"),

nl,

write(" "),

readchar(_),

removewindow,

!.

procedure(2):-

write("-----------------------------------------------------------------------------"),

nl,

write(" "),

nl,

write(" "),

readchar(_),

makewindow(1,2,7," ",0,0,25,80).

procedure(3):-

makewindow(1,2,7," ",0,0,25,80),

nl,

cursor(7,10),

retractall(_,kuku),

nl,

write(" , "),

nl,

write(" :"),

readint(X),

svod(N,FIO,DAT,GOR,SE,NO,DATV),

S=NO,

S=X,

N1=N,FIO1=FIO,DAT1=DAT,GOR1=GOR,SE1=SE,DATV1=DATV,

assert(kuku(N1,FIO1,DAT1,GOR1,SE1,S,DATV1)),

fail.

procedure(3):-

write(" "),nl,

write("____________________________________________________________________________!"),

write(" Š Š "),

nl,

write("----------------------------------------------------------------------------!"),

nl,

write("!! .. ! , ! ! ! 蠠 !"),

nl,

write("! ! !,,! !!!,,!"),

nl,

write("-----------------------------------------------------------------------------"),

nl,

svod(N,FIO,DAT,GOR,SE,S,DATV),

cursor(Z,_),

cursor(Z,0),write(N),

cursor(Z,7),write(FIO),

cursor(Z,25),write(DAT),

cursor(Z,41),write(GOR),

cursor(Z,49),write(SE),

cursor(Z,55),write(S),

cursor(Z,61),write(DATV),

cursor(Z,76),write("!"),

nl,

fail.

procedure(3):-

write("-----------------------------------------------------------------------------"),

save("nov2.dat",kuku),

nl,

write(" nov2.dat"),

nl,

write(" "),

readchar(_),

removewindow,

!.

procedure(3):-

write("-----------------------------------------------------------------------------"),

nl,

write(" "),

nl,

write(" "),

readchar(_),

makewindow(1,2,7," ",0,0,25,80).

/* */

sve(1):-

write(" :"),

readln(N),

save(N),

write(" "),

beep,

!.

sve(1):-

write(" , "),

readchar(_).

sve(2):-

save("mak.dat").

sve(3).

/* */

lod(1):-

retractall(_),

write(" :"),

readln(N),

existfile(N),

consult(N),

write(" "),

beep,

!.

lod(1):-

nl,

write(" "),nl,

write(" "),

readchar(_).

lod(2):-

retractall(_),

existfile("mak.dat"),

consult("mak.dat"),

write(" "),

beep,

!.

lod(2):-

write(" mak.dat "),nl,

write(" "),

readchar(_).

lod(3).

repeat.

repeat:- repeat.

/* */

select(N):-

nl,

write("1 - "),nl,

write("2 - ,, "),nl,

write("3 - ,, "),nl,

write("4 - "),nl,

write("5 - "),nl,

write("6 - "),nl,

write("7 - (,,)"),nl,

write("==>"),

readint(X),

sel(X,N).

sel(1,N):-

nl,

write(" 蠠 :"),

readint(N),

svod(M,_,_,_,_,_,_),

M=N.

sel(1,N):-

N=0.

sel(2,N):-

nl,

write(" ,, :"),

readln(L),

svod(Z,L,_,_,_,_,_),

N=Z.

sel(2,N):-

N=0.

sel(3,N):-

nl,

write(" ,, : "),

readint(F),

svod(Z,_,F,_,_,_,_),

N=Z.

sel(3,N):-

N=0.

sel(4,N):-

nl,

write(" :"),

readln(Q),

svod(Z,_,_,Q,_,_,_),

N=Z.

sel(4,N):-

N=0.

sel(5,N):-

nl,

write(" :"),

readln(W),

svod(Z,_,_,_,W,_,_),

N=Z.

sel(5,N):-

N=0.

sel(6,N):-

nl,

write(" :"),

readint(E),

svod(Z,_,_,_,_,E,_),

N=Z.

sel(6,N):-

N=0.

sel(7,N):-

nl,

write(" (,,):"),

readint(A),

svod(Z,_,_,_,_,_,A),

N=Z.

sel(7,N):-

N=0.

CODE=12050 /* ************************** * ߠ * * * * ࠠ ࠠ * * * ***************

 

 

 

! , , , .
. , :