Re: How to replace a term to the inside of an other term?
- From: Joachim Schimpf <j.schimpf@xxxxxxxxxxxxxxx>
- Date: Thu, 25 May 2006 13:08:42 GMT
student wrote:
With this program and SWI-Prolog Version 5.4.6
I get
?- replace(4, 4, h(999), T1).
T1 = h(999) ;
No
Unfortunately, you rely here on a bug in SWI-Prolog:
?- X =.. [foo(a)].
X = foo(a)
Yes
This isn't standard-conforming and should make a type error.
And before someone claims that it's a feature: =../2 is
supposed to be logical and deterministic, so you can't have
both foo(a)=..[foo,a] and foo(a)=..[foo(a)] being true.
As exemplified by
?- foo(a)=..[foo(a)].
No
-- Joachim
.
- Follow-Ups:
- References:
- How to replace a term to the inside of an other term?
- From: Mika
- Re: How to replace a term to the inside of an other term?
- From: student
- Re: How to replace a term to the inside of an other term?
- From: Joachim Schimpf
- Re: How to replace a term to the inside of an other term?
- From: student
- How to replace a term to the inside of an other term?
- Prev by Date: [ICLP'06] Call for participation
- Next by Date: Re: How to replace a term to the inside of an other term?
- Previous by thread: Re: How to replace a term to the inside of an other term?
- Next by thread: Re: How to replace a term to the inside of an other term?
- Index(es):
Relevant Pages
|