BerkeleyLearnVerify / Scenic

A compiler and scenario generator for the Scenic scenario description language.
https://scenic-lang.org/
Other
274 stars 92 forks source link

Boolean negation doesn't work deep inside a requirement #286

Closed dfremont closed 2 months ago

dfremont commented 3 months ago

System Details

  1. Python 3.11.1
  2. Scenic 3.0.0 (on main)
  3. macOS

Detailed Description

When the not operator is used inside a require statement but inside a more complex expression (not consisting only of temporal/Boolean operators), the resulting requirement does not evaluate correctly. Looking at the compiled AST, the problem is that the not is being compiled to a PropositionNot object even though it's already inside an atomic proposition.

Thanks to Daniel Genin for discovering this issue!

Steps To Reproduce

Running the following scenario (with no options) shows that the requirement is not enforced:

ego = new Object
other = new Object at (Range(-1, 1), 5)
require all([not other.x > 0])

Issue Submission Checklist

dfremont commented 2 months ago

Fixed in #289.