🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2170

Unification of rational terms

#2170
From: Olivier Ridoux
Date: Wed, 23 Dec 1992 10:04
40 lines
2190 bytes
Bart Demoen writes:
> Supporting rational tree unification (and conservation of sharing during
> some built-in predicates - which is a consequence of fully supporting cyclic
                                        ^^^^^^^^^^^
> terms) can actually speed up some programs quite a lot.

WEll, Well, well.  I like to be shightly more precise and show that
rational term unification and conservation of sharing are rather
independent.

The minimum that rational tree unification must do is to remember
every pair of equivalent terms in the current branch of the current
unification problem.  It will not buy you much conservation of
sharing.  The maximum it can do is to remember every pair of
equivalent terms in the current branch of the search-tree.  This will
buy you the maximum conservation of sharing.

In this context, "equivalent" means "made equivalent by unification".
Those terms that are equivalent without the help of unification may
well never be recognised as equivalent.

One might want to stick to the minimum for avoiding special trailing
and backtracking operations for handling the storing and unstoring of
equivalent pairs, and to benefit from the recursive control of
unification.  However, modern Prolog implementations already have
these special operations (for handling contraints, term rewriting or
whatever ...).  It would be rather mean of these implementations not
to give the maximum.

Note also, that remembering pairs of equivalent terms in the current
branch of the search-tree is also feasible and usefull for finite term
unification.  It improves memory representation and unification (if it
is smart enough to detect physically equal terms).

Moral: rational term unification and conservation of sharing are
rather independent issues.  Even if they use similar techniques.

Hoping it helps,

Olivier Ridoux
Technical Details
Message-ID: <1992Dec23.100438.20247@irisa.fr>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!julienas!irisa!ridoux

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.prolog
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!julienas!irisa!ridoux
From: ridoux@irisa.fr (Olivier Ridoux)
Subject: Unification of rational terms
Message-ID: <1992Dec23.100438.20247@irisa.fr>
Sender: news@irisa.fr
Organization: IRISA, Rennes (Fr)
Date: Wed, 23 Dec 92 10:04:38 GMT
Lines: 41