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

Verus automatically selects non-user-selectable triggers #1363

Open
matthias-brun opened this issue Dec 13, 2024 · 1 comment
Open

Verus automatically selects non-user-selectable triggers #1363

matthias-brun opened this issue Dec 13, 2024 · 1 comment

Comments

@matthias-brun
Copy link
Collaborator

Verus disallows user-chosen triggers on tuple constructors (e.g. #[trigger] (a, b)) but automatically selected triggers sometimes do involve tuples. E.g. the following example has no valid user-selectable triggers but Verus automatically picks a trigger involving the tuple constructor.

use vstd::prelude::*; verus!{

struct Foo { s: (usize,usize) }

proof fn f()
    ensures forall|f: Foo, a: usize, b: usize| f.s == (a, b) ==> true
{}

}

This generates the following AIR for the ensures:

;; Function-Specs test::f
(declare-fun ens%test!f. (Int) Bool)
(axiom (forall ((no%param Int)) (!
   (= (ens%test!f. no%param) (forall ((f$ Poly) (a$ Poly) (b$ Poly)) (!
      true
      :pattern ((test!Foo./Foo/s (%Poly%test!Foo. f$)) (tuple%2./tuple%2 a$ b$))
      :qid user_test__f_0
      :skolemid skolem_user_test__f_0
   )))
   :pattern ((ens%test!f. no%param))
   :qid internal_ens__test!f._definition
   :skolemid skolem_internal_ens__test!f._definition
)))

I vaguely remember there being a discussion about triggering on tuples being important for some particular use case (maybe at the Verus retreat?) so I'm wondering if this is intentional or not. It is certainly surprising behavior.

@utaal
Copy link
Collaborator

utaal commented Jan 13, 2025

Relevant: #1199

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

2 participants