calculus-of-constructions icon indicating copy to clipboard operation
calculus-of-constructions copied to clipboard

Lazy evaluation prevents typechecking

Open vincent-163 opened this issue 10 months ago • 0 comments

The expression (a:(.* *) (:(.* a) a)) can be normalized and typed without errors. The type is inferred as (a.(.* *) (.(.* a) (.* *))). However, when inferring the type of that type, the script gives an error (correctly).

I think the issue is that the type of the body of Forall must be type "*", so in :(.* a), a is not a valid body for forall. However, this is not checked due to HOAS semantics, and it proceeds to infer the wrong type without noticing the error.

Since most of the value of CoC lies in robust typechecking, it might be a good idea to either use an implementation that checks types rigorously or make it explicit that not all invalid expressions fail typechecking.

vincent-163 avatar Apr 11 '24 15:04 vincent-163