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

  1. Newsgroups: comp.lang.prolog
  2. Path: sparky!uunet!usc!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!cs.tu-berlin.de!hoppet
  3. From: hoppet@opal.cs.tu-berlin.de (Thomas Hoppe)
  4. Subject: Looking for clause or n-ary tree indexing code
  5. Message-ID: <1992Dec18.232658.12613@cs.tu-berlin.de>
  6. Keywords: indexing, clauses, n-ary trees, Quintus 'indexer'
  7. Sender: news@cs.tu-berlin.de
  8. Organization: Techn. University of Berlin, Germany
  9. Date: Fri, 18 Dec 1992 23:26:58 GMT
  10. Lines: 53
  11.  
  12. Dear Prolog net'ers
  13.  
  14. for the purpose of explicit and fast storage of proof-trees, I'm
  15. looking for some sophisticated indexing mechanism on Prolog clauses.
  16. Clauses asserted in the Prolog DB are implicitly indexed on the
  17. predicate symbol contained in the clause head as primary key and
  18. usually explicitly on the first argument as secondary key. For the
  19. purpose of a fast access to clauses over some predicate symbol
  20. contained in the body of a clause, I need now some indexing mechanism.
  21. I.e.\ if a clause p :- q, r. is given, I like to retrieve this clause
  22. directly from the Prolog DB and from a given goal r without inspecting
  23. every asserted clause and its body. 
  24.  
  25. Since a clause p :- q, r. can be regarded as tree of depth one with
  26. root p and sons q and r, such an indexing mechanism could also be used
  27. to index trees with an arbitrary number of sons per node.  Such an
  28. indexing mechanism is also useful for implementing forward chaining
  29. inference systems, thus I thought that it is maybe a good idea to ask
  30. the Prolog community out there whether someone has implemented already
  31. such a mechanism. 
  32.  
  33. Although the Quintus libraries contain some package called 'indexer',
  34. which realizes an advanced indexing mechanism on arbitrary arguments
  35. (and thus extends the secondary explicite indexing mechanism above), I
  36. haven't found yet any library package realizing an extended indexing
  37. mechanism of the implicite, primary type. Clearly, indexing on the
  38. arguments of a predicate is much easier (since their number of
  39. arguments is fixed) than indexing over an arbitrary long list of body
  40. predicates. 
  41.  
  42. Although a Prolog clause is a term structure of nested binary symbols
  43. (usually :- , and ;) and literals as leaves, the first idea is to
  44. regard a clause as binary tree. On this way 'indexer' can be easily
  45. extended for indexing binary tree's, since the number of subtree's is
  46. fixed. But that's a level to low for my purpose: first, this has the
  47. consequence that a large number of (:- , and ;) entries exists in the
  48. DB, and second, for finding the clause head an algorithm would need to
  49. 'crawl up' the tree.  If instead the indexing mechanism indexes n-ary
  50. tree's, a quicker look-up is possible. 
  51.  
  52. If you have implemented such a thing or if you know a reference for
  53. some code, I would appreciate it. If of interest, I summarize the
  54. responses I receive.
  55.  
  56. ADVthanxANCE, 
  57.  
  58.     Thomas Hoppe
  59.  
  60. --
  61. Thomas Hoppe  Projekt KIT-BACK        email: hoppet@cs.tu-berlin.de
  62. Technische Universitaet Berlin        phone: 030-314-25494
  63. Franklinstr. 28/29            fax  : 030-314-24929
  64. 1000 Berlin 10    Germany            priv.: 030-3236564
  65.