phillipstanleymarbell / Noisy-lang-compiler

Noisy language compiler
MIT License
17 stars 1 forks source link

Logic Operator on Invariants #108

Open hyuglim opened 7 years ago

hyuglim commented 7 years ago

Before working on this, it is probably necessary to consider https://github.com/phillipstanleymarbell/Noisy-lang-compiler/issues/107 for reasons to be explained later.

Consider invariants A, B, and C. A operates on a parameter of type acceleration@0 and B operates on a parameter of type acceleration@1.

We want an invariant to be able to operate not only on Physics parameters, but also on other invariants, in order to enable logic operators on A and B. In short, we want to implement a feature where a constraint in C can have a logical expression not A and B

This feature will make the concept of an invariant more powerful and more expressive.

hyuglim commented 7 years ago

Additional Note:

Many sensor values are dependent on other sensor values. If Sensor A reads a certain value, that may have implications for the range of values owned by Sensor B. There are examples of this in cars and airplanes. In cars, Power Train Module sensor indicates what gear a car is in. Depending on the value of the gear sensor, the maximum tolerable engine speed may be different. In airplanes, if altitude sensor indicates the altitude is x, there are limits on what the velocity should be (detected by a velocity sensor).

So the operators that I think we should at least support in the future are the following.

  1. NOT
  2. AND
  3. OR
  4. parens ()
  5. IMPLIES

1, 2, 3, and 4 are important (we don't want to provide just NAND) if and only if notation can be sufficed by 5 going in both directions.