@@ -25,9 +25,7 @@ void instrument_buechi(
2525 continue ;
2626
2727 // This is for LTL and some fragment of SVA only.
28- if (
29- !is_LTL (property.normalized_expr ) &&
30- !is_Buechi_SVA (property.normalized_expr ))
28+ if (!is_LTL (property.normalized_expr ) && !is_SVA (property.normalized_expr ))
3129 {
3230 property.unsupported (" not convertible to Buechi" );
3331 continue ;
@@ -37,65 +35,74 @@ void instrument_buechi(
3735 message.debug () << " Translating " << property.description << " to Buechi"
3836 << messaget::eom;
3937
40- // make the automaton for the negation of the property
41- auto buechi =
42- ltl_to_buechi (not_exprt{property.normalized_expr }, message_handler);
43-
44- // make a fresh symbol for the state of the automaton
45- namespacet ns (transition_system.symbol_table );
46- auto property_symbol = ns.lookup (property.identifier );
47-
48- auxiliary_symbolt new_state_symbol{
49- id2string (property_symbol.name ) + " ::buechi_state" ,
50- buechi.state_symbol .type (),
51- property_symbol.mode };
52- new_state_symbol.is_state_var = true ;
53- new_state_symbol.module = property_symbol.module ;
54-
55- buechi.rename_state_symbol (new_state_symbol.symbol_expr ());
56-
57- // add the new symbol to the symbol table
58- transition_system.symbol_table .add (std::move (new_state_symbol));
59-
60- // add the automaton to the transition system
61- transition_system.trans_expr .init () =
62- and_exprt{transition_system.trans_expr .init (), buechi.init };
63-
64- transition_system.trans_expr .trans () =
65- and_exprt{transition_system.trans_expr .trans (), buechi.trans };
66-
67- // Replace the normalized property expression
68- // by the Buechi acceptance condition.
69- exprt::operandst property_conjuncts;
70-
71- bool have_liveness = false , have_safety = false ;
72-
73- if (!buechi.liveness_signal .is_false ())
38+ try
7439 {
75- // Note that we have negated the property,
76- // so this is the negation of the Buechi acceptance condition.
77- property_conjuncts.push_back (
78- F_exprt{G_exprt{not_exprt{buechi.liveness_signal }}});
79- have_liveness = true ;
40+ // make the automaton for the negation of the property
41+ auto buechi =
42+ ltl_to_buechi (not_exprt{property.normalized_expr }, message_handler);
43+
44+ // make a fresh symbol for the state of the automaton
45+ namespacet ns (transition_system.symbol_table );
46+ auto property_symbol = ns.lookup (property.identifier );
47+
48+ auxiliary_symbolt new_state_symbol{
49+ id2string (property_symbol.name ) + " ::buechi_state" ,
50+ buechi.state_symbol .type (),
51+ property_symbol.mode };
52+ new_state_symbol.is_state_var = true ;
53+ new_state_symbol.module = property_symbol.module ;
54+
55+ buechi.rename_state_symbol (new_state_symbol.symbol_expr ());
56+
57+ // add the new symbol to the symbol table
58+ transition_system.symbol_table .add (std::move (new_state_symbol));
59+
60+ // add the automaton to the transition system
61+ transition_system.trans_expr .init () =
62+ and_exprt{transition_system.trans_expr .init (), buechi.init };
63+
64+ transition_system.trans_expr .trans () =
65+ and_exprt{transition_system.trans_expr .trans (), buechi.trans };
66+
67+ // Replace the normalized property expression
68+ // by the Buechi acceptance condition.
69+ exprt::operandst property_conjuncts;
70+
71+ bool have_liveness = false , have_safety = false ;
72+
73+ if (!buechi.liveness_signal .is_false ())
74+ {
75+ // Note that we have negated the property,
76+ // so this is the negation of the Buechi acceptance condition.
77+ property_conjuncts.push_back (
78+ F_exprt{G_exprt{not_exprt{buechi.liveness_signal }}});
79+ have_liveness = true ;
80+ }
81+
82+ if (!buechi.error_signal .is_true ())
83+ {
84+ property_conjuncts.push_back (G_exprt{not_exprt{buechi.error_signal }});
85+ have_safety = true ;
86+ }
87+
88+ if (have_liveness && have_safety)
89+ message.debug () << " Buechi automaton has liveness and safety components"
90+ << messaget::eom;
91+ else if (have_liveness)
92+ message.debug () << " Buechi automaton is liveness only" << messaget::eom;
93+ else if (have_safety)
94+ message.debug () << " Buechi automaton is safety only" << messaget::eom;
95+
96+ property.normalized_expr = conjunction (property_conjuncts);
97+
98+ message.debug () << " New property: " << format (property.normalized_expr )
99+ << messaget::eom;
80100 }
81-
82- if (!buechi.error_signal .is_true ())
101+ catch (ltl_to_buechi_unsupportedt error)
83102 {
84- property_conjuncts.push_back (G_exprt{not_exprt{buechi.error_signal }});
85- have_safety = true ;
103+ property.unsupported (
104+ error.expr .id_string () + " not convertible to Buechi" );
105+ continue ;
86106 }
87-
88- if (have_liveness && have_safety)
89- message.debug () << " Buechi automaton has liveness and safety components"
90- << messaget::eom;
91- else if (have_liveness)
92- message.debug () << " Buechi automaton is liveness only" << messaget::eom;
93- else if (have_safety)
94- message.debug () << " Buechi automaton is safety only" << messaget::eom;
95-
96- property.normalized_expr = conjunction (property_conjuncts);
97-
98- message.debug () << " New property: " << format (property.normalized_expr )
99- << messaget::eom;
100107 }
101108}
0 commit comments