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

Empty natural transformation in yellow-safe constraint #232

Open
shingarov opened this issue Mar 5, 2024 · 0 comments
Open

Empty natural transformation in yellow-safe constraint #232

shingarov opened this issue Mar 5, 2024 · 0 comments

Comments

@shingarov
Copy link
Owner

The following should typecheck trivially (yellow safe), as there are no refinements. Instead, it crashes due to empty natural transformation:

⟦measure len : list(''a) => int⟧
type list(''a) =
  | Nil                        => [v| v∘len === 0]
  | Cons (x:''a, xs:list(''a)) => [v| v∘len === (xs∘len + 1)]
  ;
⟦val range : i:int => j:int => list(int) ⟧
let rec range = (i, j) => {
  let cond = i < j;
  if (cond) {
    let i1 = i + 1;
    let tl = range(i1, j);
    Cons(i, tl)
  } else {
    Nil
  }
};

This stands in the way of L₇ test range.
We delay this problem until we have datatypes over Z3 datatypes.

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