home *** CD-ROM | disk | FTP | other *** search
- PRODUCT : TURBO PROLOG NUMBER : 187
- VERSION : 1.0xx
- OS : PC-DOS
- DATE : June 3, 1986
-
- TITLE : MANUAL UPDATE
-
- Following is a list of modifications to be made to the Turbo
- Prolog Reference Manual.
-
- Page 12 - line 5
-
- mark the beginning of the block by pressing <Ctrl-K><B>
-
- should be:
-
- mark the end of the block by pressing <Ctrl-K><K>
-
- Page 16 - last line -
-
- Read
-
- should be:
-
- Load
-
- Page 19 - line 3
-
- No solution
-
- should be:
-
- False
-
- Page 31 - THE MURDER MYSTERY line 4
-
- person(X,_,k,_) and
-
- should be:
-
- person(X,_,f,_) and
-
-
-
- Page 42 - program 10
-
- domains
- n, f = integer
- and
- N > 0 and
-
- should be:
-
- domains
- n, f = real
- and
- N > 1
-
-
- Page 43
-
- factorial(2,FacN11) if
- 2>1,N11=2-1,factorial(3-1,facN11),Res=2*FacN11
-
- should be:
-
- factorial(2,FacN11) if
- 2>1,N111=2-1,factorial(3-1,facN11),Res=3*FacN11
-
- Page 49 - program 12
-
- writelist([],([]).)
-
- should be:
-
- writelist([]).
-
- Page 50 - line 19
-
- evennumber(X,[1,2,3,4,5,6]).
-
- should be:
-
- evenmember(X,[1,2,3,4,5,6]).
-
-
-
- publication = book(title,page)
-
- should be:
-
- publication = book(title,pages)
-
-
- Page 52 - discussion of program 13
-
- Since X and Y are free variables in this goal, and a free
- variable can be unified with any other term, the very first
- written_by clause unifies with the goal clause
-
- written_by ( X, Y )
- written_by (fleming, book("Dr No",210)
- Thus X becomes bound to fleming and Y is bound to book("Dr
- No",210) so Turbo Prolog displays
-
- X = fleming, Y = book("Dr No",210)
- X = melville, Y = book("Moby Dick",600)
- 2 Solutions
- (goals entered at goal prompt in dialog window return all
- solutions)
-
- If, on the other hand, we give Program 13 the goal
-
- written_by(X,book("Moby Dick",Y)).
-
- then again unification is attempted with the first clause for
- written_by
-
- written_by( X , book("Moby Dick" , Y)).
- written_by( fleming, book("Dr No",210)).
-
- This fails because "Moby Dick" and "Dr No" do not match, and
- Turbo Prolog tries the next fact
-
- written_by(melville,book("Moby Dick",600)
-
- This will unify and X is bound to melville and Y is bound to 600.
-
- Page 53 - line 6
-
- long_novel(Title):-
-
- should be:
-
- long_novel(book(Title,Length)):-
-
- Page 57 - Goal #1 for program 15
-
- Goal: father_to(X,Y)
-
- should be:
-
- Goal: father(X,Y)
-
- Page 57 - goal #2 for program 15
-
- No solution
-
- should be:
-
- False
-
- Page 59 - USING CUT TO PREVENT BACKTRACKING TO THE NEXT CLAUSE
- line 35
-
- Our example in this case is based on program 9 (Chapter 4),
-
- should be:
-
- Our example in this case is based on program 10 (Chapter 4),
-
- Page 60 - line 9
-
- In many implementations of Turbo Prolog,
-
- should be:
-
- In many implementations of Prolog,
-
-
-
- During the single-step execution of a program trace, <Ctrl-T>
- can be used to provide the same function as trace, since it
- toggles between trace(off) and trace(on).
-
- should be:
-
- During the single-step execution of a program trace, <Alt-T>
- can be used to provide the same function as trace, since it
- toggles between trace(off) and trace(on).
-
-
- Page 78 - table 7-2 and Page 178 - table 12-3
-
- color foreground background
- ---------------------------------------
- black 0 0
- Gray 8 --
- blue 1 16
- light blue 9 --
- green 2 32
- light green 10 --
- cyan 3 48
- light cyan 11 --
- red 4 64
- pink 12 --
- magenta 5 80
- light magenta 13 --
- brown 6 96
- yellow 14 --
- white 7 112
- white
- (high intensity) 15 --
-
- Page 80 - program 26 line 7
-
- makewindow(2,184,7,"A light cyan window",14,55,10,20),
-
- should be:
-
- makewindow(2,184,7,"A light cyan window",14,25,10,20),
-
-
- Page 93 - line 2
-
- pressing the [u](for up), [d](for down), [l](for left),
- and [r](for right) keys.
-
- Page 87 - lines 29 through 34
-
- Omit the following text:
-
- You could combine this DOS-calling facility with windows to
- construct your own user interface to DOS. For instance,
-
- makewindow(1,7,7,"DOS",5,26,10,40),
- system("").
-
- would confine any dialogue with DOS to an 8-row, 38-column
- window in the top right corner of the screen.
-
- Page 88 - program 30 - Line 3
-
- system("dir a:"),
-
- should be:
-
- dir("a:","*.*",_),
-
- Page 88 - program 30 - Line 5
-
- system("dir b:"),
-
- should be:
-
- dir("b:","*.*",_),
-
- Page 89 - program 32 - Line 3
-
- time(0,0,0,0),system("dir a:"),
-
- should be:
-
- time(0,0,0,0),dir("c:\\","*.*",_),
-
- PRODUCT. : TURBO PROLOG
- NUMBER : 187
- VERSION. : 1.0xx
- OS : PC-DOS
- DATE : June 3, 1986
- PAGE : 7/12
-
- TITLE : MANUAL UPDATE
-
-
- Page 93 - program 34 (and EXAMPL34 on the diskette)
-
- Program 34
- move('r',X,31000,X,31000):- !.
- move('r',X,Yold,X,Ynew):- !,Ynew=Yold+100,dot(X,Yold,3).
- move('l',X,1000,X,1000):- !.
- move('l',X,Yold,X,Ynew):- !,Ynew=Yold-100,dot(X,Yold,3).
-
- /* 'u' for up */
- move('u',1000,Y,1000,Y):- !.
- move('u',Xold,Y,Xnew,Y):- !,Xnew=Xold-100,dot(Xold,Y,3).
- move('d',31000,Y,31000,Y):- !.
- move('d',Xold,Y,Xnew,Y):- !,Xnew=Xold+100,dot(Xold,Y,3).
-
- /* X,Y,X,Y for bindings */
- move('*',X,Y,X,Y):- !,exit.
- move(_,X,Y,X,Y).
-
-
-
- graphics(2,1,0)
-
- should be:
-
- graphics(1,1,4)
-
-
- graphics(2,1,0)
-
- should be:
-
- graphics(1,0,17)
-
-
- grahics(2,1,0),
-
- should be:
-
- grahics(2,0,4).
-
-
-
- goal
- fillsquare(5000).
-
- should be:
-
- goal
- graphics(1,0,17),fillsquare(5000).
-
- goal
- circle.
-
- should be
-
- goal
- graphics(2,0,4),circle.
-
- Page 104 - STRING PROCESSING
- Add
- "\" is a control character
- "\n" is new line
- "\t" is tab
- "\b" is back space
- to print "\" type "\\" results in a \
-
-
- rand_int_1_5(X) :- random(Y),X=Y*5+1.
-
- should be:
-
- rand_int_1_5(X) :- random(Y),X=Y*4+1.
-
-
- rand_person(Count):-
- rand_int_1_5(N),person(N,Name),nl,nl,write(Name),nl,
- Newcount=Count 1,rand_person(NewCount).
-
- should be:
-
- rand_person(Count):-
- rand_int_1_5(N),person(N,Name),nl,nl,write(Name),nl,
- Newcount=Count-1,rand_person(NewCount).
-
- Page 144 - line28
-
- (Dbasedom,Term),!,
-
- should be:
-
- readterm(Dbasedom,Term),!,
-
- Page 154 - AN EXAMPLE
-
- Create a LIBRARIAN file via the Librarian entry in Setup by
- giving the name MYPROJ to the "Name of module list?" prompt and
- then edit the contents to:
-
- should be:
-
- Create a project file via the Module List entry in Files by
- giving the name MYPROJ to the "Name of module list:" prompt and
- then edit the contents to:
-
-
-
- /* Program 66 */
-
- predicates
-
- dosver(real)
- diskspace(real,real)
- makedir(STRING)
- removedir(STRING)
-
- clauses
-
- dosver(VERSION):-
- AX=48*256,
- bios($21,reg(AX,0,0,0,0,0,0,0),reg(VV,_,_,_,_,_,_,_)),
- L=VV div 256,H=VV-256*L,VERSION=H+L/100.
-
- diskspace(TOTALSPACE,FREESPACE):-
- AAX=54*256,
- bios(33,reg(AAX,0,0,0,0,0,0,0),
- reg(AX,BX,CX,DX,_,_,_,_)),
- FREESPACE=1.0*BX*CX*AX,TOTALSPACE=1.0*DX*CX*AX.
-
- makedir(NAME):-
- ptr_dword(NAME,DS,DX),
- AX=256*57,
- bios(33,reg(AX,0,0,DX,0,0,DS,0),_).
-
- removedir(NAME):-
- ptr_dword(NAME,DS,DX),AX=256*58,
- bios(33,reg(AX,0,0,DX,0,0,DS,0),_).
-
- Page 169 - Librarian
-
- When you select Librarian, you will be asked for the name of the
- file containing the list of modules in a given project. . .
-
- should be:
-
- When you select Module List, . . .
-
-
-
- Top of file --- --- <Ctrl><Home> or <Ctrl-Q><R>
- End of file --- --- <Ctrl><PgDn> or <Ctrl-Q><C>
-
- Should be:
-
- Top of file --- --- <Ctrl><PgUp> or <Ctrl-Q><R>
- End of file --- --- <Ctrl><PgDn> or <Ctrl-Q><C>
-
- Page 180 - SCREEN HANDLING
-
- pencolor(Color) . . . . . . . . . . . . . . . . . . . . 190
-
- should be:
-
- pencolour(Color) . . . . . . . . . . . . . . . . . . . .190
-
- Page 183 - ALPHABETIC DIRECTORY OF STANDARD PREDICATES
-
- add
- concat(string1,string2,longstring) (string,string,string):(i,i,o)
- concat obtains longstring by concatenating String1 and String2
-
- Page 185 - ALPHABETIC DIRECTORY OF STANDARD PREDICATES
-
- editmsg(InStr,OutStr,LeftHeader,RightHeader,Message,
- HelpFileName,Position,Code)
- (string,string,string,string,string,string,string,integer,
- integer) : (i,o,i,i,i,i,i,o)
-
- should be:
-
- editmsg(InStr,OutStr,LeftHeader,RightHeader,Message,Position,
- HelpFileName,Code)
- (string,string,string,string,string,string,integer,string,
- integer) : (i,o,i,i,i,i,i,o)
-
- Page 188 - INSERT TEXT ABOVE "isname(StringParam)."
-
- inkey(char) (char) : (o)
-
- Inkey reads a single character from the standard input, if one is
- present. If there is nothing on the standard input, inkey fails.
-
-
- Page 190 - ALPHABETIC DIRECTORY OF STANDARD PREDICATES
-
- pencolor(Color)
-
- should be
-
- pencolour(Color)
-
-