home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / PASCAL / MISCTI10.ZIP / TI187.ASC < prev    next >
Encoding:
Text File  |  1988-04-18  |  9.6 KB  |  466 lines

  1. PRODUCT : TURBO PROLOG     NUMBER : 187
  2. VERSION : 1.0xx
  3.      OS : PC-DOS
  4.    DATE : June 3, 1986
  5.  
  6.   TITLE : MANUAL UPDATE
  7.  
  8. Following  is  a list of modifications to be made  to  the  Turbo 
  9. Prolog Reference Manual.
  10.  
  11. Page 12 - line 5
  12.  
  13.    mark the beginning of the block by pressing <Ctrl-K><B>
  14.  
  15. should be:
  16.  
  17.    mark the end of the block by pressing <Ctrl-K><K>
  18.  
  19. Page 16 - last line -
  20.  
  21.    Read 
  22.  
  23. should be:
  24.  
  25.    Load
  26.  
  27. Page 19 - line 3
  28.  
  29.    No solution
  30.  
  31. should be:
  32.  
  33.    False
  34.  
  35. Page 31 - THE MURDER MYSTERY line 4
  36.  
  37.    person(X,_,k,_) and
  38.  
  39. should be:
  40.  
  41.    person(X,_,f,_) and
  42.  
  43.  
  44.  
  45. Page 42 - program 10
  46.  
  47.   domains
  48.       n, f = integer
  49.   and
  50.      N > 0 and
  51.  
  52. should be:
  53.  
  54.   domains
  55.      n, f = real
  56.   and
  57.      N > 1
  58.  
  59.  
  60. Page 43
  61.  
  62.    factorial(2,FacN11) if
  63.      2>1,N11=2-1,factorial(3-1,facN11),Res=2*FacN11
  64.  
  65. should be:
  66.  
  67.    factorial(2,FacN11) if
  68.      2>1,N111=2-1,factorial(3-1,facN11),Res=3*FacN11
  69.  
  70. Page 49 - program 12
  71.  
  72. writelist([],([]).)
  73.  
  74. should be:
  75.  
  76.    writelist([]).
  77.  
  78. Page 50 - line 19
  79.  
  80.   evennumber(X,[1,2,3,4,5,6]).
  81.  
  82. should be:
  83.  
  84.   evenmember(X,[1,2,3,4,5,6]).
  85.  
  86.  
  87.  
  88.    publication  = book(title,page)
  89.  
  90. should be:
  91.  
  92.    publication  = book(title,pages)
  93.  
  94.  
  95. Page 52 - discussion of program 13
  96.  
  97. Since  X  and  Y  are free variables in this  goal,  and  a  free 
  98. variable  can  be unified with any other  term,  the  very  first 
  99. written_by clause unifies with the goal clause
  100.  
  101.          written_by ( X, Y )
  102.          written_by (fleming, book("Dr No",210)
  103. Thus  X  becomes  bound  to fleming and Y is  bound  to  book("Dr 
  104. No",210) so Turbo Prolog displays
  105.  
  106.     X = fleming, Y = book("Dr No",210)
  107.     X = melville, Y = book("Moby Dick",600)
  108.     2 Solutions
  109.     (goals  entered  at goal prompt in dialog window  return  all      
  110. solutions)
  111.  
  112. If, on the other hand, we give Program 13 the goal
  113.  
  114.      written_by(X,book("Moby Dick",Y)).
  115.  
  116. then  again  unification is attempted with the first  clause  for 
  117. written_by
  118.  
  119.       written_by( X , book("Moby Dick" , Y)).
  120.       written_by( fleming, book("Dr No",210)).
  121.  
  122. This  fails  because "Moby Dick" and "Dr No" do  not  match,  and 
  123. Turbo Prolog tries the next fact
  124.  
  125.       written_by(melville,book("Moby Dick",600)
  126.  
  127. This will unify and X is bound to melville and Y is bound to 600.
  128.  
  129. Page 53 - line 6
  130.  
  131.    long_novel(Title):-
  132.  
  133. should be:
  134.  
  135.    long_novel(book(Title,Length)):-
  136.  
  137. Page  57 - Goal #1 for program 15 
  138.  
  139.    Goal: father_to(X,Y)
  140.  
  141. should be:
  142.  
  143.    Goal: father(X,Y)
  144.  
  145. Page 57 - goal #2 for program 15
  146.  
  147.    No solution
  148.  
  149. should be:
  150.  
  151.    False
  152.  
  153. Page  59 - USING CUT TO PREVENT BACKTRACKING TO THE  NEXT  CLAUSE            
  154. line 35
  155.  
  156.    Our example in this case is based on program 9 (Chapter 4),
  157.  
  158. should be:
  159.  
  160.    Our example in this case is based on program 10 (Chapter 4),
  161.  
  162. Page 60 - line 9
  163.  
  164.    In many implementations of Turbo Prolog,
  165.  
  166. should be:
  167.  
  168.    In many implementations of Prolog,
  169.  
  170.  
  171.  
  172.   During  the single-step execution of a program trace,  <Ctrl-T> 
  173.   can  be used to provide the same function as  trace,  since  it 
  174.   toggles between trace(off) and trace(on).
  175.  
  176. should be:
  177.  
  178.   During  the single-step execution of a program  trace,  <Alt-T> 
  179.   can  be  used to provide the same function as trace,  since  it 
  180.   toggles between trace(off) and trace(on).
  181.  
  182.  
  183. Page 78 - table 7-2  and Page 178 - table 12-3
  184.  
  185.  color         foreground      background
  186.  ---------------------------------------
  187.  black              0               0
  188.  Gray               8              --
  189.  blue               1              16
  190.  light blue         9              --
  191.  green              2              32
  192.  light green       10              --
  193.  cyan               3              48
  194.  light cyan        11              --
  195.  red                4              64
  196.  pink              12              --
  197.  magenta            5              80
  198.  light magenta     13              --
  199.  brown              6              96
  200.  yellow            14              --
  201.  white              7              112
  202.  white
  203.  (high intensity)  15              --
  204.  
  205. Page 80 - program 26 line 7
  206.  
  207.    makewindow(2,184,7,"A light cyan window",14,55,10,20),
  208.  
  209. should be:
  210.  
  211.    makewindow(2,184,7,"A light cyan window",14,25,10,20),
  212.  
  213.  
  214. Page 93 - line 2
  215.  
  216.    pressing the [u](for up), [d](for down), [l](for left),
  217.    and [r](for right) keys.
  218.  
  219. Page 87 - lines 29 through 34
  220.  
  221.    Omit the following text:
  222.  
  223.    You  could  combine this DOS-calling facility with windows  to 
  224.    construct your own user interface to DOS.  For instance,
  225.  
  226.       makewindow(1,7,7,"DOS",5,26,10,40),
  227.       system("").
  228.  
  229.    would  confine  any dialogue with DOS to an  8-row,  38-column 
  230.    window in the top right corner of the screen.
  231.  
  232. Page 88 - program 30 - Line 3
  233.  
  234.    system("dir a:"),
  235.  
  236. should be:
  237.  
  238.    dir("a:","*.*",_),
  239.  
  240. Page 88 - program 30 - Line 5
  241.  
  242.    system("dir b:"),
  243.  
  244. should be:
  245.  
  246.    dir("b:","*.*",_),
  247.  
  248. Page 89 - program 32 - Line 3
  249.  
  250.    time(0,0,0,0),system("dir a:"),
  251.  
  252. should be:
  253.  
  254.    time(0,0,0,0),dir("c:\\","*.*",_),
  255.  
  256. PRODUCT. : TURBO PROLOG                                      
  257. NUMBER : 187
  258. VERSION. : 1.0xx
  259.      OS : PC-DOS
  260.    DATE : June 3, 1986                                        
  261. PAGE : 7/12
  262.  
  263.   TITLE : MANUAL UPDATE
  264.  
  265.  
  266. Page 93 - program 34 (and EXAMPL34 on the diskette)
  267.  
  268.  Program 34
  269.    move('r',X,31000,X,31000):- !.
  270.    move('r',X,Yold,X,Ynew):- !,Ynew=Yold+100,dot(X,Yold,3).
  271.    move('l',X,1000,X,1000):- !.
  272.    move('l',X,Yold,X,Ynew):- !,Ynew=Yold-100,dot(X,Yold,3).
  273.  
  274. /* 'u' for up */
  275.    move('u',1000,Y,1000,Y):- !.
  276.    move('u',Xold,Y,Xnew,Y):- !,Xnew=Xold-100,dot(Xold,Y,3).
  277.    move('d',31000,Y,31000,Y):- !.
  278.    move('d',Xold,Y,Xnew,Y):- !,Xnew=Xold+100,dot(Xold,Y,3).
  279.  
  280. /* X,Y,X,Y for bindings */
  281.    move('*',X,Y,X,Y):- !,exit.
  282.    move(_,X,Y,X,Y).
  283.  
  284.  
  285.  
  286.   graphics(2,1,0)
  287.  
  288. should be:
  289.  
  290.   graphics(1,1,4)
  291.  
  292.  
  293.   graphics(2,1,0)
  294.  
  295. should be:
  296.  
  297.   graphics(1,0,17)
  298.  
  299.  
  300.    grahics(2,1,0),
  301.  
  302. should be:
  303.  
  304.    grahics(2,0,4).
  305.  
  306.  
  307.  
  308.   goal
  309.     fillsquare(5000).
  310.  
  311. should be:
  312.  
  313.   goal
  314.     graphics(1,0,17),fillsquare(5000).
  315.  
  316.    goal
  317.      circle.
  318.  
  319. should be
  320.  
  321.    goal
  322.      graphics(2,0,4),circle.
  323.  
  324. Page 104 - STRING PROCESSING
  325.     Add
  326.   "\" is a control character
  327.       "\n" is new line
  328.       "\t" is tab
  329.       "\b" is back space
  330.   to print "\" type "\\"  results in a \
  331.  
  332.  
  333.        rand_int_1_5(X) :- random(Y),X=Y*5+1.
  334.  
  335. should be:
  336.  
  337.        rand_int_1_5(X) :- random(Y),X=Y*4+1.
  338.  
  339.  
  340.    rand_person(Count):-
  341.       rand_int_1_5(N),person(N,Name),nl,nl,write(Name),nl,
  342.       Newcount=Count 1,rand_person(NewCount).
  343.  
  344. should be:
  345.  
  346.    rand_person(Count):-
  347.       rand_int_1_5(N),person(N,Name),nl,nl,write(Name),nl,
  348.       Newcount=Count-1,rand_person(NewCount).
  349.  
  350. Page 144  - line28
  351.  
  352.   (Dbasedom,Term),!,
  353.  
  354. should be:
  355.  
  356.   readterm(Dbasedom,Term),!,
  357.  
  358. Page 154 - AN EXAMPLE
  359.  
  360. Create  a  LIBRARIAN  file via the Librarian entry  in  Setup  by 
  361. giving  the name MYPROJ to the "Name of module list?" prompt  and 
  362. then edit the contents to:
  363.  
  364. should be:
  365.  
  366. Create  a  project  file via the Module List entry  in  Files  by 
  367. giving  the name MYPROJ to the "Name of module list:" prompt  and 
  368. then edit the contents to:
  369.  
  370.  
  371.  
  372.            /* Program 66 */
  373.  
  374.    predicates
  375.  
  376.      dosver(real)
  377.      diskspace(real,real)
  378.      makedir(STRING)
  379.      removedir(STRING)
  380.  
  381.    clauses
  382.  
  383.      dosver(VERSION):-
  384.         AX=48*256,
  385.         bios($21,reg(AX,0,0,0,0,0,0,0),reg(VV,_,_,_,_,_,_,_)),
  386.         L=VV div 256,H=VV-256*L,VERSION=H+L/100.
  387.  
  388.         diskspace(TOTALSPACE,FREESPACE):-
  389.            AAX=54*256,
  390.            bios(33,reg(AAX,0,0,0,0,0,0,0),
  391.            reg(AX,BX,CX,DX,_,_,_,_)),
  392.            FREESPACE=1.0*BX*CX*AX,TOTALSPACE=1.0*DX*CX*AX.
  393.  
  394.         makedir(NAME):-
  395.            ptr_dword(NAME,DS,DX),
  396.            AX=256*57,
  397.            bios(33,reg(AX,0,0,DX,0,0,DS,0),_).
  398.  
  399.         removedir(NAME):-
  400.            ptr_dword(NAME,DS,DX),AX=256*58,
  401.            bios(33,reg(AX,0,0,DX,0,0,DS,0),_).
  402.  
  403. Page 169 - Librarian
  404.  
  405. When you select Librarian,  you will be asked for the name of the 
  406. file containing the list of modules in a given project. . .
  407.  
  408. should be:
  409.  
  410. When you select Module List, . . .
  411.  
  412.  
  413.  
  414.  Top of file   --- --- <Ctrl><Home> or <Ctrl-Q><R>
  415.  End of file   --- --- <Ctrl><PgDn> or <Ctrl-Q><C>
  416.  
  417. Should be:
  418.  
  419.  Top of file   --- --- <Ctrl><PgUp> or <Ctrl-Q><R>
  420.  End of file   --- --- <Ctrl><PgDn> or <Ctrl-Q><C>
  421.  
  422. Page 180 - SCREEN HANDLING
  423.  
  424.    pencolor(Color) . . . . . . . . . . . . . . . . . . . . 190
  425.  
  426. should be:
  427.  
  428.    pencolour(Color) . . . . . . . . . . . . . . . . . . . .190
  429.  
  430. Page 183 - ALPHABETIC DIRECTORY OF STANDARD PREDICATES
  431.  
  432.   add
  433. concat(string1,string2,longstring) (string,string,string):(i,i,o)
  434.   concat obtains longstring by concatenating String1 and String2
  435.  
  436. Page 185 - ALPHABETIC DIRECTORY OF STANDARD PREDICATES
  437.  
  438. editmsg(InStr,OutStr,LeftHeader,RightHeader,Message,
  439.                               HelpFileName,Position,Code)
  440.     (string,string,string,string,string,string,string,integer, 
  441.      integer) : (i,o,i,i,i,i,i,o)             
  442.  
  443. should be:
  444.  
  445. editmsg(InStr,OutStr,LeftHeader,RightHeader,Message,Position,
  446.                                                HelpFileName,Code)
  447.      (string,string,string,string,string,string,integer,string,
  448.      integer) : (i,o,i,i,i,i,i,o)
  449.  
  450. Page 188 - INSERT TEXT ABOVE "isname(StringParam)."
  451.  
  452. inkey(char)                                        (char) : (o)
  453.  
  454. Inkey reads a single character from the standard input, if one is 
  455. present.  If there is nothing on the standard input, inkey fails.
  456.  
  457.  
  458. Page 190 - ALPHABETIC DIRECTORY OF STANDARD PREDICATES
  459.  
  460.   pencolor(Color)
  461.  
  462. should be
  463.  
  464.   pencolour(Color)
  465.  
  466.