

In the following, we will prove the equivalence of different forms of the transition relation of the control flow of Quartz programs. To be able to later on prove the equivalence with the code generation where a start signal is assumed, we allow thereby that the start signal can be given at all points of time where the control flow is not inside a statement or in case the statement currently terminates. Thus, we assume (st -> (!insdS | termS)). Together with the control flow invariants that are easily proved by induction on the statements, we then have the following care set:

    (st → (¬insdS ∨ termS)) ∧ 
    (enterS → nextInsdS) ∧ 
    (instS → ¬enterS) ∧ 
    (termS → insdS) ∧ 
    (moveS → insdS) ∧ 
    (moveS → nextInsdS) ∧ 
    (moveS → ¬termS)

Interestingly, we allow to start an execution at termination time of another one, an if the one started would be instantaneous, both will be finished at the same time. The transition relation that describes the lifetime of the control flow from either instantaneously executing, entering, moving inside, terminating, or being idle after termination would then be as follows:

    st ∧ (¬insdS ∨ termS) ∧ instS ∧ ¬nextInsdS ∨ 
    st ∧ (¬insdS ∨ termS) ∧ enterS ∨ 
    moveS ∨ 
    ¬st ∧ (¬insdS ∨ termS) ∧ ¬nextInsdS

Using logic minimization with the above care set, we obtain the following optimized form:

    st ∧ instS ∧ ¬nextInsdS ∨ 
    st ∧ enterS ∨ 
    moveS ∨ 
    ¬st ∧ (¬insdS ∨ termS) ∧ ¬nextInsdS
  
So, the logic minimizer only replaced st ∧ (¬insdS ∨ termS) by st since the former can be deduced with st from the invariants, i.e., from (st → (¬insdS ∨ termS)). If we exclude (st → (¬insdS ∨ termS)) from the care set, then the logic minimizer yields 

    (¬insdS ∨ termS) ∧ instS ∧ ¬nextInsdS ∨ 
    st ∧ (¬insdS ∨ termS) ∧ enterS ∨ 
    moveS ∨ 
    ¬st ∧ (¬insdS ∨ termS) ∧ ¬nextInsdS ∨ 

Note that just the occurrence of st in the first line has been removed which is actually redundant since whether started or not, the control flow will not (re-)enter the statement.


Now, let us consider an equivalent conjunctive formulation. Using some propositional provers like a SAT solver or a BDD package, we can easily prove that the following is a tautology:

(
    (enterS → nextInsdS) ∧ 
    (instS → ¬enterS) ∧ 
    (termS → insdS) ∧ 
    (moveS → insdS) ∧ 
    (moveS → nextInsdS) ∧ 
    (moveS → ¬termS)
)
->
(
 (
    st ∧ (¬insdS ∨ termS) ∧ instS ∧ ¬nextInsdS ∨ 
    st ∧ (¬insdS ∨ termS) ∧ enterS ∨ 
    moveS ∨ 
    ¬st ∧ (¬insdS ∨ termS) ∧ ¬nextInsdS
 )
 <->
 (
    (st ∧ (¬insdS ∨ termS) ∧  instS → ¬nextInsdS) ∧ 
    (st ∧ (¬insdS ∨ termS) ∧ ¬instS → enterS) ∧ 
    (insdS ∧ ¬termS → moveS) ∧ 
    (¬st ∧ (¬insdS ∨ termS) → ¬nextInsdS)
 )
)


Another equivalent conjunctive form would be the following one:

    (st ∧ (¬insdS ∨ termS)  → enterS ∨ instS ∧ ¬nextInsdS) ∧ 
    (insdS ∧ ¬termS → moveS) ∧ 
    (¬st ∧ (¬insdS ∨ termS) → ¬nextInsdS)

