/* * In the future, if the number of atomic propositions or the size of Buchi * automaton is larger, we can switch to dynamic allocation. For now, the code * is simpler this way.
*/ #define RV_MAX_LTL_ATOM 32 #define RV_MAX_BA_STATES 32
/** * struct ltl_monitor - A linear temporal logic runtime verification monitor * @states: States in the Buchi automaton. As Buchi automaton is a * non-deterministic state machine, the monitor can be in multiple * states simultaneously. This is a bitmask of all possible states. * If this is zero, that means either: * - The monitor has not started yet (e.g. because not all * atomic propositions are known). * - There is no possible state to be in. In other words, a * violation of the LTL property is detected. * @atoms: The values of atomic propositions. * @unknown_atoms: Atomic propositions which are still unknown.
*/ struct ltl_monitor {
DECLARE_BITMAP(states, RV_MAX_BA_STATES);
DECLARE_BITMAP(atoms, RV_MAX_LTL_ATOM);
DECLARE_BITMAP(unknown_atoms, RV_MAX_LTL_ATOM);
};
staticinlinebool rv_ltl_valid_state(struct ltl_monitor *mon)
{ for (int i = 0; i < ARRAY_SIZE(mon->states); ++i) { if (mon->states[i]) returntrue;
} returnfalse;
}
staticinlinebool rv_ltl_all_atoms_known(struct ltl_monitor *mon)
{ for (int i = 0; i < ARRAY_SIZE(mon->unknown_atoms); ++i) { if (mon->unknown_atoms[i]) returnfalse;
} returntrue;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.