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

Unsoundness due to bad simplification #3213

Closed
mtzguido opened this issue Feb 9, 2024 · 0 comments · Fixed by #3214
Closed

Unsoundness due to bad simplification #3213

mtzguido opened this issue Feb 9, 2024 · 0 comments · Fixed by #3214
Assignees
Labels
kind/unsoundness A bug that has the potential to cause unsoundness, be it ill-typing or proofs of False

Comments

@mtzguido
Copy link
Member

mtzguido commented Feb 9, 2024

(* culprit *)
let bad ()
  : Lemma (forall (f : int -> Type0). (forall (x : nat). f x) ==> f (-1)) = ()

let forall_elim (#a: Type) (p: (a -> GTot Type)) (x:a)
  : Lemma (requires forall (x: a). p x) (ensures p x) = ()

let falso () : Lemma False =
  bad();
  let f (x:int) : Type0 = x >= 0 in
  forall_elim #(int -> Type0) (fun f -> (forall (x : nat). f x) ==> f (-1)) f;
  ()

Posting a PR soon. The bad lemma is working due to a bad simplification step in the normalizer, which considers that f is universally true, so it's ok to rewrite f (-1) to True, failing of course to consider that nat is not int.

@mtzguido mtzguido added the kind/unsoundness A bug that has the potential to cause unsoundness, be it ill-typing or proofs of False label Feb 9, 2024
@mtzguido mtzguido self-assigned this Feb 9, 2024
mtzguido added a commit to mtzguido/FStar that referenced this issue Feb 9, 2024
@mtzguido mtzguido mentioned this issue Feb 9, 2024
mtzguido added a commit that referenced this issue Feb 9, 2024
mtzguido added a commit to mtzguido/FStar that referenced this issue Feb 12, 2024
mtzguido added a commit that referenced this issue Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/unsoundness A bug that has the potential to cause unsoundness, be it ill-typing or proofs of False
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant