scryer-prolog
scryer-prolog copied to clipboard
Dynamic issue
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)
?-
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.
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.