Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible: ill-typed application on inference #1066

Closed
mtzguido opened this issue Jun 1, 2017 · 1 comment
Closed

Impossible: ill-typed application on inference #1066

mtzguido opened this issue Jun 1, 2017 · 1 comment
Labels

Comments

@mtzguido
Copy link
Member

mtzguido commented Jun 1, 2017

Getting an inference blowup with the following code:

module A

assume val m : Type -> Type
assume val return_m : #a:Type -> a -> m a
assume val bind_m : #a:Type -> #b:Type -> m a -> (a -> m b) -> m b
assume val push_m : #a:Type -> #b:(a -> Type) -> (x:a -> m (b x)) -> m (x:a -> b x)

val push_sum : #a:Type -> #b:(a -> Type) ->
                  dtuple2 a (fun (x:a) -> m (b x)) -> m (dtuple2 a b)
let push_sum (#a:Type) (#b:(a -> Type)) (p : (dtuple2 a (fun (x:a) -> m (b x)))) =
    match p with
    | Mkdtuple2 x y ->
        bind_m #(b x) (* #(dtuple2 a b) *) y (fun (y' : b x) ->
        return_m (* #(dtuple2 a b) *) (Mkdtuple2 x y'))

Running F* gives:

Unexpected error; please file a bug report, ideally with a minimized version of the source program that triggered the error.
Impossible: ill-typed application ?26724 : Type
	a:Type ->
b:(uu___151587:a -> Prims.Tot Type) -> p:x:a & A.m (b x) -> x:a -> y:A.m (b x) -> Prims.Tot Type

The example is a bit complex, but I couldn't really minimize it any more. Uncommenting any of the two #(dtuple2 a b) annotations makes the file succeed.

I think inference should succeed here, but even if not, this is a blowup and should be a proper error

@mtzguido
Copy link
Member Author

mtzguido commented Oct 4, 2017

This doesn't blow up anymore, but fails due to #1091 at encoding time (so --lax works OK). Closing this one and commenting there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants