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

Type inference for int constants worse in pulse functions #185

Open
JonasAlaif opened this issue Aug 27, 2024 · 0 comments
Open

Type inference for int constants worse in pulse functions #185

JonasAlaif opened this issue Aug 27, 2024 · 0 comments

Comments

@JonasAlaif
Copy link

JonasAlaif commented Aug 27, 2024

The following snippet highlights the issue:

open Pulse.Lib.Pervasives

#lang-pulse

val rnat (p: FStar.Seq.seq nat): slprop

let works = rnat seq![0]

fn foo_works ()
  requires emp
  ensures  rnat seq![0 <: nat]

fn foo ()
  requires emp
  ensures  rnat seq![0]

I get a Assertion failed error (also not a very intuitive error, e.g. seq int is not a subtype of seq nat would be better). The error is due to seq![0] typing as FStar.Seq.seq int in the Pulse postcondition (this also happens in the body of a pulse function).

This happens even when using seq![x; x; 0] with x: nat or when writing out the seq! as conss. The surprising thing to me is that it works in the F* code but not pulse.

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

No branches or pull requests

1 participant