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) );
7695 result = version() != COARSEST_COMMON_REFINEMENT_VERSION;
7710 static const string result(
"__version_");
7718 static const int result = VERSION_PREFIX().size();
7736 result = (xname.substr(0, VERSION_PREFIX_LENGTH()) == VERSION_PREFIX());
7755 if(xversion == COARSEST_COMMON_REFINEMENT_VERSION)
7757 result = coarsest_common_refinement_name();
7762 str << VERSION_PREFIX() << xversion;
7768 ensure(!result.empty());
7769 ensure(xversion == COARSEST_COMMON_REFINEMENT_VERSION ? (result == coarsest_common_refinement_name()) : is_version_name(result));
7784 require(is_version_name(xname) || xname == coarsest_common_refinement_name());
7790 if(xname == coarsest_common_refinement_name())
7794 result = COARSEST_COMMON_REFINEMENT_VERSION;
7801 result = atoi(xname.c_str()+VERSION_PREFIX_LENGTH());
7817 require( has_version(xversion) );
7828 if(xversion == COARSEST_COMMON_REFINEMENT_VERSION)
7833 jims().attach_to_state(JIMS_INDEX);
7841 string lname = version_to_name(xversion);
7843 powerset().whole().attach_to_state(lid);
7848 lid = subposet_id(lname);
7849 jims().attach_to_state(lid);
7858 powerset().whole().put_version(CURRENT_HOST_VERSION);
7859 jims().put_version(CURRENT_HOST_VERSION);
7863 ensure(version() == xversion);
7903 get_int_id(xschema_member_ext_id, xid_space_name,
false);
7911 ensure(result != 0);
7912 ensure(schema_is_ancestor_of(result));
7929 require(state_is_read_accessible());
7930 require(includes_subposet(xindex));
7955 require(state_is_read_accessible());
7964 lbnd_id = xbounds.
ub_id();
7969 lbnd_id = xbounds.
lb_id();
7976 l_lb->
force(lbnd_id,
true);
7977 result =
new index_iterator(l_lb, member_hub_id_space(
false),
true);
7981 result = get_decomposition(lbnd_id);
7986 ensure(result != 0);
8003 require(state_is_read_accessible());
8007 require(contains_member(xindex,
false));
8016 lbnd_id = xbounds.
ub_id();
8021 lbnd_id = xbounds.
lb_id();
8027 result = (xindex == lbnd_id);
8031 result = powerset().subposet_contains_member(lbnd_id, xindex.
hub_pod());
8044 const std::string& xid_space_name,
8045 bool xauto_access)
const 8049 require(state_is_auto_read_accessible(xauto_access));
8056 require(xext_id >= standard_member_ct() ?
8057 member_id_spaces(
false).contains(xid_space_name) :
true);
8058 require(xext_id >= standard_member_ct() ?
8059 member_id_spaces(
false).contains(xid_space_name, xext_id) :
true);
8066 if(xext_id < standard_member_ct())
8077 result = member_id_spaces(
false).hub_pod(xid_space_name, xext_id);
8082 ensure(contains_member(result,
false));
8097 const std::string& xid_space_name,
8098 bool xauto_access)
const 8102 require(state_is_auto_read_accessible(xauto_access));
8113 if(xint_id >= standard_member_ct())
8115 result = member_id_spaces(
false).contains(xid_space_name);
8118 result = member_id_spaces(
false).contains_hub(xid_space_name, xint_id);
8137 const std::string& xid_space_name,
8138 bool xauto_access)
const 8142 require(state_is_auto_read_accessible(xauto_access));
8151 return is_valid_int_id(xint_id.
hub_pod(), xid_space_name, xauto_access);
8157 const std::string& xid_space_name,
8158 bool xauto_access)
const 8164 require(state_is_auto_read_accessible(xauto_access));
8165 require(is_valid_int_id(xint_id, xid_space_name, xauto_access));
8174 if(xint_id < standard_member_ct())
8185 result = member_id_spaces(
false).pod(xid_space_name, xint_id);
8195 ensure(result >= 0);
8205 const std::string& xid_space_name,
8206 bool xauto_access)
const 8212 require(xauto_access || state_is_read_accessible());
8213 require(is_valid_int_id(xint_id, xid_space_name, xauto_access));
8217 result = get_ext_id(xint_id.
hub_pod(), xid_space_name, xauto_access);
8221 ensure(result >= 0);
8236 require(state_is_read_accessible());
8243 result = schema().host()->index().pod();
8279 std::ostringstream oss;
8328 ensure(result != 0);
8329 ensure(is_same_type(result));
8342 if(invariant_check())
8344 disable_invariant_check();
8349 invariance( !index().
is_valid() == (name_space() == 0) );
8350 invariance( name_space() != 0 ? name_space()->contains_member(index()) :
true );
8361 invariance(state_is_read_accessible() ? jims().is_attached() :
true);
8362 invariance(state_is_read_accessible() ? whole().is_attached() :
true);
8363 invariance(state_is_read_accessible() ?
8364 (resident().is_attached() && (resident().index() == RESIDENT_INDEX)) :
8366 invariance(state_is_read_accessible() ?
8367 (top().is_attached() && (top().index() == TOP_INDEX)) :
8369 invariance(state_is_read_accessible() ?
8370 (bottom().is_attached() && (bottom().index() == BOTTOM_INDEX)) :
8378 invariance(state_is_read_accessible() ?
8379 schema_is_ancestor_of(&(table().schema())) :
8381 invariance(state_is_read_accessible() ? schema().state_is_read_accessible() :
true);
8388 enable_invariant_check();
8435 <<
"#### BEGIN POSET " << p.
name() <<
" ###################" 8441 os <<
"GENERAL" << endl
8442 <<
"-------" << endl
8445 os <<
"poset: '" << p.
name() <<
"'" 8446 <<
" \thost: '" << (p.
host() != 0 ? p.
host()->
name() :
"<void>") <<
"'" 8448 <<
" \tversion: " << p.
version()
8454 os << p.
crg() << endl;
8462 os << p.
table() << endl;
8467 <<
"#### END POSET " << p.
name() <<
" ###################" << endl;
8495 result = xinclude_shallow ?
sizeof(xp) : 0;
8499 result += deep_size(*xp.
_state,
true, xresults);
8503 result += deep_size(*xp.
_top,
true);
8507 result += deep_size(*xp.
_bottom,
true);
8511 ensure(result >= 0);
void put_version(int xversion)
Set the current level to xversion.
poset_table_state & table() const
The table of dof tuples of this poset.
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
pod_index_type ub_id() const
The index of the upper bound member, if the upper bound contains a single member. ...
poset_state_handle * host() const
The poset which this is a handle to a component of.
void delete_subposet_name(const std::string &xname, bool xauto_access=false)
Make xname not a name for any subposet.
virtual void delete_link(pod_index_type xgreater, pod_index_type xlesser)
Delete the cover link between hub id xgreater and hub id xlesser.
int version_from_name(const std::string &xname) const
Extracts the version from the standard name.
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
virtual bool is_jim(bool xin_current_version=true) const
True if this member is join irreducible in the current version of the host (xin_current_version == tr...
A client handle for a subposet.
virtual std::string subposet_name(pod_index_type xsubposet_hub_id, bool xauto_access=false) const
A name for the subposet with hub id xsubposet_hub_id.
size_type subposet_name_ct(pod_index_type xsubposet_hub_id, bool xauto_access) const
The number of names for the subposet with hub id xsubposet_hub_id.
void delete_all_member_names(pod_index_type xmbr_hub_id, bool xauto_access=false)
Delete all names for the member with hub id xmbr_hub_id.
void extend_last_member_term(size_type xct, bool xauto_access)
Extends the last term of the member hub id space to ct == xct.
bool is_valid() const
True if this is a valid id.
virtual schema_poset_member * new_schema_handle(const std::string &xid_space_name, pod_index_type xschema_member_ext_id, pod_index_type xbase_space_ext_id, pod_index_type xfiber_schema_ext_id, pod_index_type xlocal_schema_ext_id)
Creates a member handle of the type appropriate for members of this when used as a schema...
void insert_cover_member(pod_index_type xother_mbr_hub_id, bool xlower, pod_index_type xmbr_hub_id)
Inserts hub id xother_mbr_hub id in the lower (xlower true) or upper (xlower false) cover set of the ...
virtual void schematize(subposet *xtable_dof_subposet, subposet *xrow_dof_subposet, bool xall_members=false)
Prepare this poset and its top member for use as a schema. If xall_members = true, schematize all other members as well.
bool has_standard_member_ct() const
True if poset is in its initial state, that is, it contains just the standard members.
scoped_index insert_poset(const poset_state_handle &xposet, const std::string &xposet_name, bool xauto_link)
Inserts xposet into this namespace with member name xposet_name.
virtual void new_link(pod_index_type xgreater, pod_index_type xlesser)
Insert a cover link from greater to lesser (that is, hub id xgreater covers hub id xlesser)...
bool lb_is_singleton() const
True if the lower bound contains a single member.
bool full() const
True if both poset name and member name are not empty.
index_type ub() const
The upper bound on the storage array. The number of items current allocated in the storage array...
virtual int member_ct() const
The number of members of this poset.
abstract_poset_member & top()
The top member of the poset (mutable version)
size_type ct() const
The number of items currently in use.
bool in_scope() const
True if and only if scope() contains an entry for pod().
size_type member_name_ct(pod_index_type xmbr_hub_id, bool xauto_access) const
The number of names for the member with hub id xmbr_hub_id.
The private state of a partially ordered set.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
virtual size_type cover_ct(bool xlower, pod_index_type xmbr_hub_id) const
The number of members in the lower cover (xlower true) or upper cover (xlower false) of the member wi...
void initialize_dof_id_space(subposet &xdof_subposet)
Initialize the id space for the dof subposet, xdof_subposet.
virtual const primitives_poset & primitives() const
The set of primitives used by this poset.
An abstract iterator over the ids of an id space.
index_space_iterator & get_cover_id_space_iterator(bool xlower, pod_index_type xmbr_hub_id) const
Allocates an iterator for the lower (xlower true) or upper (xlower false) cover id space of the membe...
void table_dof_tuple(void *xbuf, size_t xbuflen) const
OBSOLETE: use table_dofs(). Copies the entire table dof tuple from internal storage to xbuf...
virtual void put_host(const poset_state_handle *xhost)
Sets host() to xhost.
bool cover_is_singleton(bool xlower, pod_index_type xmbr_hub_id) const
True if and only if the lower (xlower true) or upper (xlower false) cover set of the member with hub ...
virtual poset_state * state_obj() const
State object for this poset.
virtual index_space_iterator & get_subposet_id_space_iterator() const
Allocates an id space iterator over the subposet ids from the iterator pool.
const scoped_index & index() const
The member index of this poset within the namespace host()
virtual bool has_id_space() const
True if this already has an id space.
void initialize_table_dof_tuple(array_poset_dof_map *xdof_tuple)
Installs xdof_tuple as the table dof tuple.
std::string to_string()
Get instance information as a string.
virtual int standard_subposet_ct() const
The number of standard subposets automatically allocated by the constructor.
static const std::string & coarsest_common_refinement_name()
The name of the coarsest common refinement subposet.
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
virtual size_type subposet_ct() const
The number of subposets of this poset.
A factory for creating poset handles.
bool contains_members(const scoped_index *xmbrs, int xmbrs_ct, bool xauto_access=true) const
True if this poset contains poset member(s) with indices in xmbrs.
void clear_cover(bool xlower, pod_index_type xmbr_hub_id)
Clears the lower (xlower true) or upper (xlower false) cover set of the member with hub id xmbr_hub_i...
virtual bool table_dof_map_conforms(const poset_dof_map *xdof_map) const
True if xdof_map conforms to (is derived from) the type of table dof map required by this poset state...
poset_type
Identifiers for poset types.
pod_index_type member_dof_tuple_id(pod_index_type xmbr_hub_id, bool xauto_access) const
The dof tuple hub id of the member with hub id xmbr_hub_id.
virtual schema_poset_member & schema()
The schema on which this is allocated (mutable version).
const hub_index_space_handle & subposet_hub_id_space(bool xauto_access) const
The subposet hub id space.
virtual void initialize_standard_members()
Creates the members common to every poset, for instance, top() and bottom().
A client handle for a general, abstract partially order set.
virtual bool includes_subposet(pod_index_type xsubposet_hub_id, bool xauto_access=true) const
True if this poset includes subposet with hub id xsubposet_hub_id.
void replace_cover_member(const scoped_index &xold_other_mbr_hub_id, const scoped_index &xnew_other_mbr_hub_id, bool xlower, const scoped_index &xmbr_hub_id)
Replaces hub id xold_other_mbr_hub_id with hub id xnew_other_mbr_hub_id in the lower (xlower true) or...
const index_space_family & dof_tuple_id_spaces(bool xauto_access) const
Collection of dof tuple id spaces for this (const version).
const scoped_index & index() const
The current item in the subset.
index_space_handle & get_cover_id_space(bool xlower, pod_index_type xmbr_hub_id) const
Allocates a handle for the lower (xlower true) or upper (xlower false) cover id space of the member w...
void delete_all_subposet_names(pod_index_type xsubposet_hub_id, bool xauto_access=false)
Delete all names for the subposet with hub id xsubposet_hub_id;.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
void initialize_table_dofs(void *xtable_dofs, size_t xtable_dof_ub)
Initializes the table dofs ("class variables")
const index_space_family & member_id_spaces(bool xauto_access) const
Collection of member id spaces for this (const version).
virtual bool is_atom(pod_index_type xmbr_hub_id) const
True if the member with hub id xmbr_hub_id covers the bottom.
virtual void initialize_standard_subposets(const std::string &xname)
Creates the subposets common to every poset (e.g. whole() and jims()).
virtual const scoped_index & dof_tuple_id(bool xauto_access) const
An id in the dof tuple hub id space; intended for copying to initialize ids to the dof tuple id space...
void delete_member_name(const std::string &xname, bool xauto_access=false)
Make xname not a name for any member.
A partial multi-valued relation with total injective inverse between names and indices of type index_...
abstract_poset_member * _top
Top member of poset.
bool is_same_state(const poset_state_handle *xhost, pod_index_type xhub_id) const
True is this is attached to state with hub id xhub_id in host xhost.
int jim_edit_depth(bool xauto_access) const
Number of times begin_jim edit_mode has been called without matching end_jim_edit_mode.
member_name_map_type & member_name_map(bool xrequire_write_access=false)
The bidirectional map between member indices and names.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual const index_space_family & id_spaces() const
The id space family for this (const version).
poset_state_handle * poset_pointer() const
The pointer to the poset associated with this namespace member.
virtual int version() const
The current version.
bool index_in_bounds(const scoped_index &xmbr_id) const
True if 0 <= xmbr_id < state_obj()->member_index_ub().
virtual subposet & resident()
The subset of all members with resident (in memory) dof tuples (mutable version). ...
pod_index_type begin() const
The beginning of the member interval; this emulates members in the interval [begin(), end()), includes interval member.
virtual void attach_handle_data_members()
Initializes the handle data members when this handle is attached to a state. Intended to be redefined...
virtual bool le(pod_index_type xgreater, pod_index_type xlesser) const
True if hub id xlesser is less than or equal to hub id xgreater.
virtual bool row_dof_map_conforms(const poset_dof_map *xdof_map) const
True if xdof_map conforms to (is derived from) the type of row dof map required by this poset state a...
A (lower, upper) bounds pair for a poset. Specifies a portion of a poset for a bounded i/o operation...
void invalidate()
Make this id invalid.
const scoped_index & index() const
The index of the component state this handle is attached to.
virtual void next()=0
Makes id() the next id in the iteration.
std::string version_to_name(int xversion) const
Creates the standard name for the level xversion whole subposet.
The general, abstract map from dof ids to dof values.
virtual bool is_attached() const =0
True if this handle is attached to a state.
void clear_member_id_spaces(bool xauto_access)
Deletes all non-standard id spaces.
abstract_poset_member & bottom()
The bottom member of the poset (mutable version)
namespace_poset * host() const
The namespace this poset resides in. Obsolete; use name_space() instead.
virtual void put_member_name(pod_index_type xmbr_hub_id, const std::string &xname, bool xunique, bool xauto_access=false)
Make xname a name for the member with hub id xmbr_hub_id. if xunique, make xname the only name...
An implementation of class sum_index_space_handle that has a primary sum id space state...
bool is_version_name(const std::string &xname) const
True if xname has the proper form for a version name.
bool has_version(int xversion) const
True if xversion is a valid version.
abstract_poset_member * _bottom
Bottom members of poset.
virtual pod_index_type new_member(bool xis_jim, pod_index_type xtuple_hub_id)
Create a disconnected member with is_jim == xis_jim and the dof tuple identified by hub id xtuple_hub...
void put_standard_subposet_ct(int xct)
Sets the number of standard subposets automatically allocated by the constructor. ...
const hub_index_space_handle & dof_tuple_hub_id_space(bool xauto_access) const
The dof tuple hub id space.
void initialize_dof_tuple_ids(const block< pod_index_type > &xdof_tuple_ids)
Allocates and initializes dof_tuple_ids() with xdof_tuple_ids.
virtual bool is_jem(pod_index_type xmbr_hub_id, pod_index_type xother_hub_id) const
True if hub id xother_hub_id is join equivalent to hub id xmbr_hub_id.
Abstract implementation of crg_interval for an interval of implicit cover relation graph members...
void next()
Makes item the next member of the subset.
A client handle for a member of a namespace poset.
virtual void detach_from_state()
Detach this handle from its state.
bool same_scope(const scoped_index &xother) const
True if and only if this is in the same id space as xother.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
virtual void put_defaults()
Sets all dofs to defualt values.
bool is_hub_scope() const
True if and only if the id space of this is the hub id space.
void append_upper_cover_of_bottom(pod_index_type xmbr_hub_begin, pod_index_type xmbr_hub_end)
Appends the interval of hub ids [xmbr_hub_begin, xmbr_hub_end) to the upper cover of bottom...
virtual poset_type type_id() const
Identifier for the type of this poset.
virtual pod_index_type version_jims_index(int xversion) const
The subposet hub id of the jims() subposet for version xversion.
virtual void release_subposet_id_space_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the subposet iterator pool.
static int VERSION_PREFIX_LENGTH()
The length of _version_prefix.
void put_member_dof_tuple(pod_index_type xmbr_hub_id, void *xbuf, size_t xbuf_len, bool xauto_access)
Copies the contents of the buffer xbuf of len xbuf_len into the dof tuple of the member with hub id x...
The poset containing the primitive type definitions.
void put_member_dof_tuple_id(pod_index_type xmbr_hub_id, pod_index_type xtuple_hub_id, bool xauto_access)
Sets the dof tuple hub id of the member with hub id xmbr_hub_id to xtuple_hub_id. ...
Abstract base class with useful features for all objects.
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
virtual bool contains_link(pod_index_type xgreater, pod_index_type xlesser) const
True if there is a cover link between hub id xgreater and hub id xlesser.
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
virtual index_iterator * get_decomposition(pod_index_type xindex) const
An iterator over the members of the decomposition identified by xindex. /.
virtual void merge_jems(pod_index_type xjem1, pod_index_type xjem2)
Merge the join-equivalence class of hub id xjem2 under that of hub id xjem1.
pod_index_type new_term(size_type xct, bool xauto_access)
Creates a new term in the member hub id space with xct number of ids. Returns the index of the id spa...
virtual void initialize_namespace(namespace_poset &xns, const std::string &xposet_name, bool xauto_link=true)
Installs this as a member of xns. If xauto_link, automatically links the member into an appropriate g...
virtual int standard_member_ct() const
The number of standard members automatically allocated by the constructor.
pod_index_type get_int_id(pod_index_type xext_id, const std::string &xid_space_name, bool xauto_access) const
Translates xext_id to an internal id using the equivalence map with name xid_space_name.
void put_is_persistent(bool xvalue)
Sets is_persistent() to xvalue.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
void put_poset_pointer(const poset_state_handle *xposet)
Set the pointer to the poset associated with this namespace member to xposet.
bool is_done() const
True if iteration is finished.
void all_subposet_names(pod_index_type xsubposet_hub_id, block< std::string > &xresult, bool xauto_access=false) const
All the names for the subposet with hub id xsubposet_hub_id.
virtual const scoped_index & clone_row_dof_map(const poset_dof_map &xprototype)
Creates a new row dof map which is a clone of xprototype.
virtual pod_index_type version_index(int xversion) const
The subposet hub id of the whole() subposet for version xversion.
pod_index_type end() const
The end of the member interval.
virtual bool is_valid_int_id(pod_index_type xint_id, const std::string &xid_space_name, bool xauto_access) const
True if xint_id can be translated to an external id using the equivalence map with name xid_space_nam...
subposet & row_dof_subposet()
The row dof subposet when this poset is used as a schema (mutable version).
virtual pod_index_type get_ext_id(pod_index_type xint_id, const std::string &xid_space_name, bool xauto_access) const
Translates xint_id to an external id using the equivalence map with name xid_space_name.
A factory for instanting descendants of an abstract type T, given the class name of the descendant...
bool has_standard_subposet_ct() const
True if poset is in its initial state, that is, it contains just the standard subposets.
virtual void delete_subposet(pod_index_type xsubposet_hub_id)
Deletes the subposet with hub id xsubposet_hub_id.
void update_standard_member_id_spaces()
Update the initially allocated id spaces.
bool is_external() const
True if this has a corresponding member in a name space, but is not yet attached to a state...
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
virtual pod_index_type new_subposet(bool xinitialize=true)
Creates a new subposet. If xinitialize, make the subposet empty,.
bool has_standard_row_dof_tuple_ct() const
True if poset is in its initial state, that is, it contains just the standard row_dof_tuples.
virtual const scoped_index & new_row_dof_map()
Creates a new row dof map.
void remove_cover_member(pod_index_type xother_mbr_hub_id, bool xlower, pod_index_type xmbr_hub_id)
Removes hub id xother_mbr_hub_id from the lower (xlower true) or upper (xlower false) cover set of th...
void * table_dofs()
The table dofs for this instance (mutable version).
bool subposet_has_name(pod_index_type xsubposet_hub_id, const std::string &xname, bool xauto_access=false) const
True if xname is a name for the subposet with hub id xsubposet_hub_id.
virtual scattered_insertion_index_space_handle & new_id_space(const std::string &xstate_class_name)
Creates an id space for the members of this.
poset_path member_path(pod_index_type xmbr_hub_id, bool xauto_access) const
A path for the member with hub id xmbr_hub_id.
An index within the external ("client") scope of a given id space.
virtual bool is_attached() const
True if this handle is attached to a state.
virtual scoped_index subposet_index_ub() const
The upper bound on the subposet index;.
void ensure_lattice_invariant()
Restores the lattice invariant after editing jims.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
virtual void get_read_access() const
Get read access to the state associated with this.
virtual poset_dof_map * copy() const =0
Virtual copy constructor.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
std::string poset_name() const
The poset name part of the path.
virtual const char * class_name() const
The name of this class.
void inc_ref_ct()
Increase the number of references to this map by one;.
bool cover_is_empty(bool xlower, pod_index_type xmbr_hub_id) const
True if and only if the lower (xlower true) or upper (xlower false) cover set of the member with hub ...
size_type row_dof_tuple_ct() const
The number of row_dof_tuples of this poset.
virtual void terminate_access()
Release all access to posets this depends on, then detach and delete the state.
void link_least_jem(pod_index_type xjem1, pod_index_type xjem2)
Makes hub id xjem1 the least jem of hub id xjem2, unless the current least jem of xjem2 is bottom...
virtual bool contains_member(pod_index_type xmbr_hub_id, bool xauto_access=true) const
True if some version of this poset contains poset member with hub id xmbr_hub_id. ...
const bool UPPER
Selector for upper cover.
virtual void finalize(poset_state_handle &xhost)
Finialize the initialization of this crg interval in the host xhost.
virtual const subposet & whole() const
The "improper" subset containing all members of this poset.
virtual std::string member_name(pod_index_type xmbr_hub_id, bool xauto_access=false) const
A name for the member with hub id xmbr_hub_id.
void restore_order(subposet *xlower_bound=0)
Make jrm order consistent with jim order.
void put(const index_space_handle &xid_space, pod_type xpod)
Set the scope to id space, xid_space and pod() to xpod.
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.
bool ub_is_singleton() const
True if the upper bound contains a single member.
bool in_range(const scoped_index &xbegin, const scoped_index &xend) const
True if this is greater than or equal to xbegin and less than xend in the id space of xbegin and xend...
void attach_to_state(const poset_state_handle *xother)
Attach this handle to the same state as xother.
virtual std::string name() const
The name of this poset.
bool empty() const
True if both poset name and member name are empty.
virtual std::string id_space_name() const
The name of the id space associated with this.
void all_member_names(pod_index_type xmbr_hub_id, block< std::string > &xresult, bool xauto_access=false) const
All the names for the member with hub id xmbr_hub_id.
void transfer_cover(pod_index_type xsrc, pod_index_type xdst, bool lower)
Transfers the lower cover (lower == true) or the upper cover (lower == false) from the member with hu...
const index_space_family & subposet_id_spaces(bool xauto_access) const
Collection of subposet id spaces for this (const version).
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
zn_to_bool * members() const
The characteristic function for the members of this.
bool cover_contains_member(bool xlower, pod_index_type xmbr_hub_id, pod_index_type xother_mbr_hub_id) const
True if and only if the lower (xlower true) or upper (xlower false) cover set of the member with hub ...
poset_state_handle()
Default constructor.
bool member_has_name(pod_index_type xmbr_hub_id, const std::string &xname, bool xauto_access=false) const
True if xname is a name for the member with hub id xmbr_hub_id.
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
const hub_index_space_handle & member_hub_id_space(bool xauto_access) const
The member hub id space.
virtual pod_index_type prereq_id(int xi) const
The id of the xi-th prerequisite poset for this.
Iterates over the subset of Zn defined by the characteristic function host().
int dof_ct() const
The number of dofs in this map.
const bool LOWER
Selector for lower cover.
const scattered_insertion_index_space_handle & id_space() const
The id space for the members of with this (const version).
static poset_handle_factory & factory()
The poset handle factory.
virtual void detach_from_state()
Detach this handle from its state, if any.
virtual poset_dof_map & row_dof_map(pod_index_type xtuple_hub_id, bool xrequire_write_access=false) const
The map from row dof client_ids to row dof values for dof tuple hub id xtuple_hub_id.
namespace_poset * name_space() const
The namespace this poset resides in.
virtual bool is_attached() const
True if this is attached to a state.
void to_stream(std::ostream &xos=std::cout)
Write instance information to an ostream (default = stdout).
index_iterator * bound_iterator(const poset_bounds &xbnd_id, bool xis_ub) const
An iterator for the upper bound (xis_ub == true) or the lower bound (xis_ub == false) for xbounds...
bool is_version() const
True if this poset is a version.
int standard_row_dof_tuple_ct() const
The number of standard row_dof_tuples automatically allocated by the constructor. ...
void link_greatest_jem(pod_index_type xjem1, pod_index_type xjem2)
Makes hub id xjem1 the greatest jem of hub id xjem2, unless the current greatest jem of xjem2 is top...
virtual void put_dof_tuple(const void *xbuf, size_t xbuflen)
Copies the entire dof tuple from xbuf into internal storage.
virtual poset_state_handle * host() const
The poset which owns this.
poset_state * _state
State object for this poset.
poset_crg_state & crg() const
The cover relation graph.
virtual bool is_attached() const =0
True if this iterator is attached to a state.
virtual bool is_schematized(bool xauto_access) const
True if this poset has been prepared for use as a schema, that is, if the top member has been schemat...
bool cover_contains_iterator(bool xlower, pod_index_type xmbr_hub_id, const index_space_iterator &xitr) const
True if and only if the lower (xlower true) or upper (xlower false) cover set of the member with hub ...
virtual pod_index_type greatest_jem(pod_index_type xmbr_hub_id) const
The hub id of the largest member which is join-equivalent to hub id xmbr_hub_id.
scoped_index hub_id() const
This mapped to the hub id space.
virtual std::string name() const
The name of this poset.
virtual void put_subposet_name(pod_index_type xsubposet_hub_id, const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for the subposet with hub id xsubposet_hub_id; if xunique, make xname the only name...
virtual poset_state_handle * clone() const
Virtual constructor; creates a new handle of the same actual type as this, attached to the same state...
subposet & table_dof_subposet()
The table dof subposet when this poset is used as a schema (mutable version).
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable version).
int_type pod_index_type
The plain old data index type.
poset_dof_map & member_dof_map(pod_index_type xmbr_hub_id, bool xrequire_write_access=false)
The dof map associated with the member identified by hub id xmbr_hub_id (mutable version).
std::string member_name() const
The member name part of the path.
virtual scoped_index member_index_ub() const
The upper bound on the member_index;.
pod_index_type cover_id_space_id(bool xlower, pod_index_type xmbr_hub_id) const
The id for the lower (xlower true) or upper (xlower false) cover id space of the member with hub id x...
bool is_done() const
True if iteration finished.
void attach_id_space()
Attach the id space to the id_space_name().
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
bool includes_subposets(const block< pod_index_type > &xhub_ids, bool xauto_access=true) const
True if this poset includes subposets with hub ids xhub_ids.
A handle for a scattered_insertion_index_space_state.
virtual bool is_jim(pod_index_type xmbr_hub_id, bool xin_current_version=true) const
True if the member with hub id xmbr_hub_id is a jim in the current version (xin_current_version == tr...
virtual subposet & jims()
The subset of all jims (mutable version)
void push_back(const scoped_index &xhub_id)
Make the next id in this space equivalent to xhub_id in the hub id space. synonym for push_back(xhub_...
virtual pod_index_type new_member_interval(const std::string &xinterval_type, size_type xsize, const block< pod_index_type > &xtuple_hub_ids, const block< pod_index_type > &xdata)
Create a disconnected member interval of type xinterval_type with size xsize, dof tuple ids xtuple_hu...
pod_index_type lb_id() const
The index of the lower bound member, if the lower bound contains a single member. ...
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
bool is_same_state(const poset_state_handle *xother) const
True if this is attached to the same state as xother.
virtual void delete_member(pod_index_type xmbr_hub_id)
Delete the member with hub id xmbr_hub_id. Warning: this routine does not delete links; it will leave...
virtual pod_index_type least_jem(pod_index_type xmbr_hub_id) const
The hub id of the smallest member which is join-equivalent to hub id xmbr_hub_id. ...
void attach_to_state(const namespace_poset *xns, const poset_path &xpath, bool xauto_access=true)
Attach to the state specified by path xpath in the namespace xns.
bool cover_is_equal(bool xlower, pod_index_type xmbr_hub_id, pod_index_type xother_mbr_hub_id) const
True if and only if the lower (xlower true) or upper (xlower false) cover set of the member with hub ...
pod_index_type first_cover_member(bool xlower, pod_index_type xmbr_hub_id) const
Hub id of the first member of the lower (xlower true) or upper (xlower false) cover of the member wit...
bool ub_is_valid_for(const poset_state_handle &xposet) const
True if the upper bound member or subposet mentioned in this descriptor exists in xposet...
virtual bool leqv(pod_index_type xgreater, pod_index_type xlesser) const
True if hub id xlesser is less than or equivalent to hub id xgreater.
A map from schema poset member ids to dof values for namespace_poset members.
virtual void get_read_access() const
Get read access to the state associated with this.
An abstract client handle for a member of a poset.
static poset_state_handle * new_poset_handle(const std::string &xclass_name, poset_type xsheaf_base_class_id)
Creates an unattached handle of type xclass_name, if a prototype of that name exists, otherwise of type xsheaf_base_class_id.
bool lb_is_valid_for(const poset_state_handle &xposet) const
True if the lower bound member or subposet mentioned in this descriptor exists in xposet...
Factory and container for a family of id spaces.
bool bound_contains_member(const poset_bounds &xbounds, bool xis_ub, const scoped_index &xindex) const
True if the upper bound id (xis_ub == true) or the lower bound (xis_ub == false) of xbounds contains ...
virtual pod_index_type subposet_id(const std::string &xname) const
The hub id of the subposet with name xname.
virtual poset_bounds_descriptor descriptor() const
A descriptor for this.
index_iterator member_iterator() const
bool row_conforms_to(const schema_poset_member &xother) const
True if the row dofs defined by this agree in type and in order with the dofs defined by xother...
Traverser to ensure validity of order relation.
bool in_jim_edit_mode() const
True if editing jims and jim order relation is allowed.
void release_cover_id_space(index_space_handle &xcover_id_space) const
Returns xcover_id_space to the pool of id spaces.
bool is_empty() const
True if this poset is empty.
virtual schema_poset_member & schema()
The schema for this member (mutable version).
virtual ~poset_state_handle()
Destructor.
An array representation of abstract class poset_dof_map.
void new_state(namespace_poset &xns, const poset_path &xpath, const schema_poset_member &xschema, array_poset_dof_map &xdof_map)
Creates a new poset state with schema xschema and table dof map xdof_map, attaches this to the state ...
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
virtual void new_state(bool xinitialize=true, bool xauto_access=true)
Creates a new subposet state in host() and attaches this object to it. If xinitialize, initialize the membership to xmembers, If !xinitialize, leave the membership uninitialized.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
bool same_schema(const poset_state_handle *xother) const
True if other has the same schema as this.
virtual void initialize_handle_data_members(const namespace_poset &xns)
Initializes the handle data members that depend on the table dofs and are required to get access when...
void put_private_data(const block< pod_index_type > &xdata)
Initializes this using private data xdata.
The set of subsets of a poset.
void member_dof_tuple(pod_index_type xmbr_hub_id, void *xbuf, size_t xbuf_len, bool xauto_access) const
Copies the dof tuple of the member with hub id xmbr_hub_id into the buffer xbuf of length xbuf_len by...
bool contains_row_dof_tuple(pod_index_type xtuple_hub_id) const
True if this contains a tuple with hub id xtuple_hub_id.
bool is_positive() const
True if this is greater than or equal to ZERO.
static const std::string & VERSION_PREFIX()
The prefix which begins the name of every version subposet.
virtual bool invariant() const
Class invariant.
const hub_index_space_handle & hub_id_space() const
The hub id space of this family.
A client handle for a poset member which has been prepared for use as a schema.
void release_cover_id_space_iterator(index_space_iterator &xcover_itr) const
Returns xcover_itr to the pool of id space iterators.
The data structure representing the table containing the dof tuples of the members of a poset...
virtual int version_ct() const
The number of versions currently defined.
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
poset_powerset_state & powerset() const
The set of subposets of this poset.
const scoped_index & index() const
The index of this in host() dof tuple table.
virtual index_iterator indexed_member_iterator() const
An iterator for members of this poset; index version.
bool schema_is(const std::string &xschema_name) const
True if the schema of this has name xname.
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...
void force(int i, bool value)
Sets the i-th member to value, extends the upper bound if necessary.
virtual bool schema_is_ancestor_of(const schema_poset_member *xother_schema) const
True if xother_schema conforms to the type of schema required by this.
virtual array_poset_dof_map & table_dof_map(bool xrequire_write_access=false)
The map from table dof client_ids to table dof values for this poset (mutable version) ...
virtual const scoped_index & member_id(bool xauto_access) const
An id in the member hub id space; intended for copying to initialize ids to the member id space...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
void copy_cover(bool xlower, pod_index_type xmbr_hub_id, pod_index_type xother_mbr_hub_id)
Copies the lower (xlower true) or upper (xlower false) cover set of the member with hub id xmbr_hub_i...