Re: ASSERT in SWI Prolog



In message <ebrnrb$deo$1@xxxxxxxxxxxxxxxx>, russell kym horsell <kym@xxxxxxxxxxxxxxxxxxx> writes
Mika <miky821@xxxxxxxx> wrote:
I want to know if this can be made in SWI Prolog.

OK. The answer is "yes".

The answer to the question "is it pretty?", is -- of course -- "no".

It's not that ugly. Use bagof to collect all the facts into a list, process the list to replace fact2 by fact6, retractall the facts, and then assert the facts in the list. Though I can't imagine why anyone would want to do this.

Nick
--
Nick Wedd nick@xxxxxxxxxxxxx
.