Download Paper - STS
Transcript
4 BDD-based model checking with NuSMV freely while NuSMV is running. The underlying decision diagram library makes sure that the individual ADDs and BDDs remain compatible with each other and that they always represent the same boolean functions. The last item to encode is the set of states where the states have some common property. This could be, for example, the satisfaction of a propositional or CTL formula or the membership in some semantic state set (e.g., the inital states). A set of states is represented by a BDD defined over the representation variables of state and frozen variables. Each minterm of the BDD represents therefore a domain state. Since the encoding of the domain variables is not necessarily unique, there can be multiple minterms for the same domain state. Sometimes it is desirable to have unique minterms. For example, if the correct number of states is to be determined. For such a use case, NuSMV provides the functionality of variable masking that maps each free variable (a variable where either value leads to the same domain value) to F ALSE. Therefore, all domain states are uniquely represented by assignments to representation variables where the free variables are F ALSE. counter.2 counter.2 counter.1 counter.0 T RU E F ALSE Figure 4.4: BDD of ¬isEndReached counter.1 counter.0 F ALSE T RU E counter.0 T RU E F ALSE Figure 4.5: BDD of state and Figure 4.6: Masked BDD of frozen variable mask ¬isEndReached An example is shown in Figure 4.4 for the SMV model from Listing 4.6. The BDD represents all states where the end of the counter is not reached (where the proposition counter 6= 4 holds). The number of minterms of this BDD is seven since only one minterm is mapped to F ALSE. But in the original model there are only four domain states that satisfy this proposition. Therefore, the state and frozen variable mask from Figure 4.5 can be applied. After the application of the mask, each domain state is uniquely represented by exactly one minterm as depicted in Figure 4.6. This example leads to the impression that masked BDDs are smaller than their unmasked counterparts. But this does not hold in general. Here it is only the case because there is just one state/frozen variable. The masking in NuSMV is not done for each variable separately but for all variables of a specific type (or a combination of types) at once. Therefore, masking normally increases the size of a BDD. As an example, imagine the set of all states (the BDD is constant T RU E) that is masked. The result is the BDD in Figure 4.5. The handling of input variables and its masking is done in the same way. 22