Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!uunet!mcsun!unido!tub!tubopal!db0tui11!schmied From: SCHMIED@tubvm.cs.tu-berlin.de (Albrecht Schmiedel) Newsgroups: comp.lang.prolog Subject: Arrays in Prolog Message-ID: <90239.175243SCHMIED@DB0TUI11.BITNET> Date: 27 Aug 90 15:52:43 GMT Organization: Technical University Berlin Lines: 43 We are implementing a knowledge representation tool involving large inheritance networks, and until now we have been using Prolog, mainly because this is the language we are most familiar with, and because 'rapid prototyping' seems to be easy (compared to C, or even Lisp). Also, we would like to continue using Prolog (for exactly those reasons), but we are increasingly confronted with performance problems. Essentially, this has to do with the inability of Prolog to store, retrieve, and replace data indexed by integers. This is actually all we need to search and to modify large concept graphs; but Prolog forces us (as far as I can see) to do asserts, retracts and database calls where simple assignments and lookups in arrays would suffice. Our program spends large portions of the total run time doing assertions, retractions and calls in those parts of the Prolog database that could easily be replaced by an array storing Prolog terms. My questions are the following: 1) Are there Prologs that adress this kind of need? (I.e. Prologs that make assertions, retractions, and calls involving predicates that fulfill certain conditions - for example, a guaranteed instantiated integer as its first argument, one clause per integer, no backtracking - similarly fast as array operations.) 2) Are there Prologs which are easily extendable by predicates written in C that could do the job? (It should be possible to pass *terms* back and forth; having to decompose terms and lists before processing them by a foreign language predicate and then having to put them together again later on is definitely not what we want.) 3) Shouldn't we be using Prolog? 4) Is there a 'Prolog-way' of handling large graphs efficiently? (Graphs where data referencing other nodes is attached to nodes, and search as well as updates are required.) ------- Albrecht Schmiedel +49 30/314-25494 Technische Universitaet Berlin schmied@db0tui11.bitnet Sekr. FR 5-12 schmied@tubvm.cs.tu-berlin.de Franklinstr. 28/29 1000 Berlin 10 West Germany