home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / prolog / 2232 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.8 KB  |  49 lines

  1. Newsgroups: comp.lang.prolog
  2. Path: sparky!uunet!mcsun!Germany.EU.net!infko!infko!peter
  3. From: peter@infko.uni-koblenz.de (Peter Baumgartner)
  4. Subject: Re: Occurs check
  5. In-Reply-To: jur@robin.cs.hut.fi's message of Sun, 13 Dec 1992 17:30:16 GMT
  6. Message-ID: <PETER.92Dec14145051@bax.infko.uni-koblenz.de>
  7. Sender: news@infko.uucp (that is the account for news)
  8. Nntp-Posting-Host: bax.uni-koblenz.de
  9. Organization: University of Koblenz, Germany
  10. References: <1992Dec13.173016.8849@nntp.hut.fi>
  11. Date: Mon, 14 Dec 1992 19:50:50 GMT
  12. Lines: 35
  13.  
  14. In article <1992Dec13.173016.8849@nntp.hut.fi> jur@robin.cs.hut.fi (Jussi Rintanen) writes:
  15.  
  16. >   Question 1: What implementations of Prolog implement the occurs check?
  17. >   (Our university has both Sicstus and NU-Prolog.)
  18. >
  19.  
  20.  
  21. Try SEPIA-Prolog  from  ECRC  in munich/Germany.  It   has   some nice
  22. features, including the  possibility  for sound unification.  It  also
  23. includes "iterative deepening", so you need not program it explicitly.
  24. Sepia is cheap and pretty fast. Contact sepia_request@ecrc.de (i'm not
  25. quite sure about this adress)
  26.  
  27. As an alternative you could "linearize" the heads of your rules, i.e.
  28. eliminate multiple occurences of variables in the head. For example, 
  29. your rule
  30.  
  31.     axiom(impl(A,impl(B,A)),k).
  32.  
  33. then becomes
  34.  
  35.     axiom(impl(A,impl(B,A1)),k) :- unify(A,A1).
  36.  
  37. where unify/2 is a sound unification procedure, as can be found e.g. 
  38. in the quintus library. This works sufficiently well for many
  39. programs. However, the first alternative, a Prolog with built-in sound
  40. unification, is superior (wrt. efficiency).
  41.  
  42.     Peter
  43. --
  44. ____________________________________________________________________
  45. Peter Baumgartner                      | peter@infko.uni-koblenz.de
  46. Universitaet Koblenz,                  |
  47. Institut fuer Informatik               | Voice: +49 261 9119-426
  48. Rheinau 3-4, D-5400 Koblenz, Germany   | Fax:   +49 261 37524
  49.