home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / huprolog_1 / Help! / monitor < prev    next >
Encoding:
Text File  |  1995-09-06  |  1.8 KB  |  65 lines

  1.  
  2. % Adjunct to "PrlgDigest".
  3. % ========================
  4.  
  5. /*
  6. This monitor will not detect a data conflict in the collected clues 
  7. files as they have been "Passed". 
  8.  
  9. Developed empirically from anomalies thus far encountered it may help 
  10. where the user collects the clues.
  11.  
  12. Addendum.
  13. ---------
  14. Should an imported logic problem be offered to "PrlgDigest" for analysis 
  15. it can be expected that additional ad hoc utilities will be required. In
  16. this case collect any extra utilities under a prolog procedure called 
  17. "do" and insert it in the new clues file that has been generated. See 
  18. cluesfile "a" for an example of this technique.
  19. The new clues file can of course be loaded along with the "s" file. 
  20. Hopefully it will then merge well. Outputs will then be seen, perhaps
  21. followed by an "Inadequate data" signal as the new file evolves.
  22. */
  23.     
  24.  monitor :- 
  25.         nl,nl,
  26.         write('      "Monitor" present.'),nl,nl,
  27.         fail.  
  28.  
  29.  monitor :- nl,              
  30.         c(X,Y),      
  31.         i(X,Y),!,                            
  32.         write(c(X,Y)),tab(5),   % BUG detected    
  33.         write(i(X,Y)),nl, 
  34.         write('
  35.    Cannot have both c(X,Y) and i(X,Y) with the same identities.'),
  36.         nl,      
  37.         fail.
  38.  
  39.  
  40. % Don't link two members of the same group to each other.
  41.  
  42.  monitor :-
  43.         c(X,Y),
  44.         group(G),
  45.         member2(X,G),
  46.         member2(Y,G),!,    
  47.         write(c(X,Y)),nl, 
  48.         write('Two members of the same category are not to be linked.'),
  49.         nl,
  50.         fail.
  51.  
  52. monitor :-
  53.        group(G),
  54.        i(X,Y),
  55.        member2(X,G),
  56.        member2(Y,G),!,
  57.        write(i(X,Y)),nl,
  58.        write('   Must not link two members of the same group.'),nl,
  59.        fail.
  60.        
  61.      % We must now tell "monitor" that it has nothing further to do.
  62.           
  63. monitor.
  64.             
  65.