lambdapi icon indicating copy to clipboard operation
lambdapi copied to clipboard

Spurious unification error when checking Dedukti file

Open rish987 opened this issue 2 years ago • 4 comments

The following Dedukti file contains a syntax error, but also reports a unification error that only appears when the syntax error (or any other error) is present:

A: Type.
B: Type.

a: A.

def f : B -> A -> A.

[] f _ (f _ _) --> a.

[] f _ _ --> a.

: (; produces error ;)

This is the error:

$ lambdapi check test.dk --lib-root=.
Checking "test.dk" ...
[test.dk:12:0-1] [A] and [B] are not unifiable.
Unexpected token ":".

dk check only reports the syntax error (and succeeds when it is removed):

$ dk check test.dk
[ERROR CODE:702]  [test.dk] [line:12 column:0] 
Parsing error: Unexpected token ':'.

rish987 avatar Nov 09 '23 16:11 rish987

I cannot reproduce your error. I works for me with lambdapi 2.4.0 and master. Which version of lambdapi do you use? Perhaps you have some hidden invalid character in your file?

fblanqui avatar Nov 13 '23 14:11 fblanqui

That's odd. I just updated to lambdapi 2.4.0 from lambdapi 2.1.0, but was still able to reproduce the error. I also was able to reproduce it with a fresh install of lambdapi 2.4.0 on a separate machine.

rish987 avatar Nov 13 '23 16:11 rish987

I see now. The problem is caused by the colon at the end. This is strange indeed.

fblanqui avatar Nov 13 '23 17:11 fblanqui

Yes, in fact, any error that results in error output will show it (syntax error, typing error, etc.).

rish987 avatar Nov 13 '23 17:11 rish987