home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / aijournl / 1986_09 / aiapp1.ltg next >
Text File  |  1986-10-30  |  419b  |  18 lines

  1.  
  2. Listing 1
  3. A procedure to solve queries
  4.  
  5.  
  6.           PROCEDURE solve(query) ;
  7.            VAR
  8.             i : integer ;
  9.            BEGIN
  10.             IF query = NIL
  11.              THEN write('yes')
  12.              ELSE
  13.               FOR i := 1 TO max_rule_number DO
  14.                IF head(rule[i]) = head(query)
  15.                 THEN solve( append( tail(rule[i]),tail(query) ) ) ;
  16.            END ; (* solve *)
  17.  
  18.