scryer-prolog icon indicating copy to clipboard operation
scryer-prolog copied to clipboard

Dynamic issue

Open ghost opened this issue 5 years ago • 2 comments

The following happens on a 64bits machine:

$ cat dyn1.pl
:- module(dyn, [a/18446744073709551615]).

:- dynamic(a/18446744073709551615).
$ cat dyn2.pl
:- module(dyn, [a/18446744073709551616]).

:- dynamic(a/18446744073709551616).
$ scryer-prolog
?- use_module(dyn1).
   true.
?- use_module(dyn2).
caught: error(syntax_error(invalid_module_declaration),use_module/1)
?- 

ghost avatar May 18 '20 13:05 ghost

Currently not even the first module works:

?- use_module(dyn1).
   error(syntax_error(invalid_head_of_rule),load/1).
?- use_module(dyn2).
   error(syntax_error(invalid_module_declaration),load/1).

From my tests it starts throwing an syntax_error(invalid_head_of_rule) at arity 1024. Maybe that's intentional? Currently it seems the maximum arity is 1023:

?- current_prolog_flag(max_arity, MaxArity).
   MaxArity = 1023.

bakaq avatar Dec 12 '23 19:12 bakaq

This seems to be a candidate for a representation error, because the syntax is correct.

7.12.2 Error classification
...

  f) There shall be a Representation Error when an
  implementation defined limit has been breached. It has
  the form representation_error(Flag) where

...
  i) There shall be a Syntax Error when a sequence
  of characters which are being input as a read-term
  do not conform to the syntax. It has the form
  syntax_error(imp_dep_atom) where imp_dep_atom
  denotes an implementation dependent atom.

triska avatar Dec 12 '23 20:12 triska