egraphs-good / eggcc

MIT License
42 stars 8 forks source link

[Interval Analysis] Working examples of using context nodes for interval analysis #445

Closed ajpal closed 5 months ago

ajpal commented 5 months ago

This PR changes to using separate lo-bound and hi-bound tables instead of one ival table (as discussed in lab today)

The first test roughly corresponds to:

if (input <= 0) {
  y = -1 * input
} else {
  y = input
}
return y < 0

And the interval analysis reduces this to just false

The second test roughly corresponds to:

if (0 <= input) {
  y = -1 * input
} else {
  y = input
}
return 0 < y

Which is also false.

oflatt commented 5 months ago

This one will need to be rebased on main (sorry) Should be pretty easy to migrate, lmk if you have problems