LPCIC / elpi

Embeddable Lambda Prolog Interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assertion failures when clauses have flexible heads

mb64 opened this issue · comments

There are two ways to declare a clause (hypothetical vs top-level), and each triggers a different assertion error when used with a flexible head.

In a file:

% test.elpi
F.
$ elpi -exec hi test.elpi

Parsing time: 0.000
Called from Dune__exe__Elpi_REPL in file "elpi_REPL.ml", line 184, characters 17-43
Called from Elpi__Compiler.Compiler.run in file "src/compiler.ml", line 2314, characters 4-62
Called from Elpi__Util.map_acc in file "src/util.ml", line 342, characters 4-85
Called from Stdlib__list.fold_left in file "list.ml", line 121, characters 24-34
Called from Elpi__Util.map_acc.(fun) in file "src/util.ml", line 342, characters 47-52
Called from Elpi__Compiler.Compiler.compile_clause in file "src/compiler.ml", line 2239, characters 8-63
Anomaly: claux1 called on non-heap term

In a hypothetical clause:

$ elpi -exec '(pi F\ F) => hi'
...
Fatal error: exception File "src/runtime_trace_off.ml", line 2542, characters 29-35: Assertion failed

It would be nice to get an error message similar to when a goal is flexible ("Fatal error: The goal is a flexible term").

(This is a manufactured edge case -- I didn't run into it in actual code -- so I think this is relatively low-priority.)