/*----------------- NET-CLAUSE PROLOG V2.0 --------------------*/ /* Library Built-ins */ /*-------------------------------------------------------------*/ ?-(op(1200,fx,?-)). ?-op(1190,xfy,=>). ?-op(1180,xfy,:). ?-op(1150,xfx,:-). ?-op(1100,xfy,;). ?-op(1050,xfy,->). ?-op(1000,xfy,','). ?-op(800,fy,not). ?-op(700,xfx,=). ?-op(700,xfx,==). ?-op(700,xfx,\=). ?-op(700,xfx,is). ?-op(700,xfx,isr). ?-op(700,xfx,=..). ?-op(500,yfx,-). ?-op(500,yfx,+). ?-op(700,xfx,>). ?-op(700,xfx,<). ?-op(400,yfx,*). ?-op(400,yfx,/). ?-op(400,yfx,mod). ?-op(300,fy,~). ?-name(_,","). ?-more. (P,Q):-P,Q. (P->Q;R):-P,!,Q. (P->Q;R):-!,R. (P;Q):-P. (P;Q):-Q. X=X. X==Y:-eqv(X,Y). /* For variables only */ X\=X:-!,fail. X\=Y. X>Y:-Y to Scroll Up and to Exit '), clear,net(N,A),write(' '),write(N),repeat,inkey(27),copyp(1,0), text,goxy(X,Y),!. /*-------------------------------------------------------------------*/ net(X):-net(X,_). net(X,A):-'$netenv',name(CR,[58,13,10,32]),'$fnet'(CR,X,A),!. net([],_). '$fnet'(F,Z,A):-'$getcl'(X,A),'$advnet','$fnet'(F,Y,A), functor(Z,F,2),arg(2,Z,X),arg(1,Z,Y). '$fnet'(_,X,A):-'$getcl'(X,A). '$getcl'(X,A):-var(A),'$unet'(X),!. '$getcl'(X,F/A):-var(F),'$unet'(X),functor(X,_,A),!. '$getcl'(X,F/A):-var(A),'$unet'(X),functor(X,F,_),!. '$getcl'(X,F/A):-'$unet'(X),functor(X,F,A),!. '$getcl'(X,A):-'$advnet','$getcl'(X,A),!. '$getcl'([],_). /*---------------- Breadth-first Spreading Activation ----------------*/ spread(T):-nproc(T,L),callp(L). callp([]):-!. callp(L):-top(T),callpp(L),spread(T). callpp([]):-!. callpp([X|T]):-X,callpp(T). /*----------------------- Text Files --------------------------*/ save(X):-open(X),listall,close. dos:-execute('command.com',''). reconsult(X):-dprog(X),consult(X). edit(X):-cursor(X0,Y0),copyp(0,3),name(X,L),name(N,[32|L]), execute('zedit.com',N),copyp(3,0),goxy(X0,Y0),reconsult(X). [X]:-consult(X). [~X]:-reconsult(X). [~X|Y]:-reconsult(X),Y. [X|Y]:-consult(X),Y. /*----------------- User interrupt Debugging ------------------*/ '$debug':-write('??- '),readbuf,read(X),X,'$r'. /*----------------------- Top Level ---------------------------*/ '$top':-dellazy,write('?- '),readbuf,read(X),X,'$r'.