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

Typechecking of subtraction with natural numbers #32

Open
jameseb7 opened this issue May 19, 2021 · 1 comment
Open

Typechecking of subtraction with natural numbers #32

jameseb7 opened this issue May 19, 2021 · 1 comment

Comments

@jameseb7
Copy link
Collaborator

Currently, the type system for RoboChart defines the type of a subtraction applied to two natural numbers to be of the integer type. While this makes sense due to the fact the result could be negative, it prevents using the result as part of a counting down pattern such as count = count - 1, where count has type nat. Here count may never actually go negative, and showing that it does not go negative is a separate proof obligation, but the pattern in general is not erroneous. It may be better to allow the result of subtracting naturals to be a natural, and let FDR reject cases where the number goes outside the bounds of the natural number type.

@alvarohm
Copy link
Contributor

alvarohm commented May 19, 2021 via email

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