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

Constant input passed to non-constant formal input #439

Closed
AdrienChampion opened this issue Dec 23, 2016 · 0 comments
Closed

Constant input passed to non-constant formal input #439

AdrienChampion opened this issue Dec 23, 2016 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@AdrienChampion
Copy link
Contributor

The bug happens when a node has a constant input and passes it through a call to a subnode accepting non-constant inputs.

node count (in: bool) returns (cnt: int) ;
let
  cnt = (if in then 1 else 0) + (0 -> pre cnt) ;
tel

node top (const in: bool) returns (cnt: int) ;
(*@contract
  guarantee cnt >= 0 ;
*)
let
  cnt = count(in) ;
tel

The actual problem is an arity mismatch at SMT-level between the signature of the subnode and the way the caller uses it. That's because the constant state variable is only passed once since it's constant, where as the subnodes expects to see the previous and current versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants