hydromatic / morel

Standard ML interpreter, with relational extensions, implemented in Java
Apache License 2.0
297 stars 15 forks source link

Improve deduction of ranges #229

Open julianhyde opened 3 hours ago

julianhyde commented 3 hours ago

Improve deduction of ranges. Instead of

from z in [1, 2, 3, 4, 5, 6, 7, 8],
  x in [1, 2, 3, 4, 5, 6, 7, 8],
  y in [1, 2, 3, 4, 5, 6, 7, 8]
where x + y = z

we should be able to write

from z in [1, 2, 3, 4, 5, 6, 7, 8],
  x,
  y
where x + y = z andalso x > 0 andalso y > 0
julianhyde commented 3 hours ago

Dev branch: https://github.com/julianhyde/morel/tree/229-range