%code = 12850
domains
z,i,n,n1,kol,tkol = integer
prod,town,nazvanie,j,str = string
index = real
database -svod1
svod1(n,j,kol,tkol,town,index,nazvanie)
database -lolo
lolo(n,prod,kol,i,town,index,nazvanie)
database -kuku
kuku(n,prod,kol,tkol,town,index,nazvanie)
database
svod(n,prod,kol,tkol,town,index,nazvanie)
predicates
start
patch
load
select(i)
sel(i,i)
process(i)
procedure(i)
skip(string,string,string)
skip1(string,integer,integer)
skip2(string,real,real)
sve(i)
lod(i)
repeat
goal
start.
clauses
/* E BMBEEE EE L*/ start:-
makewindow(1,2,7,"A E",0,0,25,80),
clearwindow,
load,
patch.
/* E BM EE*/
patch:-
repeat,
cursor(7,0),
write("
0 - EBpE... "),nl,
write("
1 - E L"),nl,
write("
2 - L"),nl,
write("
3 - EBE "),nl,
write("
4 - E "),nl,
write("
5 - "),nl,
write("
6 - ME"),nl,
write("
7 - C MEL"),nl,
write("
8 - EBE-"),nl,
write("
9 - E EBEE),nl,
write("
=>"),
readint(Choice),
Choice >= 0,
Choice < 10,
clearwindow,
process(Choice), clearwindow,
Choice = 9,
retractall(_),
removewindow.
/* EE EE EE L*/
load:-
existfile("kot.dat"),
consult("kot.dat"),
cursor(1,2), write("EE).
load:-
cursor(1,2),
write(" E).
/*pGpECEMEL*/
process(7):-
makewindow(1,2,7,"EMEL",0,0,25,80),
nl,
write(" EEA MEE :"),readint(K),nl,
write(" A :"),readln(O),nl,
write(" EE E
:"),readint(I),nl,
write(" EEEE :"),readint(Y),nl,
write(" AC :"),readln(T),nl,
write(" HEE :"),readreal(V),nl,
write(" GEEEE
:"),readln(A),nl,
N1=K,PROD1=O,KOL1=I,TKOL1=Y,TOWN1=T,INDEX1=V,NAZVANIE1=A,
assertz(svod(N1,PROD1,KOL1,TKOL1,TOWN1,INDEX1,NAZVANIE1)),
removewindow,
fail.
/* EBEEE*/ process(8):-
makewindow(1,2,7,"CE",0,0,25,80), nl, write(" MEEE:"),readint(A),nl,nl,
svod(N,PROD,KOL,TKOL,TOWN,INDEX,NAZVANIE), A=N,
write("K
E
:"),write(A),nl, write("EMGE
:"),write(PROD),nl, write("JE E :"),write(KOL),nl, write("D EE :"),write(TKOL),nl, write("AC
:"),write(TOWN),nl, write("HEE
:"),write(INDEX),nl, write("GEEEE
:"),write(NAZVANIE),nl,nl,nl,nl,nl, write("E E EE), readchar(_), removewindow, !. process(8):- write("M ME E DEE."), write("EE E EEEMEE),nl,nl,nl, write(" E E"), readint(A),nl, A=N1, write(" A
:"),readln(F),nl, write(" EE E
:"),readint(Y),nl, write(" EEEE
:"),readint(J),nl, write(" AC :"),readln(G),nl, write(" HEE
:"),readreal(E),nl, write(" GEEEE :"),readln(Z),nl,
PROD1=F,KOL1=Y,TKOL1=J,TOWN1=G,INDEX1=E,NAZVANIE1=Z,
assertz(svod(N1,PROD1,KOL1,TKOL1,TOWN1,INDEX1,NAZVANIE1)), removewindow. % fail.
/*pGpE L EEBpE*/ process(0):-
makewindow(1,2,7," EBpE...",0,0,25,80), write("
"),nl,nl, write("
"),nl,nl, write(" EEBEAE
: EE"),nl, write(" A
: EEEE "),nl, write(" PE
: "),nl, write(" EE
: -1-95 "),nl, write("E E EE), readchar(_), removewindow.
/* EDG BEEE L*/
process(1):-
makewindow(1,2,7,"p L",0,0,25,80),
nl,
select(N),
X=N,
svod(X,PROD,KOL,TKOL,TOWN,INDEX,NAZVANIE),
write("K E
:"),write(N),nl,
write("EMGE :"),write(PROD),nl,
write("JE E:"),write(KOL),nl,
write("D EE :"),write(TKOL),nl,
write("AC
:"),write(TOWN),nl,
write("HEE
:"),write(INDEX),nl,
write("GEEEE :"),write(NAZVANIE),nl,
nl,
write(" A :"),readln(PROD1),
write(" EE E :"),readln(KOL1),
write(" EEEE :"),readln(TKOL1),
write(" AC
:"),readln(TOWN1),
write(" HEE :"),readln(INDEX1),
write(" GEEEE
:"),readln(NAZVANIE1),
X1=X,
retract(svod(X,PROD,KOL,TKOL,TOWN,INDEX,NAZVANIE)),
skip(PROD1,PROD,PROD2), skip(TOWN1,TOWN,TOWN2),
skip(NAZVANIE1,NAZVANIE,NAZVANIE2),
skip1(KOL1,KOL,KOL2),
skip1(TKOL1,TKOL,TKOL2),
skip2(INDEX1,INDEX,INDEX2),
assert(svod(X1,PROD2,KOL2,TKOL2,TOWN2,INDEX2,NAZVANIE2)),
!,
removewindow.
/* E EE L*/
process(2):-
makewindow(1,2,7,"EGEEE,0,0,25,80),
nl,
select(N),
X=N,
svod(X,PROD,KOL,TKOL,TOWN,INDEX,NAZVANIE),
retract(svod(X,PROD,KOL,TKOL,TOWN,INDEX,NAZVANIE)),!,
write("EE),nl,
write("E E EE),
readchar(_),
removewindow.
/* EBEEBE L*/
process(3):-
makewindow(1,2,7,"Cp ",0,0,25,80),
nl,
write("ͻ"),nl,
write("
A E
"),nl,
write("
"),nl,
write("͹"),nl,
write("

"),nl,
write("ME庁EE
EE
"),nl,
write("
͹"),nl,
write("


EA "),nl,
write(" E庁EE E E EEE"),nl,
write("ͺ͹͹"),nl,
write("


"),nl,
svod(N,PROD,KOL,TKOL,TOWN,INDEX,NAZVANIE),
cursor(Z,_),
cursor(Z,0),write(""),
cursor(Z,2),write(N),
cursor(Z,7),write(PROD),
cursor(Z,18),write(KOL),
cursor(Z,23),write(TKOL),
cursor(Z,33),write(TOWN),
cursor(Z,55),write(INDEX),
cursor(Z,67),write(NAZVANIE),
cursor(Z,76),write(""),
nl,
fail.
process(3):-
write(""),
nl,
write("E E EE),
readchar(_),
removewindow.
/* E EEE L*/
process(4):-
nl,
makewindow(2,15,4,"E,5,5,20,70),
write("1 - EEE M E),nl,
write("2 - EEE Ekot.dat"),nl,
write("3 - C EBMD EE"),nl,
write("==>"),
readint(C),
C>0,C<4,
lod(C),
!,
removewindow.
/* E L*/
process(5):-
nl,
makewindow(2,15,4,"E,5,5,20,70),
write("1 - EEE EZE"),nl,
write("2 - EEE E kot.dat"),nl,
write("3 - C EBMD EE"),nl,
write("==>"), readint(I),
I>0,I<4,
sve(I),!,
removewindow.
/* E
ME*/
process(6):-
nl,
makewindow(3,2,7,"FGEME",0,0,25,80),
write("1 - EEEE AE "),nl,
write("2 - EEEE EE EE"),nl,
write("3 - EEEE L EEE"),nl,
write("4 - C EBMD EE"),nl,
write("==>"),
readint(O),
O>0,O<5,
procedure(O),
removewindow.
process(_).
/* E ME L E E*/
procedure(1):-
makewindow(1,2,7,"FGEME E AE ",0,0,25,80),
nl,
cursor(7,10),
retractall(_,svod1),
nl,
write("E L EA , "),
nl,
write(" A :"),
readln(X),
svod(N,PROD,KOL,TKOL,TOWN,INDEX,NAZVANIE),
S=PROD,
S=X,
N1=N,KOL1=KOL,TKOL1=TKOL,TOWN1=TOWN,INDEX1=INDEX,NAZVANIE1=NAZVANIE,
assertz(svod1(N1,S,KOL1,TKOL1,TOWN1,INDEX1,NAZVANIE1)),
fail.
procedure(1):-
write("EE),nl,
write("ͻ"),nl,
write("
A E
"),nl,
write("
"),nl,
write("͹"),nl,
write("

"),nl,
write("ME庁EE
EE
"),nl,
write("
͹"),nl,
write("


EA "),nl,
write(" E庁EE E E EEE"),nl,
write("ͺ͹͹"),nl,
write("


"),nl,
nl,
svod1(N,S,KOL,TKOL,TOWN,INDEX,NAZVANIE),
N1=N,
cursor(Z,_),
cursor(Z,2),write(N1),
cursor(Z,7),write(S),
cursor(Z,18),write(KOL),
cursor(Z,23),write(TKOL),
cursor(Z,33),write(TOWN),
cursor(Z,55),write(INDEX),
cursor(Z,67),write(NAZVANIE),
cursor(Z,77),write(""),
nl,
fail. procedure(1):-
write(""),
save("now.dat",svod1),
nl,
write("EEEEnow.dat"),
nl,
write("E E EE),
readchar(_),
removewindow,
!.
procedure(1):-
write(""),
nl,
write("FEEER "),
nl,
write("E E EE),
readchar(_),
makewindow(1,2,7,"A E",0,0,25,80).
procedure(2):-
makewindow(1,2,7,"FGEME E EE EE",0,0,25,80), nl,
cursor(7,10),
retractall(_,lolo),
nl,
write("E L EJE EEEE , "),nl,
write(" EME E EE:"),
readint(X),
svod(N,PROD,KOL,TKOL,TOWN,INDEX,NAZVANIE),
S=TKOL,
S>=X,
N1=N,PROD1=PROD,KOL1=KOL,TOWN1=TOWN,INDEX1=INDEX,NAZVANIE1=NAZVANIE,
assert(lolo(N1,PROD1,KOL1,S,TOWN1,INDEX1,NAZVANIE1)),
fail.
procedure(2):-
write("ͻ"),nl,
write("
A E
"),nl,
write("
"),nl,
write("͹"),nl,
write("

"),nl,
write("ME庁EE
EE
"),nl,
write("
͹"),nl,
write("

EA "),nl,
write(" E庁EE E E EEE"),nl,
write("ͺ͹͹"),nl,
write("


"),nl,
lolo(N,PROD,KOL,S,TOWN,INDEX,NAZVANIE),
N1=N,
cursor(Z,_),
cursor(Z,0),write(""),
cursor(Z,3),write(N1),
cursor(Z,7),write(PROD),
cursor(Z,18),write(KOL),
cursor(Z,23),write(S),
cursor(Z,33),write(TOWN),
cursor(Z,55),write(INDEX),
cursor(Z,67),write(NAZVANIE),
cursor(Z,76),write(""),
nl,
fail.
procedure(2):-
write(""),
save("now1.dat",lolo),
nl,
write("EEEEnow1.dat"),
nl,
write("E E EE),
readchar(_),
removewindow,
!.
procedure(2):-
write(""),
nl,
write("FEEER "),
nl,
write("E E EE),
readchar(_),
makewindow(1,2,7,"A E",0,0,25,80).
procedure(3):-
makewindow(1,2,7,"FGE L E L EEE",0,0,25,80),
nl,
cursor(7,10),
retractall(_,kuku),
nl,
write("E L E E L EEE , "),
nl,
write(" L EEE:"),
readln(X),
readint(Y),
readln(Z),
svod(N,PROD,KOL,TKOL,TOWN,INDEX,NAZVANIE),
S=TOWN,
D=INDEX,
C=NAZVANIE,
S=X,
D=Y,
C=Z,
N1=N,PROD1=PROD,KOL1=KOL,TKOL1=TKOL,
assert(kuku(N1,PROD1,KOL1,TKOL1,S,D,C)),
fail.
procedure(3):-
write("EE),nl,
write("ͻ"),nl,
write("
A E
"),nl,
write("
"),nl,
write("͹"),nl,
write("

"),nl,
write("ME庁EE
EE
"),nl, write("
͹"),nl,
write("


EA "),nl,
write(" E庁EE E E EEE"),nl,
write("ͺ͹͹"),nl,
write("


"),nl,
kuku(N,PROD,KOL,TKOL,S,D,C),
N1=N,
cursor(Z,_),
cursor(Z,0),write(""),
cursor(Z,3),write(N1),
cursor(Z,7),write(PROD),
cursor(Z,18),write(KOL),
cursor(Z,23),write(TKOL), cursor(Z,33),write(S),
cursor(Z,55),write(D),
cursor(Z,67),write(C),
cursor(Z,77),write(""),
nl,
fail.
procedure(3):-
write(""),
save("now2.dat",svod1),
nl,
write("EEEEnow2.dat"),
nl,
write("E E EE),
readchar(_),
removewindow, !.
procedure(3):-
write(""),
nl,
write("FEEER "),
nl,
write("E E EE), readchar(_),
makewindow(1,2,7,"A E",0,0,25,80).
/* E */
sve(1):-
write(" E:"),
readln(N),
save(N),
write(" EEEE),
beep, !.
sve(1):-
write("E@E, EE EE),
readchar(_).
sve(2):-
save("kot.dat"),
write("EE).
sve(3).
/* E EE/
lod(1):-
retractall(_),
write(" E:"),
readln(N),
existfile(N),
consult(N),
write(" EEEE),
beep,
!.
lod(1):-
nl,
write("M EDE E),nl,
write("E E EE),
readchar(_).
lod(2):-
retractall(_),
existfile("kot.dat"),
consult("kot.dat"),
write(" EEEE),
beep,
!.
lod(2):-
write("E kot.dat DE E),nl,
write("EE EE),
readchar(_).
lod(3).
repeat.
repeat:- repeat.
/*A E*/
select(N):-
nl,
write("1 - MEEE"),nl,
write("2 - M A "),nl,
write("3 - M EE E"),nl,
write("4 - M EEEE"),nl,
write("5 - AC"),nl,
write("6 - HEE"),nl,
write("7 - M GEEEE"),nl,
write("==>"),
readint(X),
sel(X,N).
sel(1,N):-
nl,
write(" MEEE
:"),
readint(N),
svod(M,_,_,_,_,_,_),
M=N.
sel(1,N):-
N=0.
sel(2,N):-
nl,
write(" A :"),
readln(L),
svod(Z,L,_,_,_,_,_),
N=Z.
sel(2,N):-
N=0.
sel(3,N):-
nl,
write(" EE E: "),
readint(F),
svod(Z,_,F,_,_,_,_),
N=Z.
sel(3,N):-
N=0.
sel(4,N):-
nl,
write(" EEEE:"),
readint(Q),
svod(Z,_,_,Q,_,_,_),
N=Z.
sel(4,N):-
N=0.
sel(5,N):-
nl,
write(" AC:"),
readln(W),
svod(Z,_,_,_,W,_,_),
N=Z.
sel(5,N):-
N=0.
sel(6,N):-
nl,
write(" HECE"),
readreal(E),
svod(Z,_,_,_,_,E,_),
N=Z.
sel(6,N):-
N=0.
sel(7,N):-
nl,
write(" GEEEE:"),
readln(A),
svod(Z,_,_,_,_,_,A),
N=Z.
sel(7,N):-
N=0.
skip("",Fam,Fam2):-
Fam2=Fam,
!.
skip(Fam1,_,Fam2):-
Fam2=Fam1,
!.
skip1("",Fam,Fam2):-
Fam2=Fam,
!.
skip1(Fam1,_,Fam2):-
str_int(Fam1,Fam3),
Fam2=Fam3,
!.
skip2("",Fam,Fam2):-
Fam2=Fam,
!.
skip2(Fam1,_,Fam2):-
str_real(Fam1,Fam3),
Fam2=Fam3,
!.
svod(1,"",12,9,"",113776,"")
svod(2,"",128,98,"",144766,"")
svod(3,"",87,9,"",563776,"")
svod(4,"",66,43,"",945644,"")
svod(5,"",4423,545,"",435436,"")
svod(6,"",77,65,"",656646,"")
svod(7,"",5545,5440,"",155321,"")
svod(8,"",44,5,"",453534,"")
svod(9,"",345,345,"N",456345,"Microsoft")

     
@2011