🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #66

Re: term comparisons with variables

#66
From: Jonas Almgren
Date: Tue, 04 Aug 1992 18:04
32 lines
1666 bytes
Note that Richard didn't suggest a ground representation, but a
combined representation using ground terms to sort on, but still
including the original terms and their unbound variables.

Using Richard's proposal, equivalence can be tested for (in
Quintus Prolog) using the predicate subsumes_chk/2 twice, or
by grounding the complete set (including the original terms)
before trying to unify (this is OK, because the sets are
sorted).

> 	[p('$VAR'(0),a)-p(X,a), p('$VAR'(0),b)-p(Y,b)]
> 	[p('$VAR'(0),a)-p(V,a), p('$VAR'(0),b)-p(U,b)]

Would be grounded to:
	[p('$VAR'(0),a)-p('$var'(0),a), p('$VAR'(0),b)-p('$var'(1),b)]
	[p('$VAR'(0),a)-p('$var'(0),a), p('$VAR'(0),b)-p('$var'(1),b)]

They would hence unify. The second example:
>		{p(X, a), p(Y, b)} and
>		{p(X, a), p(X, b)}

represented as:
	[p('$VAR'(0),a)-p(X,a), p('$VAR'(0),b)-p(Y,b)]
	[p('$VAR'(0),a)-p(X,a), p('$VAR'(0),b)-p(X,b)]

would be grounded to:
	[p('$VAR'(0),a)-p('$var'(0),a), p('$VAR'(0),b)-p('$var'(1),b)]
	[p('$VAR'(0),a)-p('$var'(0),a), p('$VAR'(0),b)-p('$var'(0),b)]

They would NOT unify, which is correct, and what you're asking for.

/Jonas Almgren
Technical Details
Message-ID: <1992Aug4.180415.24672@quintus.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!infonode!ingr!capalo!quintus!quintus!jonas
References: <1992Jul10.161816.3247@cs.kuleuven.ac.be> <270@ininx.UUCP> <13794@goanna.cs.rmit.oz.au> <271@ininx.UUCP>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.prolog
Path: arc1-ca.pugleaf.net!sparky!uunet!infonode!ingr!capalo!quintus!quintus!jonas
From: jonas@quintus.com (Jonas Almgren)
Subject: Re: term comparisons with variables
Message-ID: <1992Aug4.180415.24672@quintus.com>
Sender: news@quintus.com (USENET news account)
Nntp-Posting-Host: page
Organization: Quintus Corporation
References: <1992Jul10.161816.3247@cs.kuleuven.ac.be> <270@ininx.UUCP> <13794@goanna.cs.rmit.oz.au> <271@ininx.UUCP>
Date: Tue, 4 Aug 1992 18:04:15 GMT
Lines: 32