« Return to Thread: Inconsistent behaviour of assert/2

Re: Inconsistent behaviour of assert/2

by Ulrich Neumerkel :: Rate this Message:

Reply to Author | View in Thread

Sun, 28 Jun 2009 16:18:41 +0200, Jan Wielemaker writes:

>On Saturday 27 June 2009 20:20:27 Günter Kniesel wrote:
>
>> However, that would only partly remove the cause of the confusion,
>> which, in the first place, is the non-uniform semantics of the
>> arguments to assert and clause. So I'm curious to know why
>> there isn't an assert(Head,Body) that mirrors clause(Head,Body)?
>>
>> Why does "clause" hide the nature of clauses as :-/2 terms whereas
>> "assert" cannot even be used without understanding that clauses are
>>
>> :-/2 terms?
>>
>> This might have historical reasons but, in hindsight, is it a good
>> design that one should pursue further? Uniformity and consistency
>> in a language design have many advantages. Easier learning by novices
>> is just one of them.

There are more fundamental problems with Prolog's term representation.
In particular the defaulty role of control constructs like (',')/2
which makes writing meta-interpreters and other meta-programs
unnecessarily complex and impure.

The original representation of Prolog programs, using a prefix + for
heads and - for goals led itself more naturally to a clean
representation.

It is often preferable to transform clauses into a more appropriate
representation.  In partiuclar in the context of programming courses.


Markus Triska has compiled a discussion related to this under
http://stud4.tuwien.ac.at/~e0225855/acomip/acomip.html

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

 « Return to Thread: Inconsistent behaviour of assert/2