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

Can not handle abstraction over constructor #7

Open
xieyuheng opened this issue Oct 28, 2022 · 2 comments
Open

Can not handle abstraction over constructor #7

xieyuheng opened this issue Oct 28, 2022 · 2 comments

Comments

@xieyuheng
Copy link
Member

The following definition of sub-to-zero
with an abstraction my-add1 over constructor add1
can not pass termination-check:

(data Nat () ()
  [zero () Nat]
  [add1 ([prev Nat]) Nat])

(fn my-add1 (-> Nat Nat)
  [(x) (add1 x)])

(fn sub-to-zero (-> Nat Nat)
  [((zero)) zero]
  [((add1 (zero))) zero]
  [((add1 (add1 x))) (sub-to-zero (my-add1 x))])

test: https://github.com/cicada-lang/mugda/blob/master/tests/termination/sub-to-zero-indirect-add1.error.mu

@xieyuheng
Copy link
Member Author

We need to compare with Coq and Agda to see should this work or not.

@xieyuheng xieyuheng changed the title can not handle abstraction over constructor Can not handle abstraction over constructor Oct 28, 2022
@xieyuheng
Copy link
Member Author

Maybe we can solve this by

  • comparing Value with Pattern
  • instead of comparing Exp with Pattern

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