24 #include "ppl-config.h"
26 #include "assertions.hh"
36 const char*
empty =
"EM";
37 const char* consys_min =
"CM";
38 const char* gensys_min =
"GM";
39 const char* consys_upd =
"CS";
40 const char* gensys_upd =
"GS";
41 const char* satc_upd =
"SC";
42 const char* satg_upd =
"SG";
43 const char* consys_pending =
"CP";
44 const char* gensys_pending =
"GP";
54 get_field(std::istream& s,
const char* keyword,
bool& positive) {
57 || (str[0] !=
'+' && str[0] !=
'-')
58 || str.substr(1) != keyword) {
61 positive = (str[0] ==
'+');
69 s << (test_zero_dim_univ() ?
'+' :
'-') <<
zero_dim_univ <<
' '
70 << (test_empty() ?
'+' :
'-') <<
empty <<
' '
72 << (test_c_minimized() ?
'+' :
'-') << consys_min <<
' '
73 << (test_g_minimized() ?
'+' :
'-') << gensys_min <<
' '
75 << (test_c_up_to_date() ?
'+' :
'-') << consys_upd <<
' '
76 << (test_g_up_to_date() ?
'+' :
'-') << gensys_upd <<
' '
78 << (test_c_pending() ?
'+' :
'-') << consys_pending <<
' '
79 << (test_g_pending() ?
'+' :
'-') << gensys_pending <<
' '
81 << (test_sat_c_up_to_date() ?
'+' :
'-') << satc_upd <<
' '
82 << (test_sat_g_up_to_date() ?
'+' :
'-') << satg_upd
106 if (!
get_field(s, consys_min, positive)) {
116 if (!
get_field(s, gensys_min, positive)) {
127 if (!
get_field(s, consys_upd, positive)) {
135 reset_c_up_to_date();
138 if (!
get_field(s, gensys_upd, positive)) {
145 reset_g_up_to_date();
148 if (!
get_field(s, consys_pending, positive)) {
158 if (!
get_field(s, gensys_pending, positive)) {
172 set_sat_c_up_to_date();
175 reset_sat_c_up_to_date();
182 set_sat_g_up_to_date();
185 reset_sat_g_up_to_date();
194 PPL::Grid::Status::OK()
const {
200 if (test_zero_dim_univ()) {
212 cerr <<
"The empty flag is incompatible with any other one."
213 << endl <<
"Flags:" << endl;
219 if ((test_sat_c_up_to_date() || test_sat_g_up_to_date())
220 && !(test_c_up_to_date() && test_g_up_to_date())) {
223 "If a saturation matrix is up-to-date, congruences and\n"
224 "generators have to be both up-to-date."
230 if (test_c_minimized() && !test_c_up_to_date()) {
232 cerr <<
"If congruences are minimized they must be up-to-date."
238 if (test_g_minimized() && !test_g_up_to_date()) {
240 cerr <<
"If generators are minimized they must be up-to-date."
246 if (test_c_pending() && test_g_pending()) {
248 cerr <<
"There cannot be both pending congruences and pending generators."
254 if (test_c_pending() || test_g_pending()) {
255 if (!test_c_minimized() || !test_g_minimized()) {
258 "If there are pending congruences or generators, congruences\n"
259 "and generators must be minimized."
265 if (!test_sat_c_up_to_date() && !test_sat_g_up_to_date()) {
268 "If there are pending congruences or generators, there must\n"
269 "be at least a saturation matrix up-to-date."
Enable_If< Is_Native_Or_Checked< T >::value, void >::type ascii_dump(std::ostream &s, const T &t)
A conjunctive assertion about a grid.
const char * zero_dim_univ
bool test_zero_dim_univ() const
The standard C++ namespace.
bool get_field(std::istream &s, const char *keyword, bool &positive)
Enable_If< Is_Native_Or_Checked< T >::value, void >::type ascii_dump(std::ostream &s, const T &t)
Ascii dump for native or checked.
#define PPL_OUTPUT_DEFINITIONS_ASCII_ONLY(class_name)
bool get_field(std::istream &s, const char *keyword, bool &positive)
The entire library is confined to this namespace.
#define PPL_UNINITIALIZED(type, name)
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type ascii_load(std::ostream &s, T &t)
Ascii load for native or checked.