Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.kei.com!sol.ctr.columbia.edu!howland.reston.ans.net!news.sprintlink.net!EU.net!sun4nl!freya.let.rug.nl!gosse
From: gosse@let.rug.nl (Gosse Bouma)
Subject: Re: numbervars/3 bug in Quintus and Sicstus
Sender: news@let.rug.nl (News system at let.rug.nl)
Message-ID: <1994Oct31.105938.27857@let.rug.nl>
Date: Mon, 31 Oct 1994 10:59:38 GMT
References:  <38jqt7$5bn@coli-gate.coli.uni-sb.de>
Nntp-Posting-Host: loreley.let.rug.nl
Organization: Faculteit der Letteren, Rijksuniversiteit Groningen, NL
Lines: 40

In article <38jqt7$5bn@coli-gate.coli.uni-sb.de>, erbach@coli.uni-sb.de (Gregor Erbach) writes:

> I consider this a bug that should be fixed, and it is causing me some
> trouble in an application where I transform a Prolog program with sorted
> feature terms into a Prolog program in which the sorted feature terms are
> replaced by their Prolog term representation. When I write the output into
> a file, I want to use numbervars/3 to get a neat output, but I want any
> terms of the form '$VAR'(_X123) to be replaced by terms like '$VAR'(A), 
> and not by terms like A, as it is the case with the current implementation.

Not that it adds anything to the discussion about numbervars, but if you want
to use it only to get `neat output', you might consider using the predicate prettyvars/1, contained in the prolog module of sicstus:

(SICStus 2.1 #9:)
| ?- prolog:prettyvars('$VAR'(X)).

X = _ ?

yes
| ?- prolog:prettyvars(['$VAR'(X),X]).

X = A ?

yes
| ?- prolog:prettyvars(['$VAR'(X),X,'$VAR'(Y),Y]),
	write(['$VAR'(X),X,'$VAR'(Y),Y]).
[$VAR(A),A,$VAR(B),B]
X = A,
Y = B ?

yes

etc.


Gosse.

-- 
Gosse Bouma, Alfa-informatica, RUG, Postbus 716, 9700 AS Groningen
gosse@let.rug.nl       tel. +31-50-635937       fax  +31-50-635979
