Article View: comp.lang.prolog
Article #1582Re: Difference Lists (was: Rotation, or something...)
From: Thomas Sj|land
Date: Wed, 11 Nov 1992 10:57
Date: Wed, 11 Nov 1992 10:57
33 lines
1907 bytes
1907 bytes
>I don't agree at all that "Prolog supports polymorphism and data >abstraction better than many languages." In this respect, it's no better >than Fortran. Maybe so, maybe not. The confusion surrounding diff-structures often comes from misunderstandings about the semantics of LP. In order to use such beasts as diff-lists one should: 1) avoid using unification for anything but argument transfer of terms with a "user-defined" "type". 2) define a (possibly unlogical) predicate 'diff_equal(X,Y)' for the representations used. 3) Keep in mind that Prolog unification knows of no equality theory but the simplest one, that of the Herbrand universe. or 4) Possibly use Harald Soendergaards tools, when available. Prolog gives nice possibilities to define "datatypes", i.e. user defined representations with their own equality theory, in a much cleaner way than FORTRAN, where you would have to define a function procedure like BOOLEAN EQUAL(X,Y) where X and Y should be coded names for diff-structures (how this is done without pointers and structures cannot be considered elegant by any standard...). -- (Alf) Thomas Sjoeland SICS, PO Box 1263, S-164 28 KISTA, SWEDEN Tel: +46 8 752 15 42 Fax: +46 8 751 72 30 Tel home: +46 8 80 44 08 Internet: thomas@sics.se (or the older alf@sics.se) ......
Technical Details
Message-ID:
<THOMAS.92Nov11115710@hathor.sics.se>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!sics.se!thomasReferences:
<1992Oct20.152319.28201@athena.cs.uga.edu> <BwGzK7.ECu@gabriel.keele.ac.uk> <1992Oct22.104351.9700@vax.oxford.ac.uk>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.prolog Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!sics.se!thomas From: thomas@sics.se (Thomas Sj|land) Subject: Re: Difference Lists (was: Rotation, or something...) In-Reply-To: popx@vax.oxford.ac.uk's message of 22 Oct 92 09:43:51 GMT Message-ID: <THOMAS.92Nov11115710@hathor.sics.se> Sender: news@sics.se Organization: Swedish Institute of Computer Science, Kista References: <1992Oct20.152319.28201@athena.cs.uga.edu> <BwGzK7.ECu@gabriel.keele.ac.uk> <1992Oct22.104351.9700@vax.oxford.ac.uk> Date: Wed, 11 Nov 1992 10:57:10 GMT Lines: 36