Scryer-prolog: ISO predicates: status quo

Created on 15 Aug 2017  路  16Comments  路  Source: mthom/scryer-prolog

I hope the following table regarding the status quo of ISO predicates is useful for you at some point:

http://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue#status_quo

For example, please note that not/1 is not ISO! In this particular case, please consider using the ISO predicate (\+)/1 instead.

Most helpful comment

See this. For USD 60 you get 13211-1 1995 as "INCITS/ISO/IEC 13211-1:1995[R2012]". The actual standard is USD 232 or even USD 503. The INCITS version is just the same as the original with an "enhanced" coversheet. All the three corrigenda are free. I have their "working draft version" online, too. 13211-2 is not really worth the cost. Rather study SICStus Prolog for a good module system.

Maybe look around standardization bodies, they often give away standards at even lower prices (they get paid to do that, just want to ensure that it's not a token purchase).

All 16 comments

User-defined operators are next on the TODO. not/1 will be on the chopping block after (\+)/1 is added.

Great! Even without operators though, can you not simply provide the predicate \+/1 already?

For example:

?- \+(false).
true.

There are a few parsing issues to be addressed before that can be done.

Is there any commitment to go for ISO or not? So far, there are many non-standard syntax features while basic syntax still is not present.

There is. I started the project knowing only a little about Prolog. Part of my intent behind the project is to become an expert.

There is no mentioning in README.md about commitment to ISO ; which b.t.w. is the reason I've been looking into your system only now, after I got some nudges.

Would it be worthwhile for me to purchase a copy of the standard? I don鈥檛 imagine it鈥檚 changed much since 1995.

See this. For USD 60 you get 13211-1 1995 as "INCITS/ISO/IEC 13211-1:1995[R2012]". The actual standard is USD 232 or even USD 503. The INCITS version is just the same as the original with an "enhanced" coversheet. All the three corrigenda are free. I have their "working draft version" online, too. 13211-2 is not really worth the cost. Rather study SICStus Prolog for a good module system.

Maybe look around standardization bodies, they often give away standards at even lower prices (they get paid to do that, just want to ensure that it's not a token purchase).

One of the ideas behind the list status quo was to give implementer an easy-to-copy checklist (view source!). But when I look into src/prolog/lib/builtins.pl I see just chaos. How can you tell what exactly you are doing?

It's been totally ad hoc up to this point. The module export list is the only thing I use to keep things straight. @pmoura brought up a related point.. which predicates should go into builtins.pl, and which into non_iso.pl?

From the standard's viewpoint there is:

  • 13211-1 core

  • 13211-2 modules - here mostly a couple of built-in predicates. The document itself does not help much as it contains possibilities to loosen it up a lot. Go for SICStus

  • 13211-3 DCG, still a draft. But currently changes are only on a codificatory level

  • Prolog prologue - a few generally agreed upon definitions that may go in some module. This is not a formal standard, though

  • clpfd - the libraries in SICStus, SWI, and clpz are standard conforming (that is, for those issues 13211-1 requires conformance. That is, errors and the like.)

  • other code - please note that for such code, the very same errors etc. are relevant.

The module export list contains (^)/2. What is this?

... also many other arithmetic operators. How can you distinguish such an evaluable functor from a predicate?

(^)/2 is just the operator export. Evaluable functors are either compiled to three-address instructions or evaluated dynamically depending on how much information there is at compile time.

I have never seen a module system where predicates and operators are exported in exactly the same way. This is really odd. All other systems write Name/Arity and Nonterminal//Arity to designate predicates and non-terminals and some offer operator export with op(Pri,Fix,Op) in that list. But not the same...

Well, yes. The decision was made some time ago.. I wasn't following SICSTUS very closely. And now I have to go back and revise most things. That's the price I pay.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

triska picture triska  路  4Comments

triska picture triska  路  3Comments

UWN picture UWN  路  3Comments

triska picture triska  路  3Comments

XVilka picture XVilka  路  3Comments