Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Constructing terms. f(X) should become f(X1)

Status
Not open for further replies.

joc0611

Technical User
May 24, 2009
1
DE
Hello all!

I'm currently working on a larger Prolog project and came across a problem I couldn't solve yet.

I have a term f(X), where X is an free variable and I would like "rename" this variable to X1 to obtain the term f(X1). So basically I need a predicate

rename(OldTerm, Suffix, NewTerm),

which called with

rename(f(X), 1, NewTerm)

results in

NewTerm = f(X1).

I'm grateful for every idea/hint/advice

Thanks!

Joc
 
If you use SWI-Prolog, I don't think it's possible.
But the question is "Why do you want to do this ?" Can't you use another approach ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top