Re: post-N246 Read- and Write-Option variable_names/1 (Was: DCG restrictions on the left-hand side [Novacore])

Liste des GroupesRevenir à l prolog 
Sujet : Re: post-N246 Read- and Write-Option variable_names/1 (Was: DCG restrictions on the left-hand side [Novacore])
De : janburse (at) *nospam* fastmail.fm (Mild Shock)
Groupes : comp.lang.prolog
Date : 10. Aug 2024, 20:33:31
Autres entêtes
Message-ID : <v98bpp$124d0$1@solani.org>
References : 1 2
User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.2
Hi,
I recently introduce '$VAR'/1 detection in
writing again. I have now a 100% Prolog written
'$VAR'/1 capable output routine.
Somehow I found '$VAR'/1 usueful again, especially
in connection with numbersvars/3 which is in
library(compat) the two make a nice pair
of Swiss army knife for printing. What the
routines don't do, they for example don't check
variable_names/1 option for a cyclic list, so
I currently get:
/* Dogelog Player */
?- VN = ['U'=X,'V'=Y | VN], write_term(f(X,g(Y,X),Y), [variable_names(VN)]), nl.
%%% hangs or I wasn't wainting long enough
But then SWI-Prolog does something strange,
but the error message is funny:
?- VN = ['U'=X,'V'=Y | VN], write_term(f(X,g(Y,X),Y), [variable_names(VN)]), nl.
ERROR: Type error: `list' expected, found `'V'=V' (a compound)
Does the error message use the variable_names/1
association list that is in prepaperation somehow,
as a unintended side effect? Or what explains that
it shows 'V'=V' and not 'V'=Y'? And why does it
complain about compound? And not say something about cyclic?
This here works correctly:
?- VN = ['U'=X,'V'=Y], write_term(f(X,g(Y,X),Y),
    [variable_names(VN)]), nl.
f(U,g(V,U),V)
Mild Shock schrieb:
 UWN is testing Prolog systems that don't exist anymore:
 Jekejeke 1.5.0
https://www.complang.tuwien.ac.at/ulrich/iso-prolog/variable_names#73
 a) There is no more publicitly available Jekejeke
    Prolog anymore, I think I wrote UWN already in the
    past about that.
 b) There is only Dogelog Player, which has a 100%
    Prolog written read/write predicates including
    the variable_name/1 option. Source code is here,
    you also find GIT access etc to the Prolog system:
 Quelltexte und Archive des Dogelog Spieler.
https://www.xlog.ch/izytab/doclet/docs/07_spec/02_dogelog.html
 c) There is an internal version of Jekejeke Prolog,
    which is way after 1.5.0, with version 1.7.0, but
    it also uses the Dogelog Payer 100% Prolog
    written read/write, so no need to test.
  Mild Shock schrieb:
Guess how many newer Prolog systems allow this here:
>
?- [user].
p;q --> r.
    true.
>
On the other hand SWI-Prolog disallows it:
>
?- [user].
p;q --> r.
>
ERROR: user://1:29:
ERROR:    No permission to define dcg_nonterminal `p;q'
 

Date Sujet#  Auteur
30 Jul 24 * DCG restrictions on the left-hand side [Novacore]15Mild Shock
30 Jul 24 +* Re: DCG restrictions on the left-hand side [Novacore]4Mild Shock
30 Jul 24 i`* Re: DCG restrictions on the left-hand side [Novacore]3Mild Shock
31 Jul 24 i `* Re: DCG restrictions on the left-hand side [Novacore]2Mild Shock
31 Jul 24 i  `- Re: DCG restrictions on the left-hand side [Novacore]1Mild Shock
10 Aug 24 +* post-N246 Read- and Write-Option variable_names/1 (Was: DCG restrictions on the left-hand side [Novacore])7Mild Shock
10 Aug 24 i`* Re: post-N246 Read- and Write-Option variable_names/1 (Was: DCG restrictions on the left-hand side [Novacore])6Mild Shock
11 Aug 24 i `* Is a PIP for Syntax extensions necessary? (Was; post-N246 Read- and Write-Option variable_names/1)5Mild Shock
11 Aug 24 i  `* Re: Is a PIP for Syntax extensions necessary? (Was; post-N246 Read- and Write-Option variable_names/1)4Mild Shock
11 Aug 24 i   `* Re: Is a PIP for Syntax extensions necessary? (Was; post-N246 Read- and Write-Option variable_names/1)3Mild Shock
11 Aug 24 i    `* Re: Is a PIP for Syntax extensions necessary? (Was; post-N246 Read- and Write-Option variable_names/1)2Mild Shock
11 Aug 24 i     `- Re: Is a PIP for Syntax extensions necessary? (Was; post-N246 Read- and Write-Option variable_names/1)1Mild Shock
13 Aug 24 `* A PIP classification scheme is needed (Was: DCG restrictions on the left-hand side [Novacore])3Mild Shock
13 Aug 24  `* Re: A PIP classification scheme is needed (Was: DCG restrictions on the left-hand side [Novacore])2Mild Shock
13 Aug 24   `- Re: A PIP classification scheme is needed (Was: DCG restrictions on the left-hand side [Novacore])1Mild Shock

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal