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

let expression interprets tail of a seq1 as a seq1 #669

Closed
ivor-spence opened this issue Mar 1, 2018 · 4 comments
Closed

let expression interprets tail of a seq1 as a seq1 #669

ivor-spence opened this issue Mar 1, 2018 · 4 comments
Labels
bug Incorrect behaviour of the tool Mergable A fix is available on a branch to merge for release
Milestone

Comments

@ivor-spence
Copy link

Description

In a let expression of the form let n = tl l in ...
in which l is of type seq1, the type of n is taken to be seq1 as well. This causes problems if l is of length 1.

Steps to Reproduce

In the quick interpreter type

let n = tl [1] in n

Expected behavior: [What you expect to happen]

I would expect the result to be []

Actual behavior: [What actually happens]

An error is reported because the type of n is assumed to be seq1 of nat meaning that it can't be empty. Its type should be seq of nat.

Reproduces how often: [What percentage of the time does it reproduce?]

Every time.

Versions

Which version of Overture are you using? Also, please include the OS and what version of the OS you're running.

Version 2.5.4 of Overture running on Windows 10

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

@peterwvj
Copy link
Member

peterwvj commented Mar 2, 2018

Yes, this definitely looks like a bug. I can produce it using Overture 2.6.0 as well.

@peterwvj peterwvj added the bug Incorrect behaviour of the tool label Mar 2, 2018
@peterwvj peterwvj added this to the v2.6.2 milestone Mar 2, 2018
@nickbattle
Copy link
Contributor

Thanks for reporting this. It should be a simple fix. I'll look at it later today.

@nickbattle
Copy link
Contributor

This was an error in the type checking of the tail expression. It didn't correctly deal with seq1, assuming that the result of the tail was the same type as the argument. The change affects the proof obligation tests as well, as you might expect. Just testing now, then I'll check it in.

@nickbattle nickbattle added the Mergable A fix is available on a branch to merge for release label Mar 2, 2018
@ivor-spence
Copy link
Author

ivor-spence commented Mar 2, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behaviour of the tool Mergable A fix is available on a branch to merge for release
Projects
None yet
Development

No branches or pull requests

3 participants