Page 283 - Artificial Intelligence for the Internet of Everything
P. 283

Compositional Models for Complex Systems  261


              of the interface is the product of parameter spaces for each parameter of each
              boundary of the interface. In a simplistic model, a window boundary might
              define a state space Bool Temp Temp, where the first parameter defines
              whether the window is open or closed, and the last two define the temper-
              atures inside and outside the window, respectively. Sometimes, we may also
              wish to include plausibility constraints on the state space; for example, we
              might demand that when the window is open, then T in ¼ T out.
                 An operation is a decomposition of the system into components and
              boundaries. This decomposition imposes constraints between the states of
              component interfaces as well as the system boundaries. To define logical
              semantics for an operation, we form the joint state space of all component
              and system interfaces and identify which joint states can possibly be satisfied
              given the architecture. In the example from Fig. 13.1B, the joint state space
              might look like:
                      HVAC system           Therm component
                     zfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}|fflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{
                                        zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}|fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{
                     ðFloat sys  Temp Þ  ðFloat read  Temp
                                   sys                 therm Þ
                             AC component         Heat component
                         zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}|fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{  zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}|fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{
                        ðBool AC  Temp    Þ ðBool heat  Temp
                                        AC                   heat Þ
                                       Ctrl component
                         zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}|fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{
                        ðFloat set  Float meas  Bool cool  Bool warm Þ
                 The specific architecture then defines a relation over this state space.
              Usually, this relation just couples together variables that are linked by an
              interaction in the diagram. Here, we would have:

                         ðF sys ¼ F set Þ^ðF meas ¼ F read Þ^ðB warm ¼ B heat Þ

                            ^ðB cool ¼ B AC Þ^ðT sys ¼ T therm ¼ T AC ¼ T heat Þ
              Some interactions, especially those governing interactions between three or
              more boundaries, may require more sophistication. In the context of elec-
              trical circuits, voltages across a bus are equal but currents add. In our exam-
              ple, the temperature of the air is equal at all boundaries (assuming mixing),
              but dynamical quantities like the energy input at an air boundary would
              require more sophistication.
                 Recall that in addition to an architecture, the decomposition phase pro-
              duces a contract for each component, which we will write with double
              brackets ⟦C⟧   StateðCÞ. Analogously, we may write ⟦d⟧ for the constraint
   278   279   280   281   282   283   284   285   286   287   288