next up previous contents index
Next: Domain Manager Up: SPL Pushlogic Language Reference Previous: Standard Environment   Contents   Index

Plant Model

Instead of being executable, a bundle may be a plant model. A plant model mirrors the behaviour of the physical world system or plant. In many real systems, there are predictable effects from the output of actuators that may be detected by sensors. These feedback effects can cause undesirable effects, such as deadlock or oscillations, that Pushlogic can detect before they occur. Run-time monitoring of the conformance of the real system with its world model can also detect various faults and failures in sensors and actuators and so on.

A plant (world) model declaration uses the keyword sequence `def world'. The bundle content is a list of declarations and statements, like any other bundle.

For example

 def world name()
  {
    input plant#heater#setting : { off: lo, hi };
    output plant#ambient#temperature : { -273 .. 1000 };

    forever
    {
      sleep_seconds(1);
      if (setting==hi && temperature < 90) temperature += 3;
      else if (setting==lo && temperature < 90) temperature += 1;
      else if (setting==off && temperature > 0) temperature -= 1;
    }

  }

A plant model generates bytecode that does not execute on any platform, but which is used for bundle consistency checking.

The sequence `def plant' can be used instead of `def world' to define a world model: it makes no difference at the moment.

Run-time checking of the real plant's consistency with world models will be implemented.


next up previous contents index
Next: Domain Manager Up: SPL Pushlogic Language Reference Previous: Standard Environment   Contents   Index
David Greaves 2009-04-20