Grammar in choice-domain documentation is incorrect
langston-barrett opened this issue · comments
Langston Barrett commented
The grammar for choice-domain
looks like this:
<relation-declaration> ::= ".decl" <relation-name> "(" <attributes> ")" <choice-domain>
<choice-domain> ::= "" | "choice-domain" (<constraint>)+
<constraint> ::= <attribute> | "(" <attributes> ")"
The <attributes>
non-terminal is not defined, but if we assume from context that it's what fits between the parentheses in a .decl
, it should have the form <variable>: <type>, ...
. But that isn't true:
.decl foo(x: number, y: number) choice-domain (x: number, y: number)
$ souffle --version
Souffle: 2.0.2-987-gbcb2a08e5(32bit Domains)
Copyright (c) 2016-19 The Souffle Developers.
Copyright (c) 2013-16 Oracle and/or its affiliates.
$ souffle test.dl
Error: syntax error, unexpected :, expecting ) or "," in file test.dl at line 1
.decl foo(x: number, y: number) choice-domain (x: number, y: number)
------------------------------------------------^--------------------
1 errors generated, evaluation aborted
Instead, two different non-terminals are needed, one for <relation-declaration>
and one for <constraint>
, where the latter just includes variable names but the former includes their types.
Bernhard Scholz commented
Thanks for noting this. Can you rewrite the documentation accordingly? Many thanks.