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

Singleton list for Unique typechecks #41

Open
Pat-Lafon opened this issue Aug 23, 2024 · 0 comments
Open

Singleton list for Unique typechecks #41

Pat-Lafon opened this issue Aug 23, 2024 · 0 comments

Comments

@Pat-Lafon
Copy link
Contributor

I'm getting back into the swing of things and identifying blockers for Cobb(Coverage Type synthesis). The following is a program that Poirot typechecks incorrectly using

dune exec -- bin/main.exe type-check meta-config.json data/issue/singleton_unique.ml

let rec unique_list_gen (s : int) : int list =
  if sizecheck s then []
  else
    let (l : int list) = unique_list_gen (subs s) in
    let (x : int) = int_gen () in
    if list_mem l x then Err else x :: Nil

let[@assert] unique_list_gen =
  let s = (v >= 0 : [%v: int]) [@over] in
  (len v s && uniq v : [%v: int list]) [@under]

Note that the branch with the mem check does seem relevant, though l can be assigned to Nil without issue.

Ideally this is just a simple issue around the axioms for len/uniq predicates or messing with the measure

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