21 #include "SheafSystem/poset_state_handle.h" 23 #include "SheafSystem/array_index_space_state.h" 24 #include "SheafSystem/array_poset_dof_map.h" 25 #include "SheafSystem/factory.h" 26 #include "SheafSystem/index_equivalence_iterator.h" 27 #include "SheafSystem/index_space_interval.h" 28 #include "SheafSystem/explicit_index_space_state.h" 29 #include "SheafSystem/implicit_crg_interval.h" 31 #include "SheafSystem/index_space_iterator.h" 32 #include "SheafSystem/namespace_poset.impl.h" 33 #include "SheafSystem/namespace_poset_member.h" 34 #include "SheafSystem/poset_bounds.h" 35 #include "SheafSystem/poset_crg_state.h" 36 #include "SheafSystem/poset_dof_map.h" 37 #include "SheafSystem/poset_handle_factory.h" 38 #include "SheafSystem/poset_member.h" 39 #include "SheafSystem/poset_member_iterator.h" 40 #include "SheafSystem/poset_dof_iterator.h" 41 #include "SheafSystem/poset_orderer.h" 42 #include "SheafSystem/poset_powerset_state.h" 43 #include "SheafSystem/poset_slicer.h" 44 #include "SheafSystem/poset_type.h" 45 #include "SheafSystem/postorder_member_iterator.h" 46 #include "SheafSystem/preorder_member_iterator.h" 47 #include "SheafSystem/primitives_poset.h" 48 #include "SheafSystem/primitives_poset_schema.h" 49 #include "SheafSystem/schema_poset_member.h" 50 #include "SheafSystem/assert_contract.h" 51 #include "SheafSystem/std_cstdlib.h" 52 #include "SheafSystem/std_iomanip.h" 53 #include "SheafSystem/std_sstream.h" 54 #include "SheafSystem/std_sstream.h" 55 #include "SheafSystem/subposet.h" 56 #include "SheafSystem/subposet_state.h" 57 #include "SheafSystem/subposet_member_iterator.h" 58 #include "SheafSystem/zn_to_bool.h" 80 result =
factory().new_poset_handle(xclass_name, xsheaf_base_class_id);
126 require(!is_attached());
147 require(xbottom != 0);
159 ensure(!is_attached());
160 ensure(&(top()) == xtop);
161 ensure(&(bottom()) == xbottom);
162 ensure(!top().is_attached());
163 ensure(!bottom().is_attached());
187 require(state_is_read_accessible());
191 result = state_obj()->type_id();
208 static const char* result =
"poset_state_handle";
227 result = !is_attached() &&
228 (name_space() != 0) &&
229 (index().is_valid());
233 ensure(result ? !is_attached() :
true);
234 ensure(result ? name_space() != 0 :
true);
235 ensure(result ? index().
is_valid() :
true);
248 require(!xauto_access ? state_is_read_write_accessible() :
true);
254 get_read_write_access(
true);
259 define_old_variable(
int old_jim_edit_depth = crg().jim_edit_depth());
261 crg().request_jim_edit_mode();
265 ensure(state_is_read_write_accessible());
266 ensure(in_jim_edit_mode());
267 ensure(jim_edit_depth(
false) == old_jim_edit_depth + 1);
281 require(in_jim_edit_mode());
282 require(state_is_read_write_accessible());
286 define_old_variable(
int old_jim_edit_depth = crg().jim_edit_depth());
288 crg().release_jim_edit_mode();
297 if(xensure_lattice_invariant && !crg().jim_edit_mode())
299 ensure_lattice_invariant();
311 ensure(jim_edit_depth(xauto_access) == old_jim_edit_depth - 1);
328 result = state_is_read_write_accessible() && crg().jim_edit_mode();
332 ensure(result ? state_is_read_write_accessible() :
true);
347 require(xauto_access || state_is_read_accessible());
356 result = crg().jim_edit_depth();
378 require(is_attached());
382 int old_access_request_depth = access_request_depth();
384 read_write_monitor_handle::get_read_access();
385 schema().get_read_access();
389 ensure(state_is_read_accessible());
390 ensure(access_request_depth() > old_access_request_depth);
403 require(is_attached());
404 require(!xrelease_read_only_access ? state_is_not_read_only_accessible() :
true);
408 int old_access_request_depth = access_request_depth();
410 read_write_monitor_handle::get_read_write_access(xrelease_read_only_access);
411 schema().get_read_access();
415 ensure(state_is_read_write_accessible());
416 ensure(access_request_depth() > old_access_request_depth);
429 require(state_is_read_accessible());
433 int old_access_request_depth = access_request_depth();
446 schema().release_access(
false);
447 read_write_monitor_handle::release_access(
false);
449 while(xall && state_is_read_accessible());
455 access_request_depth() == 0 :
456 access_request_depth() < old_access_request_depth);
457 ensure(access_request_depth() == 0 ? state_is_not_read_accessible() :
true);
477 result = (state_obj() != 0);
496 result = (state_obj() == xother->
state_obj());
532 require(xother != 0);
542 _index = xother->
index();
545 attach_handle_data_members();
549 ensure(poset_state_handle::invariant());
550 ensure(is_attached());
551 ensure(host() == xother->
host());
552 ensure(index() == xother->
index());
574 attach_to_state(&mbr);
579 mbr.detach_from_state();
600 attach_to_state(xhost, xindex.
hub_pod());
626 attach_to_state(&mbr);
631 mbr.detach_from_state();
649 require(dynamic_cast<namespace_poset*>(xmbr->
host()) != 0);
659 _index = xmbr->
index();
683 int old_access_request_depth = 0;
690 old_access_request_depth = access_request_depth();
691 poset_state_handle::get_read_access();
693 attach_handle_data_members();
698 ensure(poset_state_handle::invariant());
699 ensure(host() == xmbr->
host());
700 ensure(index() == xmbr->
index());
701 ensure(!is_external() ? is_attached() :
true);
705 if(is_attached()) poset_state_handle::release_access();
709 ensure(is_attached() ? access_request_depth() == old_access_request_depth :
true);
725 resident().detach_from_state();
729 top().detach_from_state();
730 bottom().detach_from_state();
743 ensure(!is_attached());
744 ensure(!is_external());
824 require(!xpath.
empty());
827 require(schema_is_ancestor_of(&xschema));
835 new_state(xpath, xschema, xdof_map);
839 initialize_namespace(xns, xpath.
poset_name(),
true);
843 ensure(is_attached());
844 ensure(path(
true).poset_name() == xpath.
poset_name());
845 ensure(schema(
true).is_same_state(&xschema));
848 ensure(&table_dof_map(
false) == &xdof_map);
867 require(!xpath.
empty());
868 require(!xpath.
full());
870 require(schema_is_ancestor_of(&xschema));
887 ensure(is_attached());
888 ensure(!in_jim_edit_mode());
889 ensure(schema().is_same_state(&xschema));
890 ensure(has_standard_member_ct());
891 ensure(has_standard_row_dof_tuple_ct());
892 ensure(version() == COARSEST_COMMON_REFINEMENT_VERSION);
900 ensure(state_is_not_read_accessible());
914 require(state_is_read_accessible());
915 require(unexecutable(
"table dof tuple is valid"));
940 require(state_is_read_accessible());
948 disable_invariant_check();
952 resident().attach_to_state(
this, RESIDENT_INDEX);
956 bottom().attach_to_state(
this, BOTTOM_INDEX);
957 top().attach_to_state(
this, TOP_INDEX);
959 enable_invariant_check();
963 ensure(bottom().is_attached());
964 ensure(top().is_attached());
965 ensure(jims().is_attached());
966 ensure(whole().is_attached());
967 ensure(resident().is_attached());
1013 if(cover_is_empty(
UPPER, lindex))
1017 new_link(TOP_INDEX, lindex);
1020 if(cover_is_empty(
LOWER, lindex))
1028 new_link(lindex, greatest_bottom_jem);
1041 ensure( top().is_attached() );
1042 ensure(unexecutable(only top has no upper cover));
1043 ensure(unexecutable(order relation is well defined));
1056 require(state_is_read_write_accessible());
1060 define_old_variable(
int old_schema_access_request_depth = schema().access_request_depth());
1061 int old_access_request_depth = access_request_depth();
1063 #ifdef DIAGNOSTIC_OUTPUT 1064 cout <<
"poset: " << name()
1065 <<
" old level:" << old_access_request_depth
1066 <<
" schema: " << schema().name();
1079 for(
size_type i=0; i<old_access_request_depth; ++i)
1081 schema().release_access(
false);
1084 define_old_variable(
int schema_access_request_depth = schema().access_request_depth());
1086 #ifdef DIAGNOSTIC_OUTPUT 1087 cout <<
" old level:" << old_schema_access_request_depth
1088 <<
" level: " << schema_access_request_depth
1095 detach_from_state();
1100 ensure(!is_attached());
1101 ensure(unexecutable(
"state has been deleted"));
1102 ensure(schema_access_request_depth == (old_schema_access_request_depth - old_access_request_depth));
1122 return name_space();
1140 define_old_variable(
const scoped_index& result = _index);
1144 ensure(result.is_hub_scope() || !result.is_valid());
1145 ensure(result.is_positive() || !result.is_valid());
1159 require(state_is_read_accessible());
1180 require(is_external() ? name_space()->state_is_read_accessible() : state_is_read_accessible());
1189 result = name_space()->member_name(index(),
false);
1196 result = _state->name();
1214 require(is_external() ?
1215 name_space()->state_is_auto_read_accessible(xauto_access) :
1216 state_is_auto_read_accessible(xauto_access));
1222 is_external() ? name_space()->get_read_access() : get_read_access();
1229 is_external() ? name_space()->release_access() : release_access();
1246 require(is_external() ?
1247 name_space()->state_is_auto_read_accessible(xauto_access) :
1248 state_is_auto_read_accessible(xauto_access));
1256 ensure(!result.
empty());
1257 ensure(!result.
full());
1272 require(state_is_read_accessible());
1291 disable_invariant_check();
1294 _index = xns.
insert_poset(*
this, xposet_name, xauto_link,
true);
1296 enable_invariant_check();
1300 ensure(name_space() == &xns);
1301 ensure(name_space()->contains_member(index(),
false));
1302 ensure(&name_space()->member_poset(index()) ==
this);
1335 require(xis_jim ? in_jim_edit_mode() : state_is_read_write_accessible());
1336 require((!
is_valid(xtuple_hub_id)) || contains_row_dof_tuple(xtuple_hub_id));
1351 crg().put_member_dof_tuple_id(result, xtuple_hub_id);
1356 if(crg().end() > powerset().subposet_member_index_ub())
1358 powerset().put_subposet_member_index_ub(crg().end());
1363 powerset().whole().insert_member(result);
1373 jims().insert_member(result);
1378 ensure(invariant());
1379 ensure(cover_is_empty(
LOWER, result));
1380 ensure(cover_is_empty(
UPPER, result));
1397 require(xis_jim ? in_jim_edit_mode() : state_is_read_write_accessible());
1398 require(contains_row_dof_tuple(xtuple_id) || (!xtuple_id.
is_valid()));
1402 result.
put(member_hub_id_space(
false), new_member(xis_jim, xtuple_id.
hub_pod()));
1406 ensure(invariant());
1407 ensure(cover_is_empty(
LOWER, result));
1408 ensure(cover_is_empty(
UPPER, result));
1425 require(xis_jim ? in_jim_edit_mode() : state_is_read_write_accessible());
1444 ldof_map_id.put_scope(dof_tuple_hub_id_space(
false));
1446 else if(xdof_map == 0)
1452 ldof_map_id = new_row_dof_map();
1462 ldof_map_id = clone_row_dof_map(*xdof_map);
1471 table().put_row_dof_tuple(xdof_map);
1472 ldof_map_id = xdof_map->
index();
1481 ldof_map_id = xdof_map->
index();
1486 pod_index_type result = new_member(xis_jim, ldof_map_id.hub_pod());
1490 ensure(invariant());
1491 ensure(cover_is_empty(
LOWER, result));
1492 ensure(cover_is_empty(
UPPER, result));
1510 require(xis_jim ? in_jim_edit_mode() : state_is_read_write_accessible());
1517 result.
put(member_hub_id_space(
false), new_member(xis_jim, xdof_map, xcopy_dof_map));
1521 ensure(invariant());
1522 ensure(cover_is_empty(
LOWER, result));
1523 ensure(cover_is_empty(
UPPER, result));
1543 require(in_jim_edit_mode());
1544 require(implicit_crg_interval::interval_factory().contains_prototype(xinterval_type));
1549 define_old_variable(
const scoped_index old_member_index_ub = member_index_ub());
1550 define_old_variable(
size_type old_member_ct = member_ct());
1552 pod_index_type result = new_member_interval(xinterval_type, xsize);
1562 ensure(member_index_ub() >= old_member_index_ub + xsize);
1563 ensure(member_ct() == old_member_ct + xsize);
1564 ensure_for_range(
pod_index_type i=result, i<member_index_ub().pod(), ++i, contains_member(i));
1565 ensure(unexecutable(
"result is_initialized()"));
1582 require(in_jim_edit_mode());
1583 require(implicit_crg_interval::interval_factory().contains_prototype(xinterval_type));
1588 define_old_variable(
const scoped_index old_member_index_ub = member_index_ub());
1589 define_old_variable(
size_type old_member_ct = member_ct());
1591 result.
put(member_hub_id_space(
false),
1592 new_member_interval(xinterval_type, xsize, xtuple_hub_ids, xdata));
1596 ensure(member_index_ub() >= old_member_index_ub + xsize);
1597 ensure(member_ct() == old_member_ct + xsize);
1598 ensure_for_range(
scoped_index i=result, i<member_index_ub(), ++i, contains_member(i));
1599 ensure(unexecutable(
"result is_initialized()"));
1612 require(state_is_read_write_accessible());
1613 require(contains_member(xmbr_hub_id,
false));
1622 delete_all_member_names(xmbr_hub_id,
false);
1626 powerset().delete_poset_member(xmbr_hub_id);
1630 crg().delete_member(xmbr_hub_id);
1634 ensure(invariant());
1635 ensure(!contains_member(xmbr_hub_id,
false));
1636 ensure(unexecutable(member_ct() = old member_ct() - 1));
1637 ensure(unexecutable(
"for all subposets s( !s.contains_member(xindex))"));
1650 require(state_is_read_write_accessible());
1651 require(contains_member(xmbr_id,
false));
1658 delete_member(xmbr_id.
hub_pod());
1662 ensure(invariant());
1663 ensure(!contains_member(xmbr_id,
false));
1664 ensure(unexecutable(member_ct() = old member_ct() - 1));
1665 ensure(unexecutable(
"for all subposets s( !s.contains_member(xindex))"));
1679 require(state_is_read_accessible());
1683 int result = crg().member_ct();
1687 ensure(result >= 0);
1700 require(state_is_read_accessible());
1704 result = crg().standard_member_ct();
1708 ensure(result >= 0);
1721 require(state_is_read_accessible());
1725 result = (member_ct() == standard_member_ct());
1729 ensure(result == (member_ct() == standard_member_ct()));
1741 require(state_is_read_accessible());
1750 ensure(result >= 0);
1761 require(state_is_read_accessible());
1765 index_iterator result(whole().members(), member_hub_id_space(
false),
false);
1780 require(state_is_auto_read_accessible(xauto_access));
1789 bool result = crg().contains_member(xmbr_hub_id);
1809 require(xauto_access || state_is_read_accessible());
1813 return contains_member(xmbr_id.
hub_pod(), xauto_access);
1824 require(state_is_auto_read_accessible(xauto_access));
1831 require(has_version(xversion));
1835 result = powerset().subposet_contains_member(version_index(xversion), xmbr_hub_id);
1857 require(xauto_access || state_is_read_accessible());
1858 require(has_version(xversion));
1862 return contains_member(xmbr_id.
hub_pod(), xversion, xauto_access);
1873 require(state_is_auto_read_accessible(xauto_access));
1880 require(!xname.empty());
1887 result =
is_valid(member_id(xname,
false));
1905 require(xauto_access || state_is_read_accessible());
1910 is_same_state(xmbr->
host()) && contains_member(xmbr->
index(), xauto_access);
1924 require(xmbrs != 0);
1925 require(state_is_auto_read_accessible(xauto_access));
1937 while(result && i < xmbrs_ct)
1939 result = contains_member(xmbrs[i],
false);
1950 ensure(unexecutable(
"result == for all i in xmbrs( contains_member(i) )"));
1964 require(xmbrs != 0);
1965 require(state_is_auto_read_accessible(xauto_access));
1977 while(result && i < xmbrs_ct)
1979 result = contains_member(xmbrs[i],
false);
1990 ensure(unexecutable(
"result == for all i in xmbrs( contains_member(i) )"));
2004 require(state_is_auto_read_accessible(xauto_access));
2016 while(result && i < xmbrs.
ct())
2018 result = contains_member(xmbrs[i],
false);
2030 ensure(unexecutable(
"result == for all i in xmbrs( contains_member(i))"));
2044 require(state_is_auto_read_accessible(xauto_access));
2056 while(result && i < xmbrs.
ct())
2058 result = contains_member(xmbrs[i],
false);
2070 ensure(unexecutable(
"result == for all i in xmbrs( contains_member(i))"));
2084 require(xnames != 0);
2085 require_for_all(i, 0, xnames_ct, !xnames[i].empty());
2086 require(state_is_auto_read_accessible(xauto_access));
2098 while(result && i < xnames_ct)
2100 result = contains_member(xnames[i],
false);
2111 ensure(unexecutable(
"result == for all i in xnames( contains_member(xnames[i]))"));
2125 require_for_all(i, 0, xmbrs.
ct(), !xmbrs[i].empty());
2126 require(state_is_auto_read_accessible(xauto_access));
2138 while(result && i < xmbrs.
ct())
2140 result = contains_member(xmbrs[i],
false);
2151 ensure(unexecutable(
"result == for all i in xmbrs( contains_member(xmbrs[i]) )"));
2166 require(state_is_read_accessible());
2170 result = member_ct() == 0;
2188 require(state_is_read_accessible());
2192 if(xin_current_version)
2197 result = jims().contains_member(xmbr_hub_id);
2204 result =
is_valid(member_dof_tuple_id(xmbr_hub_id,
false));
2222 require(state_is_read_accessible());
2226 return is_jim(xmbr_id.
hub_pod(), xin_current_version);
2231 is_jim(
const std::string& xname,
bool xin_current_version)
const 2237 require(!xname.empty());
2238 require(state_is_read_accessible());
2243 result =
is_valid(lindex) && is_jim(lindex, xin_current_version);
2260 require(state_is_read_accessible());
2265 (!cover_is_empty(
LOWER, xmbr_hub_id)) &&
2266 (first_cover_member(
LOWER, xmbr_hub_id) == BOTTOM_INDEX);
2283 require(state_is_read_accessible());
2287 return is_atom(xmbr_id.
hub_pod());
2356 require(state_is_read_write_accessible());
2362 begin_jim_edit_mode(
false);
2367 bottom().attach_to_state(
this, new_member(
false));
2368 bottom().put_name(
"bottom",
true,
false);
2373 top().attach_to_state(
this, new_member(
false));
2374 top().put_name(
"top",
true,
false);
2386 put_standard_member_ct(member_ct());
2387 put_standard_row_dof_tuple_ct(row_dof_tuple_ct());
2389 end_jim_edit_mode(
true,
false);
2393 crg().enable_invariant_check();
2395 assertion(crg().invariant());
2399 ensure(bottom().is_attached() && (bottom().index() == BOTTOM_INDEX));
2400 ensure(top().is_attached() && (top().index() == TOP_INDEX));
2401 ensure(has_standard_member_ct());
2402 ensure(has_standard_row_dof_tuple_ct());
2417 require(state_is_read_accessible());
2421 result = xmbr_id.
in_range(crg().begin(), crg().end());
2424 ensure(invariant());
2425 ensure( result == xmbr_id.
in_range(crg().begin(), crg().end()) );
2440 require(state_is_read_accessible());
2448 while(i < xindices.
ub() && result)
2450 result = xindices[i].in_range(crg().begin(), crg().end()) && result;
2455 ensure(invariant());
2469 require(!contains_member(xmbr_hub_id));
2470 require(xis_jim ? in_jim_edit_mode() : state_is_read_write_accessible());
2471 require(member_id_spaces(
false).is_valid_reserved_id(xmbr_hub_id));
2472 require((!xdof_tuple_id.
is_valid()) || contains_row_dof_tuple(xdof_tuple_id));
2476 define_old_variable(
const scoped_index old_member_index_ub = member_index_ub());
2477 define_old_variable(
int old_member_ct = member_ct());
2481 crg().new_member(xmbr_hub_id);
2485 crg().put_member_dof_tuple_id(xmbr_hub_id, xdof_tuple_id.
hub_pod());
2490 if(crg().end() > powerset().subposet_member_index_ub())
2492 powerset().put_subposet_member_index_ub(crg().end());
2497 powerset().whole().insert_member(xmbr_hub_id);
2507 jims().insert_member(xmbr_hub_id);
2512 ensure(invariant());
2513 ensure(contains_member(xmbr_hub_id));
2514 ensure(cover_is_empty(
LOWER, xmbr_hub_id));
2515 ensure(cover_is_empty(
UPPER, xmbr_hub_id));
2533 require(!contains_member(xmbr_hub_id));
2534 require(xis_jim ? in_jim_edit_mode() : state_is_read_write_accessible());
2535 require(member_id_spaces(
false).is_valid_reserved_id(xmbr_hub_id));
2542 define_old_variable(
int old_member_ct = member_ct());
2546 scoped_index ldof_map_id(dof_tuple_hub_id_space(
false));
2553 else if(xdof_map == 0)
2559 ldof_map_id = new_row_dof_map();
2569 ldof_map_id = clone_row_dof_map(*xdof_map);
2578 table().put_row_dof_tuple(xdof_map);
2579 ldof_map_id = xdof_map->
index();
2588 ldof_map_id = xdof_map->
index();
2593 new_member(xmbr_hub_id, xis_jim, const_cast<const scoped_index&>(ldof_map_id));
2597 ensure(invariant());
2598 ensure(contains_member(xmbr_hub_id));
2599 ensure(cover_is_empty(
LOWER, xmbr_hub_id));
2600 ensure(cover_is_empty(
UPPER, xmbr_hub_id));
2618 require(in_jim_edit_mode());
2619 require(implicit_crg_interval::interval_factory().contains_prototype(xinterval_type));
2624 define_old_variable(
const scoped_index old_member_index_ub = member_index_ub());
2625 define_old_variable(
size_type old_member_ct = member_ct());
2630 pod_index_type result = crg().new_member_interval(xinterval_type, xsize);
2636 if(crg().end() > powerset().subposet_member_index_ub())
2638 powerset().put_subposet_member_index_ub(crg().end());
2645 powerset().whole().insert_member(i);
2650 ensure(member_index_ub() >= old_member_index_ub + xsize);
2651 ensure(member_ct() == old_member_ct + xsize);
2652 ensure_for_range(
pod_index_type i=result, i<member_index_ub().pod(), ++i, contains_member(i));
2653 ensure(unexecutable(
"result size_initialized()"));
2654 ensure(unexecutable(
"result local_id_space_initialized()"));
2668 require_for_range(
pod_index_type i=0, i<xsize, ++i, !contains_member(xmbr_hub_id + i));
2669 require(in_jim_edit_mode());
2670 require(implicit_crg_interval::interval_factory().contains_prototype(xinterval_type));
2675 define_old_variable(
const scoped_index old_member_index_ub = member_index_ub());
2676 define_old_variable(
size_type old_member_ct = member_ct());
2681 crg().new_member_interval(xmbr_hub_id, xinterval_type, xsize);
2687 if(crg().end() > powerset().subposet_member_index_ub())
2689 powerset().put_subposet_member_index_ub(crg().end());
2696 powerset().whole().insert_member(i);
2701 ensure(member_index_ub() >= old_member_index_ub);
2702 ensure(member_ct() == old_member_ct + xsize);
2703 ensure_for_range(
pod_index_type i=0, i<xsize, ++i, contains_member(xmbr_hub_id + i));
2704 ensure(unexecutable(
"result size_initialized()"));
2705 ensure(unexecutable(
"result local_id_space_initialized()"));
2729 require(state_is_auto_read_accessible(xauto_access));
2730 require(contains_member(xmbr_hub_id, xauto_access));
2734 poset_path result(name(xauto_access), member_name(xmbr_hub_id, xauto_access));
2738 ensure(result.
poset_name() == name(xauto_access));
2739 ensure(member_id(result.
member_name(), xauto_access) == xmbr_hub_id);
2754 require(state_is_auto_read_accessible(xauto_access));
2763 string result(crg().member_name_map().name(xmbr_hub_id));
2781 require(xauto_access || state_is_read_accessible());
2785 return member_name(xmbr_id.
hub_pod(), xauto_access);
2792 bool xauto_access)
const 2796 require(state_is_auto_read_accessible(xauto_access));
2797 require(contains_member(xmbr_hub_id, xauto_access));
2806 crg().member_name_map().all_names(xmbr_hub_id, xresult);
2815 ensure(xresult.
ct() == member_name_ct(xmbr_hub_id, xauto_access));
2816 ensure_for_all(i, 0, xresult.
ct(), member_has_name(xmbr_hub_id, xresult[i], xauto_access));
2827 bool xauto_access)
const 2831 require(xauto_access || state_is_read_accessible());
2832 require(contains_member(xmbr_id, xauto_access));
2836 all_member_names(xmbr_id.
hub_pod(), xresult, xauto_access);
2840 ensure(xresult.
ct() == member_name_ct(xmbr_id, xauto_access));
2841 ensure_for_all(i, 0, xresult.
ct(), member_has_name(xmbr_id, xresult[i], xauto_access));
2856 require(state_is_auto_read_accessible(xauto_access));
2857 require(contains_member(xmbr_hub_id, xauto_access));
2866 result = crg().member_name_map().name_ct(xmbr_hub_id);
2888 require(xauto_access || state_is_read_accessible());
2889 require(contains_member(xmbr_id, xauto_access));
2893 return member_name_ct(xmbr_id.
hub_pod(), xauto_access);
2902 require(state_is_auto_read_accessible(xauto_access));
2903 require(!xname.empty());
2904 require(contains_member(xmbr_hub_id, xauto_access));
2913 bool result = crg().member_name_map().contains_entry(xmbr_hub_id, xname);
2933 require(xauto_access || state_is_read_accessible());
2934 require(!xname.empty());
2935 require(contains_member(xmbr_id, xauto_access));
2939 return member_has_name(xmbr_id.
hub_pod(), xname, xauto_access);
2945 const std::string& xname,
2951 require(state_is_auto_read_write_accessible(xauto_access));
2952 require(contains_member(xmbr_hub_id, xauto_access));
2953 require(poset_path::is_valid_name(xname));
2959 get_read_write_access(
true);
2962 crg().member_name_map().put_entry(xmbr_hub_id, xname, xunique);
2971 ensure(member_has_name(xmbr_hub_id, xname, xauto_access));
2981 const std::string& xname,
2987 require(xauto_access || state_is_read_write_accessible());
2988 require(contains_member(xmbr_id, xauto_access));
2989 require(poset_path::is_valid_name(xname));
2993 put_member_name(xmbr_id.
hub_pod(), xname, xunique, xauto_access);
2997 ensure(member_has_name(xmbr_id, xname, xauto_access));
3010 require(!xname.empty());
3011 require(state_is_auto_read_write_accessible(xauto_access));
3017 get_read_write_access(
true);
3020 crg().member_name_map().delete_name(xname);
3029 ensure(!contains_member(xname, xauto_access));
3042 require(state_is_auto_read_write_accessible(xauto_access));
3048 get_read_write_access(
true);
3051 crg().member_name_map().delete_index(xmbr_hub_id);
3060 ensure(member_name_ct(xmbr_hub_id, xauto_access) == 0);
3073 require(xauto_access || state_is_read_write_accessible());
3077 delete_all_member_names(xmbr_id.
hub_pod(), xauto_access);
3081 ensure(member_name_ct(xmbr_id, xauto_access) == 0);
3096 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
3124 require(state_is_auto_read_accessible(xauto_access));
3142 ensure(is_basic_query);
3155 require(state_is_auto_read_accessible(xauto_access));
3173 ensure(is_basic_query);
3186 require(state_is_auto_read_accessible(xauto_access));
3217 require(state_is_auto_read_accessible(xauto_access));
3235 ensure(result.
same_scope(member_hub_id_space(xauto_access)));
3248 require(state_is_auto_read_accessible(xauto_access));
3267 ensure(result.
same_scope(member_hub_id_space(xauto_access)));
3268 ensure(result.
pod() == xid);
3277 member_id(
const std::string& xname,
bool xauto_access)
const 3281 require(state_is_auto_read_accessible(xauto_access));
3282 require(!xname.empty());
3302 ensure(
is_valid(result) ? member_has_name(result, xname, xauto_access) :
true);
3315 require(state_is_auto_read_accessible(xauto_access));
3316 require(!xname.empty());
3320 result.
put(member_hub_id_space(xauto_access), member_id(xname, xauto_access));
3324 ensure(result.
is_valid() ? member_has_name(result, xname, xauto_access) :
true);
3339 require(state_is_read_write_accessible());
3343 crg()._id_spaces.update_standard_id_spaces();
3358 require(state_is_auto_read_write_accessible(xauto_access));
3364 get_read_write_access(
true);
3367 crg()._id_spaces.clear_id_spaces();
3371 ensure(member_id_spaces(
false).has_only_standard_id_spaces());
3389 require(state_is_auto_read_write_accessible(xauto_access));
3390 require(!member_hub_id_space(xauto_access).is_empty());
3396 get_read_write_access();
3399 define_old_variable(
const index_space_handle& last_term = member_id_spaces(
false).last_term());
3400 define_old_variable(
scoped_index old_last_term_begin(last_term, last_term.begin()));
3402 if(xct > crg()._id_spaces.last_term().ct())
3404 crg()._id_spaces.extend_last_term(xct);
3414 ensure_for_range(
scoped_index i=old_last_term_begin, i<old_last_term_begin+xct, ++i, i.
in_scope());
3427 require(state_is_auto_read_write_accessible(xauto_access));
3433 get_read_write_access();
3463 bool result =
false;
3467 require(state_is_read_accessible());
3468 require(contains_member(xlesser,
false));
3469 require(contains_member(xgreater,
false));
3473 result = xgreater == xlesser;
3480 while((!itr.
is_done()) && !result)
3482 result = le(xgreater, itr.
hub_pod());
3485 release_cover_id_space_iterator(itr);
3490 ensure(unexecutable(upset of xlesser contains xgreater));
3501 bool result =
false;
3505 require(state_is_read_accessible());
3506 require(contains_member(xlesser,
false));
3507 require(contains_member(xgreater,
false));
3515 ensure(unexecutable(upset of xlesser contains xgreater));
3526 bool result =
false;
3530 require(state_is_read_accessible());
3531 require(contains_member(xlesser,
false));
3532 require(contains_member(xgreater,
false));
3536 result = le(xgreater, xlesser) || is_jem(xgreater, xlesser);
3540 ensure(unexecutable(upset of xlesser contains xgreater));
3551 bool result =
false;
3555 require(state_is_read_accessible());
3556 require(contains_member(xlesser,
false));
3557 require(contains_member(xgreater,
false));
3565 ensure(unexecutable(upset of xlesser contains xgreater));
3580 require(state_is_read_accessible());
3581 require(contains_member(xmbr_hub_id,
false));
3582 require(contains_member(xother_hub_id,
false));
3586 result = (greatest_jem(xmbr_hub_id) == greatest_jem(xother_hub_id));
3603 require(state_is_read_accessible());
3604 require(contains_member(xmbr_id,
false));
3605 require(contains_member(xother_id,
false));
3618 require(state_is_read_accessible());
3619 require(contains_member(xmbr_hub_id,
false));
3626 if(!cover_is_empty(
UPPER, result))
3628 lfirst_upper_mbr = first_cover_member(
UPPER, result);
3632 while(
is_valid(lfirst_upper_mbr) &&
3633 !is_jim(lfirst_upper_mbr) &&
3634 cover_is_singleton(
LOWER, lfirst_upper_mbr))
3636 result = lfirst_upper_mbr;
3637 if(cover_is_empty(
UPPER, lfirst_upper_mbr))
3643 lfirst_upper_mbr = first_cover_member(
UPPER, lfirst_upper_mbr);
3660 require(state_is_read_accessible());
3661 require(contains_member(xmbr_id,
false));
3665 result.
put(member_hub_id_space(
false), greatest_jem(xmbr_id.
hub_pod()));
3680 require(state_is_read_accessible());
3681 require(contains_member(xmbr_hub_id,
false));
3686 while(!is_jim(result) && cover_is_singleton(
LOWER, result))
3688 result = first_cover_member(
LOWER, result);
3693 ensure(is_jim(result) || !cover_is_singleton(
LOWER, result));
3694 ensure(le(xmbr_hub_id, result));
3707 require(state_is_read_accessible());
3708 require(contains_member(xmbr_id,
false));
3712 result.
put(member_hub_id_space(
false), least_jem(xmbr_id.
hub_pod()));
3716 ensure(is_jim(result) || !cover_is_singleton(
LOWER, result));
3717 ensure(le(xmbr_id, result));
3731 require(xjem1 != TOP_INDEX);
3732 require(xjem1 != BOTTOM_INDEX);
3733 require(cover_is_empty(
LOWER, xjem1));
3734 require(cover_is_empty(
UPPER, xjem1));
3748 if(lgjem != TOP_INDEX)
3753 transfer_cover(lgjem, xjem1,
false);
3754 new_link(xjem1, lgjem);
3761 transfer_cover(lgjem, xjem1,
true);
3762 new_link(lgjem, xjem1);
3767 ensure(is_jem(xjem2, xjem1));
3768 ensure(greatest_jem(xjem2) != TOP_INDEX ?
3769 greatest_jem(xjem2) == xjem1 :
3784 require(xjem1 != TOP_INDEX);
3785 require(xjem1 != BOTTOM_INDEX);
3786 require(cover_is_empty(
LOWER, xjem1));
3787 require(cover_is_empty(
UPPER, xjem1));
3795 ensure(is_jem(xjem2, xjem1));
3796 ensure(greatest_jem(xjem2.
hub_pod()) != TOP_INDEX ?
3811 require(xjem1 != TOP_INDEX);
3812 require(xjem1 != BOTTOM_INDEX);
3813 require(cover_is_empty(
LOWER, xjem1));
3814 require(cover_is_empty(
UPPER, xjem1));
3828 if(is_jim(lljem) || lljem == BOTTOM_INDEX)
3833 transfer_cover(lljem, xjem1,
false);
3834 new_link(xjem1, lljem);
3841 transfer_cover(lljem, xjem1,
true);
3842 new_link(lljem, xjem1);
3847 ensure(is_jem(xjem2, xjem1));
3848 ensure((least_jem(xjem2) == xjem1) ||
3849 is_jim(least_jem(xjem2)) ||
3850 (least_jem(xjem2) == BOTTOM_INDEX));
3863 require(xjem1 != TOP_INDEX);
3864 require(xjem1 != BOTTOM_INDEX);
3865 require(cover_is_empty(
LOWER, xjem1));
3866 require(cover_is_empty(
UPPER, xjem1));
3874 ensure(is_jem(xjem2, xjem1));
3876 is_jim(least_jem(xjem2.
hub_pod())) ||
3877 (least_jem(xjem2.
hub_pod()) == BOTTOM_INDEX));
3890 require(xjem1 != xjem2);
3891 require(!is_jem(xjem1, BOTTOM_INDEX));
3892 require(state_is_read_write_accessible());
3893 require(contains_member(xjem1,
false));
3894 require(contains_member(xjem2,
false));
3895 require(!is_jim(xjem1));
3896 require(!is_jim(xjem2));
3897 require(cover_is_equal(
LOWER, xjem1, xjem2));
3916 transfer_cover(gjem2, gjem1,
false);
3924 transfer_cover(ljem1, ljem2,
true);
3932 new_link(ljem1, gjem2);
3937 ensure(le(xjem1, xjem2));
3950 require(xjem1 !=~ xjem2);
3951 require(!is_jem(xjem1, bottom().index()));
3952 require(state_is_read_write_accessible());
3953 require(contains_member(xjem1,
false));
3954 require(contains_member(xjem2,
false));
3955 require(!is_jim(xjem1));
3956 require(!is_jim(xjem2));
3957 require(cover_is_equal(
LOWER, xjem1, xjem2));
3965 ensure(le(xjem1, xjem2));
3990 require(contains_member(xgreater,
false));
3991 require(xgreater != BOTTOM_INDEX);
3992 require(contains_member(xlesser,
false));
3993 require(xlesser != TOP_INDEX);
3999 crg().insert_cover_member(xgreater,
UPPER, xlesser);
4000 crg().insert_cover_member(xlesser,
LOWER, xgreater);
4009 ensure(unexecutable(contains_link(xgreater, xlesser)));
4023 require(contains_member(xgreater,
false));
4024 require(xgreater.
hub_pod() != BOTTOM_INDEX);
4025 require(contains_member(xlesser,
false));
4026 require(xlesser.
hub_pod() != TOP_INDEX);
4039 ensure(unexecutable(contains_link(xgreater, xlesser)));
4054 require(state_is_read_write_accessible());
4058 crg().remove_cover_member(xgreater,
UPPER, xlesser);
4059 crg().remove_cover_member(xlesser,
LOWER, xgreater);
4063 ensure(invariant());
4064 ensure(!contains_link(xgreater, xlesser));
4078 require(state_is_read_write_accessible());
4086 ensure(invariant());
4087 ensure(!contains_link(xgreater, xlesser));
4098 bool result =
false;
4102 require(state_is_read_accessible());
4103 require(contains_member(xlesser,
false));
4104 require(contains_member(xgreater,
false));
4109 crg().cover_contains_member(
LOWER, xgreater, xlesser) &&
4110 crg().cover_contains_member(
UPPER, xlesser, xgreater);
4123 bool result =
false;
4127 require(state_is_read_accessible());
4128 require(contains_member(xlesser,
false));
4129 require(contains_member(xgreater,
false));
4142 require(contains_member(xmbr_hub_id));
4146 pod_index_type result = crg().cover_id_space_id(xlower, xmbr_hub_id);
4163 require(contains_member(xmbr_id));
4184 require(state_is_read_accessible());
4185 require(contains_member(xmbr_hub_id,
false));
4189 return crg().get_cover_id_space(xlower, xmbr_hub_id);
4198 require(state_is_read_accessible());
4199 require(contains_member(xmbr_id));
4203 return get_cover_id_space(xlower, xmbr_id.
hub_pod());
4212 require(state_is_read_accessible());
4216 crg().release_cover_id_space(xcover_id_space);
4233 require(state_is_read_accessible());
4234 require(contains_member(xmbr_hub_id,
false));
4238 return crg().get_cover_id_space_iterator(xlower, xmbr_hub_id);
4247 require(state_is_read_accessible());
4248 require(contains_member(xmbr_id));
4252 return get_cover_id_space_iterator(xlower, xmbr_id.
hub_pod());
4261 require(state_is_read_accessible());
4265 crg().release_cover_id_space_iterator(xcover_itr);
4284 require(state_is_read_accessible());
4285 require(contains_member(xmbr_hub_id,
false));
4289 return crg().cover_contains_iterator(xlower, xmbr_hub_id, xitr);
4300 require(state_is_read_accessible());
4301 require(contains_member(xmbr_id));
4305 return cover_contains_iterator(xlower, xmbr_id.
hub_pod(), xitr);
4314 require(state_is_read_accessible());
4315 require(contains_member(xmbr_hub_id,
false));
4319 return crg().cover_is_empty(xlower, xmbr_hub_id);
4328 require(state_is_read_accessible());
4329 require(contains_member(xmbr_id,
false));
4333 return cover_is_empty(xlower, xmbr_id.
hub_pod());
4342 require(state_is_read_accessible());
4343 require(contains_member(xmbr_hub_id,
false));
4347 return crg().cover_is_singleton(xlower, xmbr_hub_id);
4356 require(state_is_read_accessible());
4357 require(contains_member(xmbr_id,
false));
4361 return cover_is_singleton(xlower, xmbr_id.
hub_pod());
4372 require(state_is_read_accessible());
4373 require(contains_member(xmbr_hub_id,
false));
4377 result = crg().cover_ct(xlower, xmbr_hub_id);
4381 ensure(result >= 0);
4396 require(state_is_read_accessible());
4397 require(contains_member(xmbr_id,
false));
4401 result = cover_ct(xlower, xmbr_id.
hub_pod());
4405 ensure(result >= 0);
4420 require(state_is_read_accessible());
4421 require(contains_member(xmbr_hub_id,
false));
4425 return crg().cover_contains_member(xlower, xmbr_hub_id, xother_mbr_hub_id);
4436 require(state_is_read_accessible());
4437 require(contains_member(xmbr_id));
4441 return cover_contains_member(xlower,
4454 require(state_is_read_accessible());
4455 require(contains_member(xmbr_hub_id,
false));
4456 require(contains_member(xother_mbr_hub_id,
false));
4460 return crg().cover_is_equal(xlower, xmbr_hub_id, xother_mbr_hub_id);
4471 require(state_is_read_accessible());
4472 require(contains_member(xmbr_id));
4473 require(contains_member(xother_mbr_id));
4477 return cover_is_equal(xlower,
4488 require(state_is_read_accessible());
4489 require(contains_member(xmbr_hub_id,
false));
4490 require(!cover_is_empty(xlower, xmbr_hub_id));
4494 return crg().first_cover_member(xlower, xmbr_hub_id);
4504 require(state_is_read_accessible());
4505 require(contains_member(xmbr_id));
4506 require(!cover_is_empty(xlower, xmbr_id));
4510 result.
put(member_hub_id_space(
false),
4511 first_cover_member(xlower, xmbr_id.
hub_pod()));
4528 require(state_is_read_write_accessible());
4529 require(contains_member(xmbr_hub_id,
false));
4530 require(!cover_contains_member(xlower, xmbr_hub_id, xother_mbr_hub_id));
4534 crg().insert_cover_member(xother_mbr_hub_id, xlower, xmbr_hub_id);
4540 ensure(unexecutable(cover_contains_member(xlower, xmbr_hub_id, xother_mbr_hub_id)));
4555 require(state_is_read_write_accessible());
4556 require(contains_member(xmbr_id));
4560 insert_cover_member(xother_mbr_id.
hub_pod(),
4568 ensure(unexecutable(cover_contains_member(xlower, xmbr_id, xother_mbr_id)));
4584 require(state_is_read_write_accessible());
4585 require(contains_member(xmbr_hub_id,
false));
4586 require(cover_contains_iterator(xlower, xmbr_hub_id, xitr));
4590 crg().insert_cover_member(xother_mbr_hub_id, xlower, xmbr_hub_id, xitr);
4596 ensure(unexecutable(cover_contains_member(xlower, xmbr_hub_id, xother_mbr_hub_id)));
4612 require(state_is_read_write_accessible());
4613 require(contains_member(xmbr_id));
4614 require(cover_contains_iterator(xlower, xmbr_id, xitr));
4618 insert_cover_member(xother_mbr_id.
hub_pod(),
4627 ensure(unexecutable(cover_contains_member(xlower, xmbr_id, xother_mbr_id)));
4642 require(state_is_read_write_accessible());
4643 require(contains_member(xmbr_hub_id,
false));
4647 crg().remove_cover_member(xother_mbr_hub_id, xlower, xmbr_hub_id);
4653 ensure(unexecutable(!cover_contains_member(xlower, xmbr_hub_id, xother_mbr_hub_id)));
4668 require(state_is_read_write_accessible());
4669 require(contains_member(xmbr_id));
4673 remove_cover_member(xother_mbr_id.
hub_pod(),
4681 ensure(unexecutable(!cover_contains_member(xlower, xmbr_id, xother_mbr_id)));
4696 require(state_is_read_write_accessible());
4697 require(contains_member(xmbr_hub_id,
false));
4701 crg().remove_cover_member(xitr, xlower, xmbr_hub_id);
4707 ensure(unexecutable(!cover_contains_member(xlower, xmbr_hub_id, old_xitr_item)));
4722 require(state_is_read_write_accessible());
4723 require(contains_member(xmbr_id));
4727 remove_cover_member(xitr, xlower, xmbr_id.
hub_pod());
4733 ensure(unexecutable(!cover_contains_member(xlower, xmbr_id, old_xitr_item)));
4749 require(state_is_read_write_accessible());
4750 require(contains_member(xmbr_hub_id,
false));
4752 define_old_variable(
bool old_cover_contains_old_other_mbr_hub_id = cover_contains_member(xlower, xmbr_hub_id, xold_other_mbr_hub_id));
4756 crg().replace_cover_member(xold_other_mbr_hub_id, xnew_other_mbr_hub_id, xlower, xmbr_hub_id);
4762 ensure(unexecutable(!cover_contains_member(xlower, xmbr_hub_id, xold_other_mbr_hub_id)));
4763 ensure(unexecutable(old_cover_contains_old_other_mbr_hub_id ? cover_contains_member(xlower, xmbr_hub_id, xnew_other_mbr_hub_id) :
true));
4779 require(state_is_read_write_accessible());
4780 require(contains_member(xmbr_id));
4782 define_old_variable(
bool old_cover_contains_old_other_mbr_id = cover_contains_member(xlower, xmbr_id, xold_other_mbr_id));
4786 replace_cover_member(xold_other_mbr_id.
hub_pod(),
4795 ensure(unexecutable(!cover_contains_member(xlower, xmbr_id, xold_other_mbr_id)));
4796 ensure(unexecutable(old_cover_contains_old_other_mbr_id ? cover_contains_member(xlower, xmbr_id, xnew_other_mbr_id) :
true));
4809 require(state_is_read_write_accessible());
4810 require(contains_member(xmbr_hub_id,
false));
4814 crg().clear_cover(xlower, xmbr_hub_id);
4818 ensure(cover_is_empty(xlower, xmbr_hub_id));
4831 require(state_is_read_write_accessible());
4832 require(contains_member(xmbr_id));
4836 clear_cover(xlower, xmbr_id.
hub_pod());
4840 ensure(cover_is_empty(xlower, xmbr_id));
4853 require(state_is_read_write_accessible());
4854 require(contains_member(xmbr_hub_id,
false));
4855 require(contains_member(xother_mbr_hub_id,
false));
4859 crg().copy_cover(xlower, xmbr_hub_id, xother_mbr_hub_id);
4865 ensure(unexecutable(cover_is_equal(xlower, xmbr_hub_id, xother_mbr_hub_id)));
4878 require(state_is_read_write_accessible());
4879 require(contains_member(xmbr_id));
4880 require(contains_member(xother_mbr_id));
4892 ensure(unexecutable(cover_is_equal(xlower, xmbr_id, xother_mbr_id)));
4906 require(state_is_read_write_accessible());
4907 require_for_range(
pod_index_type i=xmbr_hub_begin, i<xmbr_hub_end, ++i, contains_member(i));
4911 crg().append_upper_cover_of_bottom(xmbr_hub_begin, xmbr_hub_end);
4915 ensure_for_range(
pod_index_type i=xmbr_hub_begin, i<xmbr_hub_end, ++i, cover_contains_member(
UPPER, BOTTOM_INDEX, i));
4929 require(state_is_read_write_accessible());
4930 require_for_range(
scoped_index i=xmbr_begin, i<xmbr_end, ++i, contains_member(i));
4934 append_upper_cover_of_bottom(xmbr_begin.
hub_pod(), xmbr_end.
hub_pod());
4938 ensure_for_range(
scoped_index i=xmbr_begin, i<xmbr_end, ++i, cover_contains_member(
UPPER, BOTTOM_INDEX, i.hub_pod()));
4953 require(contains_member(xsrc));
4954 require(contains_member(xdst));
4971 remove_cover_member(xsrc, !xlower, src_itr.
hub_pod());
4975 xlower ? new_link(xdst, src_itr.
hub_pod()) : new_link(src_itr.
hub_pod(), xdst);
4981 release_cover_id_space_iterator(src_itr);
4985 clear_cover(xlower, xsrc);
5011 require(state_is_read_accessible());
5015 size_type result = powerset().subposet_ct();
5019 ensure(result >= 0);
5032 require(state_is_read_accessible());
5036 result = powerset().standard_subposet_ct();
5040 ensure(result >= 0);
5053 require(state_is_read_accessible());
5057 result = (subposet_ct() == standard_subposet_ct());
5061 ensure(result == (subposet_ct() == standard_subposet_ct()));
5073 require(state_is_read_accessible());
5092 require(state_is_read_accessible());
5093 require(!xname.empty());
5097 pod_index_type result = powerset().subposet_name_map().index(xname);
5101 ensure(invariant());
5102 ensure(
is_valid(result) ? includes_subposet(result) :
true);
5115 require(state_is_read_accessible());
5116 require(!xname.empty());
5120 result = powerset().
hub_id(powerset().subposet_name_map().index(xname));
5124 ensure(invariant());
5125 ensure(result.is_valid() ? includes_subposet(result) :
true);
5138 require(state_is_read_accessible());
5142 return powerset().get_subposet_id_space_iterator();
5151 require(state_is_read_accessible());
5155 powerset().release_subposet_id_space_iterator(xitr);
5172 require(state_is_auto_read_accessible(xauto_access));
5181 result = powerset().contains_subposet(xsubposet_hub_id);
5203 require(xauto_access || state_is_read_accessible());
5207 return includes_subposet(xsubposet_id.
hub_pod(), xauto_access);
5218 require(state_is_auto_read_accessible(xauto_access));
5228 result =
is_valid(lid) ? includes_subposet(lid,
false) :
false;
5250 require(!xauto_access ? state_is_read_accessible() :
true);
5256 includes_subposet(xs->
index(), xauto_access);
5273 require(state_is_auto_read_accessible(xauto_access));
5283 while(i < xhub_ids.
ct() && result)
5285 result = includes_subposet(xhub_ids[i],
false);
5296 ensure(unexecutable(
"result == for all i in xhub_ids( includes_subposet(i))"));
5311 require(state_is_auto_read_accessible(xauto_access));
5321 while(i < xids.
ct() && result)
5323 result = includes_subposet(xids[i].hub_pod(),
false);
5334 ensure(unexecutable(
"result == for all i in xids( includes_subposet(i))"));
5347 require(state_is_read_write_accessible());
5357 ensure(invariant());
5358 ensure(includes_subposet(result,
false));
5371 require(state_is_read_write_accessible());
5377 powerset().new_subposet(xinitialize, result);
5381 ensure(invariant());
5382 ensure(includes_subposet(result,
false));
5395 require(state_is_read_write_accessible());
5396 require(contains_members(xmembers));
5406 ensure(invariant());
5407 ensure(includes_subposet(result,
false));
5420 require(state_is_read_write_accessible());
5421 require(contains_members(xmembers));
5427 powerset().new_subposet(xmembers, result);
5431 ensure(invariant());
5432 ensure(includes_subposet(result,
false));
5445 require(state_is_read_write_accessible());
5446 require(includes_subposet(xsubposet_hub_id,
false));
5450 powerset().delete_subposet(xsubposet_hub_id);
5454 ensure(invariant());
5455 ensure(!includes_subposet(xsubposet_hub_id,
false));
5468 require(state_is_read_write_accessible());
5469 require(includes_subposet(xsubposet_id,
false));
5473 delete_subposet(xsubposet_id.
hub_pod());
5477 ensure(invariant());
5478 ensure(!includes_subposet(xsubposet_id,
false));
5489 require(state_is_read_accessible());
5491 return powerset().whole();
5499 require(state_is_read_accessible());
5501 return powerset().jims();
5508 require(state_is_read_accessible());
5510 return powerset().jims();
5517 require(state_is_read_accessible());
5519 return powerset().table_dof_subposet();
5526 require(state_is_read_accessible());
5528 return powerset().table_dof_subposet();
5535 require(state_is_read_accessible());
5537 return powerset().row_dof_subposet();
5544 require(state_is_read_accessible());
5546 return powerset().row_dof_subposet();
5561 static const string result(
"whole");
5592 return *(state_obj()->powerset());
5601 require(state_is_read_write_accessible());
5607 subposet& lccr_jims = powerset().coarsest_common_refinement_jims();
5609 lccr_jims.
put_name(
"jims",
true,
false);
5613 subposet& lccr = powerset().coarsest_common_refinement();
5615 lccr.
put_name(coarsest_common_refinement_name(),
true,
false);
5619 string lccr_name(version_to_name(0));
5620 lccr.
put_name(lccr_name,
false,
false);
5621 lccr_jims.
put_name(lccr_name +
"_jims",
false,
false);
5627 powerset().jims().attach_to_state(&lccr_jims);
5633 powerset().whole().attach_to_state(&lccr);
5637 resident().new_state(
this,
true,
false);
5638 resident().put_name(
"resident",
true,
false);
5642 put_standard_subposet_ct(subposet_ct());
5646 powerset().enable_invariant_check();
5650 ensure(powerset().invariant());
5651 ensure(jims().is_attached() && jims().index() == JIMS_INDEX);
5652 ensure(whole().is_attached() && whole().index() ==
WHOLE_INDEX);
5653 ensure(resident().is_attached() && resident().index() == RESIDENT_INDEX);
5654 ensure(has_standard_subposet_ct());
5665 powerset().put_standard_subposet_ct(xct);
5683 require(state_is_auto_read_accessible(xauto_access));
5697 string result(powerset().subposet_name_map().name(xsubposet_hub_id));
5715 require(xauto_access || state_is_read_accessible());
5719 return subposet_name(xsubposet_id.
hub_pod(), xauto_access);
5726 bool xauto_access)
const 5730 require(state_is_auto_read_accessible(xauto_access));
5731 require(includes_subposet(xsubposet_hub_id, xauto_access));
5740 powerset().subposet_name_map().all_names(xsubposet_hub_id, xresult);
5749 ensure(xresult.
ct() == subposet_name_ct(xsubposet_hub_id, xauto_access));
5750 ensure_for_all(i, 0, xresult.
ct(), subposet_has_name(xsubposet_hub_id, xresult[i], xauto_access));
5761 bool xauto_access)
const 5765 require(xauto_access || state_is_read_accessible());
5766 require(includes_subposet(xsubposet_id, xauto_access));
5770 all_subposet_names(xsubposet_id.
hub_pod(), xresult, xauto_access);
5774 ensure(xresult.
ct() == subposet_name_ct(xsubposet_id, xauto_access));
5775 ensure_for_all(i, 0, xresult.
ct(), subposet_has_name(xsubposet_id, xresult[i], xauto_access));
5790 require(state_is_auto_read_accessible(xauto_access));
5791 require(includes_subposet(xsubposet_hub_id, xauto_access));
5800 result = powerset().subposet_name_map().name_ct(xsubposet_hub_id);
5822 require(xauto_access || state_is_read_accessible());
5823 require(includes_subposet(xsubposet_id, xauto_access));
5827 return subposet_name_ct(xsubposet_id.
hub_pod(), xauto_access);
5833 const std::string& xname,
5834 bool xauto_access)
const 5838 require(state_is_auto_read_accessible(xauto_access));
5839 require(!xname.empty());
5840 require(includes_subposet(xsubposet_hub_id, xauto_access));
5850 powerset().subposet_name_map().contains_entry(xsubposet_hub_id, xname);
5867 const std::string& xname,
5868 bool xauto_access)
const 5872 require(xauto_access || state_is_read_accessible());
5873 require(!xname.empty());
5874 require(includes_subposet(xsubposet_id, xauto_access));
5878 return subposet_has_name(xsubposet_id.
hub_pod(), xname, xauto_access);
5884 const std::string& xname,
5890 require(state_is_auto_read_write_accessible(xauto_access));
5891 require(includes_subposet(xsubposet_hub_id, xauto_access));
5892 require(poset_path::is_valid_name(xname));
5898 get_read_write_access(
true);
5901 powerset().subposet_name_map().put_entry(xsubposet_hub_id, xname, xunique);
5911 (subposet_name(xsubposet_hub_id, xauto_access) == xname) :
5912 subposet_has_name(xsubposet_hub_id, xname, xauto_access));
5922 const std::string& xname,
5928 require(xauto_access || state_is_read_write_accessible());
5929 require(includes_subposet(xsubposet_id, xauto_access));
5930 require(poset_path::is_valid_name(xname));
5934 put_subposet_name(xsubposet_id.
hub_pod(), xname, xunique, xauto_access);
5939 (subposet_name(xsubposet_id, xauto_access) == xname) :
5940 subposet_has_name(xsubposet_id, xname, xauto_access));
5953 require(!xname.empty());
5954 require(state_is_auto_read_write_accessible(xauto_access));
5960 get_read_write_access(
true);
5963 powerset().subposet_name_map().delete_name(xname);
5972 ensure(!includes_subposet(xname, xauto_access));
5985 require(state_is_auto_read_write_accessible(xauto_access));
5991 get_read_write_access(
true);
5994 powerset().subposet_name_map().delete_index(xsubposet_hub_id);
6003 ensure(subposet_name_ct(xsubposet_hub_id, xauto_access) == 0);
6016 require(xauto_access || state_is_read_write_accessible());
6020 delete_all_subposet_names(xsubposet_id.
hub_pod(), xauto_access);
6024 ensure(subposet_name_ct(xsubposet_id, xauto_access) == 0);
6048 require(state_is_auto_read_accessible(xauto_access));
6066 ensure(is_basic_query);
6079 require(state_is_auto_read_accessible(xauto_access));
6097 ensure(is_basic_query);
6110 require(state_is_auto_read_accessible(xauto_access));
6141 require(state_is_auto_read_accessible(xauto_access));
6159 ensure(result.
same_scope(subposet_hub_id_space(xauto_access)));
6172 require(state_is_auto_read_accessible(xauto_access));
6191 ensure(result.
same_scope(subposet_hub_id_space(xauto_access)));
6192 ensure(result.
pod() == xid);
6216 require(state_is_read_accessible());
6236 require(state_is_read_accessible());
6256 require(xauto_access || state_is_read_accessible());
6286 require(xauto_access || state_is_read_accessible());
6339 require(state_is_read_accessible());
6343 result = schema().name() == xschema_name;
6360 require(state_is_read_accessible());
6361 require(xother != 0);
6366 result = schema().is_same_state(&(xother->
schema()));
6383 require(state_is_read_accessible());
6384 require(xother != 0);
6390 result = same_schema(xother->
host());
6415 require(xdof_map != 0);
6425 ensure(result == (dynamic_cast<const array_poset_dof_map*>(xdof_map) != 0));
6440 require(xdof_map != 0);
6460 ensure(result ? (dynamic_cast<const poset_dof_map*>(xdof_map) != 0) :
true);
6473 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
6481 return *(table().table_dofs());
6490 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
6498 return *(table().table_dofs());
6507 require(state_is_read_accessible());
6508 require(schema().table_dof_tuple_ub() > 0);
6509 require(xbuflen >= schema().table_dof_tuple_ub());
6513 table_dof_map().get_dof_tuple(xbuf, xbuflen);
6528 require(state_is_read_write_accessible());
6532 void* result = table_dof_map(
true).dof_tuple();
6547 require(state_is_read_accessible());
6551 const void* result = table_dof_map(
false).dof_tuple();
6566 require(state_is_auto_read_write_accessible(xauto_access));
6572 get_read_write_access(
true);
6596 require(state_is_auto_read_accessible(xauto_access));
6627 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
6628 require(contains_row_dof_tuple(xtuple_hub_id));
6632 result_ptr = table().row_dof_tuple(xtuple_hub_id);
6647 return *(state_obj()->table());
6657 require(state_is_read_write_accessible());
6658 require(xtable_dofs != 0 ? xtable_dof_ub >= schema().table_dof_tuple_ub() :
true);
6666 if((xtable_dofs != 0) && (lmap->
dof_ct() > 0))
6668 lmap->
put_dof_tuple(xtable_dofs, schema().table_dof_tuple_ub());
6670 table().put_table_dofs(lmap);
6688 require(xdof_tuple != 0);
6689 require(state_is_read_write_accessible());
6695 table().put_table_dofs(xdof_tuple);
6699 ensure(&(table_dof_map()) == xdof_tuple);
6722 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
6723 require(contains_row_dof_tuple(xtuple_id));
6727 return row_dof_map(xtuple_id.
hub_pod(), xrequire_write_access);
6736 require(state_is_read_write_accessible());
6740 define_old_variable(
int old_row_dof_tuple_ct = row_dof_tuple_ct());
6746 table().put_row_dof_tuple(lmap);
6751 ensure(row_dof_tuple_ct() == old_row_dof_tuple_ct+1);
6752 ensure(contains_row_dof_tuple(result));
6765 require(state_is_read_write_accessible());
6766 require(row_dof_map_conforms(&xprototype));
6771 define_old_variable(
int old_row_dof_tuple_ct = row_dof_tuple_ct());
6777 table().put_row_dof_tuple(lmap);
6782 ensure(row_dof_tuple_ct() == old_row_dof_tuple_ct+1);
6783 ensure(contains_row_dof_tuple(result));
6796 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
6797 require(contains_member(xmbr_hub_id,
false));
6798 require(is_jim(xmbr_hub_id,
false));
6803 row_dof_map(member_dof_tuple_id(xmbr_hub_id,
false), xrequire_write_access);
6818 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
6819 require(contains_member(xmbr_id,
false));
6820 require(is_jim(xmbr_id,
false));
6824 return member_dof_map(xmbr_id.
hub_pod(), xrequire_write_access);
6833 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
6834 require(contains_member(xmbr_hub_id,
false));
6835 require(is_jim(xmbr_hub_id,
false));
6840 row_dof_map(member_dof_tuple_id(xmbr_hub_id,
false), xrequire_write_access);
6855 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
6856 require(contains_member(xmbr_id,
false));
6857 require(is_jim(xmbr_id,
false));
6861 return member_dof_map(xmbr_id.
hub_pod(), xrequire_write_access);
6870 require(state_is_auto_read_accessible(xauto_access));
6871 require(contains_member(xmbr_hub_id, xauto_access));
6872 require(unexecutable(
"xbuf points to a buffer of length xbuflen"));
6873 require(xbuflen >= member_dof_map(xmbr_hub_id,
false).dof_tuple_ub());
6882 member_dof_map(xmbr_hub_id,
false).get_dof_tuple(xbuf, xbuflen);
6902 require(state_is_auto_read_write_accessible(xauto_access));
6903 require(contains_member(xmbr_hub_id, xauto_access));
6904 require(unexecutable(
"xbuf points to a buffer of length xbuflen"));
6905 require(xbuflen >= member_dof_map(xmbr_hub_id,
true).dof_tuple_ub());
6911 get_read_write_access();
6914 member_dof_map(xmbr_hub_id,
true).put_dof_tuple(xbuf, xbuflen);
6934 require(state_is_auto_read_accessible(xauto_access));
6935 require(contains_member(xmbr_hub_id,
false));
6953 ensure(!
is_valid(result) || contains_row_dof_tuple(result));
6964 bool xauto_access)
const 6968 require(state_is_auto_read_accessible(xauto_access));
6969 require(contains_member(xmbr_id,
false));
6978 result.
put(dof_tuple_hub_id_space(
false),
6979 member_dof_tuple_id(xmbr_id.
hub_pod(),
false));
6988 ensure(!result.
is_valid() || contains_row_dof_tuple(result));
7003 require(state_is_auto_read_write_accessible(xauto_access));
7004 require(contains_member(xmbr_hub_id,
false));
7005 require(contains_row_dof_tuple(xtuple_hub_id) || !
is_valid(xtuple_hub_id));
7011 get_read_write_access(
true);
7014 crg().put_member_dof_tuple_id(xmbr_hub_id, xtuple_hub_id);
7023 ensure(member_dof_tuple_id(xmbr_hub_id, xauto_access) == xtuple_hub_id);
7038 require(state_is_auto_read_write_accessible(xauto_access));
7039 require(contains_member(xmbr_id,
false));
7040 require(contains_row_dof_tuple(xtuple_id) || !xtuple_id.
is_valid());
7044 put_member_dof_tuple_id(xmbr_id.
hub_pod(),
7050 ensure(member_dof_tuple_id(xmbr_id.
hub_pod(), xauto_access) == xtuple_id.
hub_pod());
7065 require(state_is_read_accessible());
7069 result = table().contains_row_dof_tuple(xtuple_hub_id);
7084 require(state_is_read_accessible());
7088 return contains_row_dof_tuple(xtuple_id.
hub_pod());
7097 require(state_is_read_accessible());
7101 int result = table().row_dof_tuple_ct();
7105 ensure(result >= 0);
7118 require(state_is_read_accessible());
7122 result = table().standard_row_dof_tuple_ct();
7126 ensure(result >= 0);
7141 require(state_is_read_accessible());
7145 result = (row_dof_tuple_ct() == standard_row_dof_tuple_ct());
7149 ensure(result == (row_dof_tuple_ct() == standard_row_dof_tuple_ct()));
7176 require(state_is_auto_read_accessible(xauto_access));
7194 ensure(is_basic_query);
7207 require(state_is_auto_read_accessible(xauto_access));
7225 ensure(is_basic_query);
7238 require(state_is_auto_read_accessible(xauto_access));
7269 require(state_is_auto_read_accessible(xauto_access));
7287 ensure(result.
same_scope(dof_tuple_hub_id_space(xauto_access)));
7300 require(state_is_auto_read_accessible(xauto_access));
7319 ensure(result.
same_scope(dof_tuple_hub_id_space(xauto_access)));
7320 ensure(result.
pod() == xid);
7346 require(state_is_auto_read_accessible(xauto_access));
7355 result = includes_subposet(schema_poset_member::table_dof_subposet_name(
"top")) &&
7356 includes_subposet(schema_poset_member::row_dof_subposet_name(
"top"));
7367 ensure(unexecutable(result == top member has been schematized));
7382 require(state_is_read_write_accessible());
7383 require(xtable_dof_subposet != 0);
7384 require(includes_subposet(xtable_dof_subposet));
7385 require(xrow_dof_subposet != 0);
7386 require(includes_subposet(xrow_dof_subposet));
7390 string ltop_table_dof_sp_name(schema_poset_member::table_dof_subposet_name(
"top"));
7391 if(xtable_dof_subposet->
name() != ltop_table_dof_sp_name)
7393 xtable_dof_subposet->
put_name(ltop_table_dof_sp_name,
true,
false);
7395 table_dof_subposet().attach_to_state(xtable_dof_subposet,
false);
7397 if(!table_dof_subposet().has_id_space())
7399 initialize_dof_id_space(table_dof_subposet());
7402 string ltop_row_dof_sp_name(schema_poset_member::row_dof_subposet_name(
"top"));
7403 if(xrow_dof_subposet->
name() != ltop_row_dof_sp_name)
7405 xrow_dof_subposet->
put_name(ltop_row_dof_sp_name,
true,
false);
7407 row_dof_subposet().attach_to_state(xrow_dof_subposet,
false);
7409 if(!row_dof_subposet().has_id_space())
7411 initialize_dof_id_space(row_dof_subposet());
7416 ensure(is_schematized(
false));
7431 require(state_is_read_write_accessible());
7436 if(member_id_spaces(
false).contains(xdof_subposet.
id_space_name()))
7509 typedef name_map_type::const_iterator name_map_itr_type;
7510 typedef name_map_type::const_name_iterator name_itr_type;
7512 for(name_map_itr_type lmap_itr = powerset().subposet_name_map().begin();
7513 lmap_itr != powerset().subposet_name_map().end();
7516 for(name_itr_type lname_itr = lmap_itr->second.begin();
7517 lname_itr != lmap_itr->second.end();
7520 if(is_version_name(*lname_itr))
7530 assertion(result % 2 == 0);
7536 ensure(result >= 0);
7551 require(state_is_read_accessible());
7555 result = version_from_name(whole().name());
7572 require(state_is_read_accessible());
7573 require(has_version(xversion));
7577 if(xversion == CURRENT_HOST_VERSION)
7583 string lvl_name = version_to_name(xversion);
7584 result = subposet_id(lvl_name);
7589 ensure(includes_subposet(result,
false));
7602 require(state_is_read_accessible());
7603 require(has_version(xversion));
7607 result.
put(subposet_hub_id_space(
false), version_index(xversion));
7611 ensure(includes_subposet(result,
false));
7624 require(state_is_read_accessible());
7625 require(has_version(xversion));
7629 string lvl_name = version_to_name(xversion);
7630 lvl_name +=
"_jims";
7635 ensure(includes_subposet(result));
7648 require(state_is_read_accessible());
7649 require(has_version(xversion));
7653 result.
put(subposet_hub_id_space(
false), version_jims_index(xversion));
7657 ensure(includes_subposet(result));
7674 result = ( (xversion == CURRENT_HOST_VERSION) ||
7675 ( (0 <= xversion) && (xversion < version_ct()) ) ||
7676 (xversion == COARSEST_COMMON_REFINEMENT_VERSION) );