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

Add test for range propagation over shift operators #14

Open
emwap opened this issue Oct 20, 2012 · 4 comments
Open

Add test for range propagation over shift operators #14

emwap opened this issue Oct 20, 2012 · 4 comments

Comments

@emwap
Copy link
Member

emwap commented Oct 20, 2012

There is no test case for range propagation over shift operators. Also, the implementation should be updated to propagate over signed operands.

This blocks #13.

@pjonsson
Copy link
Member

There are properties for shiftL/shiftR already defined in Test.hs (prop_shiftLU/prop_shiftRU) but they're not wired into the test harness. I didn't manage to wire them in when I tried though.

@emwap
Copy link
Member Author

emwap commented Oct 24, 2012

I have added these tests on the issue14 branch. However, the range propagation for shift operations is still lacking.

@pjonsson
Copy link
Member

Doesn't the code I initially attached enable that range propagation? The tests you added pass in my tree.

@emwap
Copy link
Member Author

emwap commented Oct 24, 2012

Somewhat. rangeShiftLU improves the propagation if the first operand is unsigned, but it returns universal for signed operands.

The test case I just enabled only checks that the range is safe; i.e. that the result of evaluating the function stays within the propagated range.
It does not check that the range is tight which means that if the propagated range is universal the test will always pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants