- + +

To identify which parts of the source text come from which source (the main source text, the Standard Rules, or another extension).

-
+
-

§1. Compilation modules. Inform is a language in which it is semantically relevant which source file the +

§1. Inform is a language in which it is semantically relevant which source file the source text is coming from: unlike, say, C, where #include allows files to include each other in arbitrary ways. In Inform, all source text comes from one of the following places: @@ -78,49 +78,44 @@ following places:

  • (b) An extension file, including the Standard Rules extension;
  • (c) Invented text created by the compiler itself.
  • -

    The Inter hierarchy also splits, with named modules representing each possibility -in (a) or (b) above. This section of code determines to which module any new +

    The Inter hierarchy also splits, with named units representing each possibility +in (a) or (b) above. This section of code determines to which unit any new definition (of, say, a property or kind) belongs.

    -compilation_module *source_text_module = NULL;  the one for the main text
    -compilation_module *SR_module = NULL;  the one for the Standard Rules
    -
    -compilation_module *Modules::SR(void) {
    -    return SR_module;
    -}
    +compilation_unit *source_text_unit = NULL;  the one for the main text
     

    §2. We find these by performing a traverse of the parse tree, and looking for level-0 headings, which are the nodes from which these blocks of source text hang:

    -void Modules::traverse_to_define(void) {
    -    SyntaxTree::traverse(Task::syntax_tree(), Modules::look_for_cu);
    +void CompilationUnits::determine(void) {
    +    SyntaxTree::traverse(Task::syntax_tree(), CompilationUnits::look_for_cu);
     }
     
    -void Modules::look_for_cu(parse_node *p) {
    +void CompilationUnits::look_for_cu(parse_node *p) {
         if (Node::get_type(p) == HEADING_NT) {
             heading *h = Headings::from_node(p);
    -        if ((h) && (h->level == 0)) Modules::new(p);
    +        if ((h) && (h->level == 0)) CompilationUnits::new(p);
         }
     }
     
    -compilation_module *Modules::new(parse_node *from) {
    +compilation_unit *CompilationUnits::new(parse_node *from) {
         source_location sl = Wordings::location(Node::get_text(from));
         if (sl.file_of_origin == NULL) return NULL;
         inform_extension *owner = Extensions::corresponding_to(
             Lexer::file_of_origin(Wordings::first_wn(Node::get_text(from))));
     
    -    compilation_module *C = Packaging::new_cm();
    +    compilation_unit *C = Packaging::new_cu();
         C->hanging_from = from;
    -    Node::set_module(from, C);
    -    Modules::propagate_downwards(from->down, C);
    +    Node::set_unit(from, C);
    +    CompilationUnits::propagate_downwards(from->down, C);
     
         TEMPORARY_TEXT(pname)
    -    Compose a name for the module package this will lead to2.1;
    -    C->inter_presence = Packaging::get_module(Emit::tree(), pname);
    +    Compose a name for the unit package this will lead to2.1;
    +    C->inter_presence = Packaging::get_unit(Emit::tree(), pname);
         DISCARD_TEXT(pname)
     
         if (owner) {
    @@ -133,16 +128,15 @@ level-0 headings, which are the nodes from which these blocks of source text han
             DISCARD_TEXT(V)
         }
     
    -    if (Extensions::is_standard(owner)) SR_module = C;
    -    if (owner == NULL) source_text_module = C;
    +    if (owner == NULL) source_text_unit = C;
         return C;
     }
     

    §2.1. Here we must find a unique name, valid as an Inter identifier: the code -compiled from the compilation module will go into a package of that name. +compiled from the compilation unit will go into a package of that name.

    -

    Compose a name for the module package this will lead to2.1 = +

    Compose a name for the unit package this will lead to2.1 =

    @@ -159,51 +153,51 @@ compiled from the compilation module will go into a package of that name.
     
    • This code is used in §2.

    §3. We are eventually going to need to be able to look at a given node in the parse -tree and say which compilation module it belongs to. If there were a fast way +tree and say which compilation unit it belongs to. If there were a fast way to go up in the tree, that would be easy — we could simply run upward until we reach a level-0 heading. But the node links all run downwards. Instead, we'll -"mark" nodes in the tree, annotating them with the compilation module which owns +"mark" nodes in the tree, annotating them with the compilation unit which owns them. This is done by "propagating downwards", as follows.

    §4.

    -void Modules::propagate_downwards(parse_node *P, compilation_module *C) {
    +void CompilationUnits::propagate_downwards(parse_node *P, compilation_unit *C) {
         while (P) {
    -        Node::set_module(P, C);
    -        Modules::propagate_downwards(P->down, C);
    +        Node::set_unit(P, C);
    +        CompilationUnits::propagate_downwards(P->down, C);
             P = P->next;
         }
     }
     
    -

    §5. As promised, then, given a parse node, we have to return its compilation module: +

    §5. As promised, then, given a parse node, we have to return its compilation unit: but that's now easy, as we just have to read off the annotation made above —

    -compilation_module *Modules::find(parse_node *from) {
    +compilation_unit *CompilationUnits::find(parse_node *from) {
         if (from == NULL) return NULL;
    -    return Node::get_module(from);
    +    return Node::get_unit(from);
     }
     
    -

    §6. Current module. Inform has a concept of the "current module" it's working on, much as it has +

    §6. Current unit. Inform has a concept of the "current unit" it's working on, much as it has a concept of "current sentence".

    -compilation_module *current_CM = NULL;
    +compilation_unit *current_CM = NULL;
     
    -compilation_module *Modules::current(void) {
    +compilation_unit *CompilationUnits::current(void) {
         return current_CM;
     }
     
    -void Modules::set_current_to(compilation_module *CM) {
    +void CompilationUnits::set_current_to(compilation_unit *CM) {
         current_CM = CM;
     }
     
    -void Modules::set_current(parse_node *P) {
    -    if (P) current_CM = Modules::find(P);
    +void CompilationUnits::set_current(parse_node *P) {
    +    if (P) current_CM = CompilationUnits::find(P);
         else current_CM = NULL;
     }
     
    @@ -212,8 +206,8 @@ Packaging code.

    -module_package *Modules::inter_presence(compilation_module *C) {
    -    if (C == NULL) internal_error("no module");
    +module_package *CompilationUnits::inter_presence(compilation_unit *C) {
    +    if (C == NULL) internal_error("no unit");
         return C->inter_presence;
     }
     
    diff --git a/docs/core-module/27-em.html b/docs/core-module/27-em.html index c042b8790..b475bf96d 100644 --- a/docs/core-module/27-em.html +++ b/docs/core-module/27-em.html @@ -78,7 +78,7 @@ function togglePopup(material_id) { inter_tree *I7_generation_tree = NULL; -inter_tree *Emit::tree(void) { +inter_tree *Emit::tree(void) { return I7_generation_tree; } @@ -89,9 +89,9 @@ function togglePopup(material_id) { I7_generation_tree = I; Packaging::incarnate(Site::veneer_request(I)); - Packaging::incarnate(Packaging::get_module(I, I"generic")->the_package); - Packaging::incarnate(Packaging::get_module(I, I"synoptic")->the_package); - Packaging::incarnate(Packaging::get_module(I, I"standard_rules")->the_package); + Packaging::incarnate(Packaging::get_unit(I, I"generic")->the_package); + Packaging::incarnate(Packaging::get_unit(I, I"synoptic")->the_package); + Packaging::incarnate(Packaging::get_unit(I, I"standard_rules")->the_package); Hierarchy::establish(I); diff --git a/docs/core-module/27-hr.html b/docs/core-module/27-hr.html index d8352bfc1..53b30c02a 100644 --- a/docs/core-module/27-hr.html +++ b/docs/core-module/27-hr.html @@ -1730,7 +1730,7 @@ function togglePopup(material_id) { Inter::Connectors::socket(Emit::tree(), ma_as, S); } -package_request *Hierarchy::package(compilation_module *C, int hap_id) { +package_request *Hierarchy::package(compilation_unit *C, int hap_id) { return HierarchyLocations::attach_new_package(Emit::tree(), C, NULL, hap_id); } @@ -1739,7 +1739,7 @@ function togglePopup(material_id) { } package_request *Hierarchy::local_package(int hap_id) { - return HierarchyLocations::attach_new_package(Emit::tree(), Modules::find(current_sentence), NULL, hap_id); + return HierarchyLocations::attach_new_package(Emit::tree(), CompilationUnits::find(current_sentence), NULL, hap_id); } package_request *Hierarchy::package_in_enclosure(int hap_id) { @@ -1762,7 +1762,7 @@ function togglePopup(material_id) { return HierarchyLocations::find_in_package(Emit::tree(), id, P, EMPTY_WORDING, derive_from, -1, NULL); } -inter_name *Hierarchy::make_localised_iname_in(int id, package_request *P, compilation_module *C) { +inter_name *Hierarchy::make_localised_iname_in(int id, package_request *P, compilation_unit *C) { return HierarchyLocations::find_in_package(Emit::tree(), id, P, EMPTY_WORDING, NULL, -1, NULL); } @@ -1780,7 +1780,7 @@ function togglePopup(material_id) { return HierarchyLocations::package_in_package(Emit::tree(), id, P); } -void Hierarchy::markup(package_request *R, int hm_id, text_stream *value) { +void Hierarchy::markup(package_request *R, int hm_id, text_stream *value) { HierarchyLocations::markup(Emit::tree(), R, hm_id, value); } diff --git a/docs/core-module/3-bv.html b/docs/core-module/3-bv.html index eb2907d72..ff392c7ae 100644 --- a/docs/core-module/3-bv.html +++ b/docs/core-module/3-bv.html @@ -87,7 +87,7 @@ means? We break this circularity by hard-wiring it, as follows.

    -void BootVerbs::bootstrap(void) {
    +void BootVerbs::make_built_in(void) {
         verb *to_mean;
         special_meaning_holder *meaning_of_mean;
         Create the special meanings1.3;
    diff --git a/docs/core-module/3-cs.html b/docs/core-module/3-cs.html
    index d1e51d4ac..717c555f8 100644
    --- a/docs/core-module/3-cs.html
    +++ b/docs/core-module/3-cs.html
    @@ -86,7 +86,7 @@ on, placing them in a subtree.
     
     int classification_traverse_done = FALSE;
     
    -void Classifying::traverse(void) {
    +void Classifying::traverse(void) {
         SyntaxTree::traverse(Task::syntax_tree(), Classifying::visit);
         classification_traverse_done = TRUE;
     }
    diff --git a/docs/core-module/4-am.html b/docs/core-module/4-am.html
    index 311e8d792..1f2125278 100644
    --- a/docs/core-module/4-am.html
    +++ b/docs/core-module/4-am.html
    @@ -259,7 +259,7 @@ adjectival phrase in sorted order, so:
     
     void Adjectives::Meanings::initialise(adjective *adj) {
    -    adj->adjective_compilation.aph_package = Hierarchy::package(Modules::current(), ADJECTIVES_HAP);
    +    adj->adjective_compilation.aph_package = Hierarchy::package(CompilationUnits::current(), ADJECTIVES_HAP);
         adj->adjective_compilation.aph_iname = Hierarchy::make_iname_in(ADJECTIVE_HL, adj->adjective_compilation.aph_package);
     }
     
    @@ -1579,7 +1579,7 @@ prefaced "(of a rulebook)", "(of an activity)", and so on.
     

    -void Adjectives::Meanings::agreements(void) {
    +void Adjectives::Meanings::agreements(void) {
         if (Projects::get_language_of_play(Task::project()) == DefaultLanguage::get(NULL)) return;
         adjective *aph;
         LOOP_OVER(aph, adjective) {
    diff --git a/docs/core-module/5-ins.html b/docs/core-module/5-ins.html
    index 7db89be4c..733f9dde1 100644
    --- a/docs/core-module/5-ins.html
    +++ b/docs/core-module/5-ins.html
    @@ -813,7 +813,7 @@ Note that only instances, not kinds, appear.
     

    -void Instances::place_objects_in_definition_sequence(void) {
    +void Instances::place_objects_in_definition_sequence(void) {
         Instances::begin_sequencing_objects();
         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I)
    diff --git a/docs/core-module/5-lp.html b/docs/core-module/5-lp.html
    index 3c990e242..6372ca6b3 100644
    --- a/docs/core-module/5-lp.html
    +++ b/docs/core-module/5-lp.html
    @@ -3383,7 +3383,7 @@ are declared.
     

    -void LiteralPatterns::define_named_phrases(void) {
    +void LiteralPatterns::define_named_phrases(void) {
         literal_pattern_name *lpn;
         LOOP_OVER(lpn, literal_pattern_name)
             lpn->lpn_compiled_already = FALSE;
    @@ -3395,7 +3395,7 @@ are declared.
                         Compile the printing phrase for this and perhaps subsequent LPs40.1;
             }
         }
    -    Sentences::RuleSubtrees::register_recently_lexed_phrases();
    +    RuleSubtrees::register_recently_lexed_phrases();
     }
     

    §40.1. These text substitutions correspond exactly neither to the LPs nor to the @@ -3458,7 +3458,7 @@ the LPs under each named possibility. Kinds::Textual::write(TEMP, K); Define phrases to convert from a packed value to individual parts41.1; Define a phrase to convert from numerical parts to a packed value41.2; - Sentences::RuleSubtrees::register_recently_lexed_phrases(); + RuleSubtrees::register_recently_lexed_phrases(); DISCARD_TEXT(TEMP) }

    diff --git a/docs/core-module/5-nv.html b/docs/core-module/5-nv.html index 145aa8fed..ebc0e33d8 100644 --- a/docs/core-module/5-nv.html +++ b/docs/core-module/5-nv.html @@ -515,7 +515,7 @@ there's very little to say.
     inter_name *NonlocalVariables::iname(nonlocal_variable *nlv) {
         if (nlv->nlv_iname == NULL) {
    -        package_request *R = Hierarchy::package(Modules::find(nlv->nlv_created_at), VARIABLES_HAP);
    +        package_request *R = Hierarchy::package(CompilationUnits::find(nlv->nlv_created_at), VARIABLES_HAP);
             Hierarchy::markup_wording(R, VARIABLE_NAME_HMD, nlv->name);
             nlv->nlv_iname = Hierarchy::make_iname_with_memo(VARIABLE_HL, R, nlv->name);
         }
    diff --git a/docs/core-module/5-un.html b/docs/core-module/5-un.html
    index 65cf97db9..b13b36546 100644
    --- a/docs/core-module/5-un.html
    +++ b/docs/core-module/5-un.html
    @@ -140,7 +140,7 @@ instance, the Standard Rules want the player-character object to be called
     

    -void UseNouns::name_all(void) {
    +void UseNouns::name_all(void) {
         kind *K;
         LOOP_OVER_BASE_KINDS(K)
             Kinds::RunTime::assure_iname_exists(K);
    diff --git a/docs/core-module/6-bp.html b/docs/core-module/6-bp.html
    index 50c48863b..30b26a7d8 100644
    --- a/docs/core-module/6-bp.html
    +++ b/docs/core-module/6-bp.html
    @@ -776,7 +776,7 @@ would always be NULLpackage_request *BinaryPredicates::package(binary_predicate *bp) {
         if (bp == NULL) internal_error("null bp");
         if (bp->bp_package == NULL)
    -        bp->bp_package = Hierarchy::package(Modules::find(bp->bp_created_at), RELATIONS_HAP);
    +        bp->bp_package = Hierarchy::package(CompilationUnits::find(bp->bp_created_at), RELATIONS_HAP);
         return bp->bp_package;
     }
     
    @@ -1139,7 +1139,7 @@ above. This happens very early in compilation.

    §46. Other property-based relations.

    -void BinaryPredicates::make_built_in_further(void) {
    +void BinaryPredicates::make_built_in_further(void) {
         Calculus::Equality::REL_create_second_stock();
         Properties::ProvisionRelation::REL_create_second_stock();
         Relations::Universal::REL_create_second_stock();
    diff --git a/docs/core-module/6-nv.html b/docs/core-module/6-nv.html
    index b889cadbe..74d9fd6dc 100644
    --- a/docs/core-module/6-nv.html
    +++ b/docs/core-module/6-nv.html
    @@ -112,7 +112,7 @@ implementation of it. But in practice they should never be reached.
         if (V == NULL) internal_error("no verb identity");
         if (V->verb_compilation.verb_package == NULL)
             V->verb_compilation.verb_package =
    -            Hierarchy::package(Modules::find(where), VERBS_HAP);
    +            Hierarchy::package(CompilationUnits::find(where), VERBS_HAP);
         return V->verb_compilation.verb_package;
     }
     
    @@ -827,7 +827,7 @@ foreign verbs (4).
         Hierarchy::make_available(Emit::tree(), CV_MEANING_iname);
     }
     
    -void NewVerbs::ConjugateVerb(void) {
    +void NewVerbs::ConjugateVerb(void) {
         verb_conjugation *vc;
         LOOP_OVER(vc, verb_conjugation)
             Compile ConjugateVerb routine17.1;
    diff --git a/docs/core-module/6-rlt.html b/docs/core-module/6-rlt.html
    index c0680829c..c92c1b715 100644
    --- a/docs/core-module/6-rlt.html
    +++ b/docs/core-module/6-rlt.html
    @@ -1068,7 +1068,7 @@ combinations.
         return iname;
     }
     
    -void Relations::compile_defined_relation_constants(void) {
    +void Relations::compile_defined_relation_constants(void) {
         RELS_SYMMETRIC_iname = Relations::compile_defined_relation_constant(RELS_SYMMETRIC_HL, 0x8000);
         RELS_EQUIVALENCE_iname = Relations::compile_defined_relation_constant(RELS_EQUIVALENCE_HL, 0x4000);
         RELS_X_UNIQUE_iname = Relations::compile_defined_relation_constant(RELS_X_UNIQUE_HL, 0x2000);
    @@ -2056,7 +2056,7 @@ between numbers and texts.
     

    §17. Support for the RELATIONS command.

    -void Relations::IterateRelations(void) {
    +void Relations::IterateRelations(void) {
         inter_name *iname = Hierarchy::find(ITERATERELATIONS_HL);
         packaging_state save = Routines::begin(iname);
         inter_symbol *callback_s = LocalVariables::add_named_call_as_symbol(I"callback");
    @@ -2678,7 +2678,7 @@ whether or not $R(t_0<
     

    -void Relations::compile_defined_relations(void) {
    +void Relations::compile_defined_relations(void) {
         Relations::compile_relation_records();
         binary_predicate *bp;
         LOOP_OVER(bp, binary_predicate)
    diff --git a/docs/core-module/7-hdn.html b/docs/core-module/7-hdn.html
    index 533ffc0bb..d11e6c46c 100644
    --- a/docs/core-module/7-hdn.html
    +++ b/docs/core-module/7-hdn.html
    @@ -257,7 +257,7 @@ and has no "level" or "indentation" as such.
     

    -void Sentences::Headings::make_the_tree(void) {
    +void Sentences::Headings::make_the_tree(void) {
         Headings::assemble_tree(Task::syntax_tree());
     }
     
    @@ -674,7 +674,7 @@ Version", contains the Inform build number in its usual form: "4Q34", for instan
     

    -void Sentences::Headings::write_as_xml(void) {
    +void Sentences::Headings::write_as_xml(void) {
         text_stream xf_struct; text_stream *xf = &xf_struct;
         filename *F = Task::xml_headings_file();
         if (STREAM_OPEN_TO_FILE(xf, F, UTF8_ENC) == FALSE)
    diff --git a/docs/core-module/7-ptu.html b/docs/core-module/7-ptu.html
    index b5c0edfee..9b7f871ac 100644
    --- a/docs/core-module/7-ptu.html
    +++ b/docs/core-module/7-ptu.html
    @@ -245,7 +245,7 @@ also makes it easier for us to manipulate the results.
         Annotations::allow(HEADING_NT, interpretation_of_subject_ANNOT);
         Annotations::allow(HEADING_NT, suppress_heading_dependencies_ANNOT);
         Annotations::allow(HEADING_NT, implied_heading_ANNOT);
    -    Annotations::allow_for_category(L1_NCAT, module_ANNOT);
    +    Annotations::allow_for_category(L1_NCAT, unit_ANNOT);
     
         Annotations::allow_for_category(L2_NCAT, clears_pronouns_ANNOT);
         Annotations::allow_for_category(L2_NCAT, interpretation_of_subject_ANNOT);
    @@ -254,12 +254,12 @@ also makes it easier for us to manipulate the results.
         Annotations::allow(SENTENCE_NT, implicit_in_creation_of_ANNOT);
         Annotations::allow(SENTENCE_NT, implicitness_count_ANNOT);
         Annotations::allow(SENTENCE_NT, you_can_ignore_ANNOT);
    -    Annotations::allow_for_category(L2_NCAT, module_ANNOT);
    +    Annotations::allow_for_category(L2_NCAT, unit_ANNOT);
         LOOP_OVER_ENUMERATED_NTS(t)
             if (NodeType::has_flag(t, ASSERT_NFLAG))
                 Annotations::allow(t, resolved_ANNOT);
     
    -    Annotations::allow_for_category(L3_NCAT, module_ANNOT);
    +    Annotations::allow_for_category(L3_NCAT, unit_ANNOT);
         Annotations::allow_for_category(L3_NCAT, creation_proposition_ANNOT);
         Annotations::allow_for_category(L3_NCAT, evaluation_ANNOT);
         Annotations::allow_for_category(L3_NCAT, subject_ANNOT);
    @@ -309,7 +309,7 @@ also makes it easier for us to manipulate the results.
         Annotations::allow_for_category(L4_NCAT, token_to_be_parsed_against_ANNOT);
         Annotations::allow_for_category(L4_NCAT, verb_problem_issued_ANNOT);
         Annotations::allow_for_category(L4_NCAT, problem_falls_under_ANNOT);
    -    Annotations::allow_for_category(L4_NCAT, module_ANNOT);
    +    Annotations::allow_for_category(L4_NCAT, unit_ANNOT);
         Annotations::allow(INVOCATION_LIST_NT, from_text_substitution_ANNOT);
         Annotations::allow(INVOCATION_LIST_SAY_NT, suppress_newlines_ANNOT);
         Annotations::allow(INVOCATION_NT, epistemological_status_ANNOT);
    @@ -553,7 +553,7 @@ be such that their head nodes each pass this test:
     

    §15.

    -void ParseTreeUsage::verify(void) {
    +void ParseTreeUsage::verify(void) {
         VerifyTree::verify_integrity(Task::syntax_tree());
         VerifyTree::verify_structure(Task::syntax_tree());
     }
    diff --git a/docs/core-module/7-rs.html b/docs/core-module/7-rs.html
    index 49a355dbd..cb48009fe 100644
    --- a/docs/core-module/7-rs.html
    +++ b/docs/core-module/7-rs.html
    @@ -103,17 +103,17 @@ on childless nodes, it cannot ever act on the same node twice.
     

    -void Sentences::RuleSubtrees::register_recently_lexed_phrases(void) {
    +void RuleSubtrees::register_recently_lexed_phrases(void) {
         if (problem_count > 0) return;  for then the tree is perhaps broken anyway
    -    SyntaxTree::traverse(Task::syntax_tree(), Sentences::RuleSubtrees::demote_command_nodes);
    -    SyntaxTree::traverse(Task::syntax_tree(), Sentences::RuleSubtrees::detect_loose_command_nodes);
    +    SyntaxTree::traverse(Task::syntax_tree(), RuleSubtrees::demote_command_nodes);
    +    SyntaxTree::traverse(Task::syntax_tree(), RuleSubtrees::detect_loose_command_nodes);
     }
     

    §4. Command nodes are demoted to be children of routine nodes:

    -void Sentences::RuleSubtrees::demote_command_nodes(parse_node *p) {
    +void RuleSubtrees::demote_command_nodes(parse_node *p) {
         if ((Node::get_type(p) == RULE_NT) && (p->down == NULL)) {
             parse_node *end_def = p;
             while ((end_def->next) && (Node::get_type(end_def->next) == INVOCATION_LIST_NT))
    @@ -123,7 +123,7 @@ on childless nodes, it cannot ever act on the same node twice.
             p->down = p->next;
             p->next = end_def->next;
             end_def->next = NULL;
    -        Sentences::RuleSubtrees::parse_routine_structure(p);
    +        RuleSubtrees::parse_routine_structure(p);
         }
     }
     
    @@ -131,7 +131,7 @@ on childless nodes, it cannot ever act on the same node twice.

    -void Sentences::RuleSubtrees::detect_loose_command_nodes(parse_node *p) {
    +void RuleSubtrees::detect_loose_command_nodes(parse_node *p) {
         if (Node::get_type(p) == INVOCATION_LIST_NT)
             internal_error("loose COMMAND node outside of rule definition");
     }
    @@ -156,7 +156,7 @@ indentation difficult to manage with screen-readers.
     

    -void Sentences::RuleSubtrees::parse_routine_structure(parse_node *routine_node) {
    +void RuleSubtrees::parse_routine_structure(parse_node *routine_node) {
         int initial_problem_count = problem_count;
     
         parse_node *uses_colon_syntax = NULL;
    @@ -410,7 +410,7 @@ to break this up.
         Deal with an immediately following otherwise node, if there is one6.5.1.1;
     
         if (uses_colon_syntax == FALSE) {
    -        last_node_of_if_construction->next = Sentences::RuleSubtrees::end_node(p);
    +        last_node_of_if_construction->next = RuleSubtrees::end_node(p);
             last_node_of_if_construction->next->next = rest_of_routine;
         } else {
             last_node_of_if_construction->next = rest_of_routine;
    @@ -711,7 +711,7 @@ indentation implicitly requires it.
     

    -    parse_node *implicit_end = Sentences::RuleSubtrees::end_node(opening);
    +    parse_node *implicit_end = RuleSubtrees::end_node(opening);
         implicit_end->next = prev->next; prev->next = implicit_end;
         prev = implicit_end;
     
    @@ -1030,7 +1030,7 @@ where we look for such mistakes.
         int n = problem_count;
    -    Sentences::RuleSubtrees::police_code_block(routine_node->down, NULL);
    +    RuleSubtrees::police_code_block(routine_node->down, NULL);
         if (problem_count > n) LOG("Local parse tree: $T\n", routine_node);
     
    • This code is used in §6.
    @@ -1038,7 +1038,7 @@ where we look for such mistakes.

    -void Sentences::RuleSubtrees::police_code_block(parse_node *block, control_structure_phrase *context) {
    +void RuleSubtrees::police_code_block(parse_node *block, control_structure_phrase *context) {
         for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) {
             current_sentence = p;
     
    @@ -1068,7 +1068,7 @@ where we look for such mistakes.
                 }
             }
     
    -        if (p->down) Sentences::RuleSubtrees::police_code_block(p, csp);
    +        if (p->down) RuleSubtrees::police_code_block(p, csp);
         }
     }
     
    @@ -1214,7 +1214,7 @@ can now become "otherwise: if whatever: ...".
         int n = problem_count;
    -    Sentences::RuleSubtrees::purge_otherwise_if(routine_node->down);
    +    RuleSubtrees::purge_otherwise_if(routine_node->down);
         if (problem_count > n) LOG("Local parse tree: $T\n", routine_node);
     
    • This code is used in §6.
    @@ -1225,7 +1225,7 @@ to issue good problem messages for failures to use "otherwise if" correctly.

    -void Sentences::RuleSubtrees::purge_otherwise_if(parse_node *block) {
    +void RuleSubtrees::purge_otherwise_if(parse_node *block) {
         for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) {
             if (Node::get_control_structure_used(p) == otherwise_if_CSP) {
                 parse_node *former_contents = p->down;
    @@ -1252,7 +1252,7 @@ to issue good problem messages for failures to use "otherwise if" correctly.
                  any further "otherwise if" or "otherwise" nodes after p follow
                 p->down->next = former_successors;
             }
    -        if (p->down) Sentences::RuleSubtrees::purge_otherwise_if(p);
    +        if (p->down) RuleSubtrees::purge_otherwise_if(p);
         }
     }
     
    @@ -1266,18 +1266,18 @@ We remove them.

    -    Sentences::RuleSubtrees::purge_end_markers(routine_node->down);
    +    RuleSubtrees::purge_end_markers(routine_node->down);
     
    • This code is used in §6.

    §6.12.

    -void Sentences::RuleSubtrees::purge_end_markers(parse_node *block) {
    +void RuleSubtrees::purge_end_markers(parse_node *block) {
         for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) {
             if (Node::get_end_control_structure_used(p)) {
                 if (prev_p) prev_p->next = p->next; else block->down = p->next;
             }
    -        if (p->down) Sentences::RuleSubtrees::purge_end_markers(p);
    +        if (p->down) RuleSubtrees::purge_end_markers(p);
         }
     }
     
    @@ -1289,18 +1289,18 @@ can now be removed, too.

    -    Sentences::RuleSubtrees::purge_begin_markers(routine_node->down);
    +    RuleSubtrees::purge_begin_markers(routine_node->down);
     
    • This code is used in §6.

    §6.14.

    -void Sentences::RuleSubtrees::purge_begin_markers(parse_node *block) {
    +void RuleSubtrees::purge_begin_markers(parse_node *block) {
         for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) {
             if (Node::get_control_structure_used(p))
                 if (<phrase-beginning-block>(Node::get_text(p)))
                     Node::set_text(p, GET_RW(<phrase-beginning-block>, 1));
    -        if (p->down) Sentences::RuleSubtrees::purge_begin_markers(p);
    +        if (p->down) RuleSubtrees::purge_begin_markers(p);
         }
     }
     
    @@ -1316,13 +1316,13 @@ annotations to them.

    -    Sentences::RuleSubtrees::insert_cb_nodes(routine_node->down);
    +    RuleSubtrees::insert_cb_nodes(routine_node->down);
     
    • This code is used in §6.

    §6.16.

    -void Sentences::RuleSubtrees::insert_cb_nodes(parse_node *block) {
    +void RuleSubtrees::insert_cb_nodes(parse_node *block) {
         for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) {
             if (ControlStructures::opens_block(Node::get_control_structure_used(p))) {
                 parse_node *blank_cb_node = Node::new(CODE_BLOCK_NT);
    @@ -1336,7 +1336,7 @@ annotations to them.
                 if (prev_p) prev_p->next = blank_cb_node; else block->down = blank_cb_node;
                 p = blank_cb_node;
             }
    -        if (p->down) Sentences::RuleSubtrees::insert_cb_nodes(p);
    +        if (p->down) RuleSubtrees::insert_cb_nodes(p);
         }
     }
     
    @@ -1347,13 +1347,13 @@ annotations to them.

    -    Sentences::RuleSubtrees::read_instead_markers(routine_node->down);
    +    RuleSubtrees::read_instead_markers(routine_node->down);
     
    • This code is used in §6.

    §6.18.

    -void Sentences::RuleSubtrees::read_instead_markers(parse_node *block) {
    +void RuleSubtrees::read_instead_markers(parse_node *block) {
         for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) {
             if (<instead-keyword>(Node::get_text(p))) {
                 Node::set_text(p, GET_RW(<instead-keyword>, 1));
    @@ -1362,7 +1362,7 @@ annotations to them.
                 instead_node->next = p->next;
                 p->next = instead_node;
             }
    -        if (p->down) Sentences::RuleSubtrees::read_instead_markers(p);
    +        if (p->down) RuleSubtrees::read_instead_markers(p);
         }
     }
     
    @@ -1373,13 +1373,13 @@ annotations to them.

    -    Sentences::RuleSubtrees::break_up_says(routine_node->down);
    +    RuleSubtrees::break_up_says(routine_node->down);
     
    • This code is used in §6.

    §8.

    -void Sentences::RuleSubtrees::break_up_says(parse_node *block) {
    +void RuleSubtrees::break_up_says(parse_node *block) {
         for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) {
             int sf = NO_SIGF;
             wording W = Node::get_text(p);
    @@ -1397,7 +1397,7 @@ annotations to them.
                     if (prev_p) prev_p->next = blank_cb_node; else block->down = blank_cb_node;
     
                     current_sentence = p;
    -                Sentences::RuleSubtrees::unroll_says(blank_cb_node, W, 0);
    +                RuleSubtrees::unroll_says(blank_cb_node, W, 0);
                     p = blank_cb_node;
                     break;
                 }
    @@ -1409,11 +1409,11 @@ annotations to them.
                     break;
                 }
             }
    -        if (p->down) Sentences::RuleSubtrees::break_up_says(p);
    +        if (p->down) RuleSubtrees::break_up_says(p);
         }
     }
     
    -void Sentences::RuleSubtrees::unroll_says(parse_node *cb_node, wording W, int depth) {
    +void RuleSubtrees::unroll_says(parse_node *cb_node, wording W, int depth) {
         while (<phrase-with-comma-notation>(W)) {
             wording AW = GET_RW(<phrase-with-comma-notation>, 1);
             wording BW = GET_RW(<phrase-with-comma-notation>, 2);
    @@ -1434,7 +1434,7 @@ annotations to them.
                 Check that substitution does not contain suspicious punctuation8.1.1;
                 wording A = Feeds::feed_C_string_expanding_strings(p);
                 if (<verify-expanded-text-substitution>(A))
    -                Sentences::RuleSubtrees::unroll_says(cb_node, A, depth+1);
    +                RuleSubtrees::unroll_says(cb_node, A, depth+1);
             } else {
                 parse_node *say_term_node = Node::new(INVOCATION_LIST_SAY_NT);
                 Node::set_text(say_term_node, W);
    @@ -1602,7 +1602,7 @@ match a given begin node.
     

    -parse_node *Sentences::RuleSubtrees::end_node(parse_node *opening) {
    +parse_node *RuleSubtrees::end_node(parse_node *opening) {
         parse_node *implicit_end = Node::new(INVOCATION_LIST_NT);
         Node::set_end_control_structure_used(implicit_end,
             Node::get_control_structure_used(opening));
    diff --git a/docs/core-module/8-ef.html b/docs/core-module/8-ef.html
    index c9a1358d3..85cd7016d 100644
    --- a/docs/core-module/8-ef.html
    +++ b/docs/core-module/8-ef.html
    @@ -228,7 +228,7 @@ feelings of modesty.
     

    -void Extensions::Files::ShowExtensionVersions_routine(void) {
    +void Extensions::Files::ShowExtensionVersions_routine(void) {
         inter_name *iname = Hierarchy::find(SHOWEXTENSIONVERSIONS_HL);
         packaging_state save = Routines::begin(iname);
         inform_extension *E;
    diff --git a/docs/core-module/9-tfa.html b/docs/core-module/9-tfa.html
    index 88da70272..ef0682048 100644
    --- a/docs/core-module/9-tfa.html
    +++ b/docs/core-module/9-tfa.html
    @@ -176,10 +176,10 @@ we don't bother to print details of the closing int sentence_handlers_initialised = FALSE;
     parse_node *assembly_position = NULL;  where assembled sentences are added
     
    -void Assertions::Traverse::traverse1(void) {
    +void Assertions::Traverse::traverse1(void) {
         Assertions::Traverse::traverse(1);
     }
    -void Assertions::Traverse::traverse2(void) {
    +void Assertions::Traverse::traverse2(void) {
         Assertions::Traverse::traverse(2);
     }
     void Assertions::Traverse::traverse(int pass) {
    @@ -240,12 +240,12 @@ artificially to run through those sentences.
     
     void Assertions::Traverse::visit(parse_node *p, parse_node **last) {
         assembly_position = current_sentence;
    -    compilation_module *cm = Modules::current();
    -    Modules::set_current(p);
    +    compilation_unit *cm = CompilationUnits::current();
    +    CompilationUnits::set_current(p);
         Take a sceptical look at WITH nodes in the light of subsequent knowledge7.2.1;
         *last = p;
         Deal with an individual sentence7.2.2;
    -    Modules::set_current_to(cm);
    +    CompilationUnits::set_current_to(cm);
     }
     

    §7.3. If this hasn't already been done: diff --git a/docs/core-module/index.html b/docs/core-module/index.html index 74fc0ecb3..5ec5277d6 100644 --- a/docs/core-module/index.html +++ b/docs/core-module/index.html @@ -1041,7 +1041,7 @@

  • - Compilation Modules - + Compilation Units - To identify which parts of the source text come from which source (the main source text, the Standard Rules, or another extension).

  • diff --git a/docs/if-module/3-bck.html b/docs/if-module/3-bck.html index 90c8a9456..f4a5c61d7 100644 --- a/docs/if-module/3-bck.html +++ b/docs/if-module/3-bck.html @@ -157,7 +157,7 @@ Standard Rules. (So there is no need to translate this to other languages.) return FALSE; } -int PL::Backdrops::object_is_scenery(instance *I) { +int PL::Backdrops::object_is_scenery(instance *I) { if (World::Inferences::get_EO_state(Instances::as_subject(I), P_scenery) > 0) return TRUE; return FALSE; @@ -235,7 +235,7 @@ is NULL.

    -void PL::Backdrops::index_object_further(OUTPUT_STREAM, instance *loc, int depth,
    +void PL::Backdrops::index_object_further(OUTPUT_STREAM, instance *loc, int depth,
         int details, int how) {
         int discoveries = 0;
         instance *bd;
    diff --git a/docs/if-module/3-em.html b/docs/if-module/3-em.html
    index 2d05d14b1..b5a6c36a8 100644
    --- a/docs/if-module/3-em.html
    +++ b/docs/if-module/3-em.html
    @@ -284,7 +284,7 @@ If all are null, then the global scope is used.
     void PL::EPSMap::put_mp(wchar_t *name, map_parameter_scope *scope, instance *scope_I,
         kind *scope_k, wchar_t *put_string, int put_integer) {
         if (scope_I) {
    -        if (PL::Spatial::object_is_a_room(scope_I))
    +        if (PL::Spatial::object_is_a_room(scope_I))
                 scope = PL::EPSMap::scope_for_single_room(scope_I);
             else if (PL::Regions::object_is_a_region(scope_I)) {
                 instance *rm;
    @@ -712,12 +712,12 @@ the following:
         instance *I2 = <<instance:y>>;
         int exit = PF_I(map, <<instance:dir>>)->direction_index;
     
    -    if ((I == NULL) || (PL::Spatial::object_is_a_room(I) == FALSE)) {
    +    if ((I == NULL) || (PL::Spatial::object_is_a_room(I) == FALSE)) {
             if (pass == 1) StandardProblems::map_problem(_p_(PM_MapFromNonRoom),
                 p, "The first-named thing must be a room (beware ambiguities!).");
             return;
         }
    -    if ((I2 == NULL) || (PL::Spatial::object_is_a_room(I2) == FALSE)) {
    +    if ((I2 == NULL) || (PL::Spatial::object_is_a_room(I2) == FALSE)) {
             if (pass == 1) StandardProblems::map_problem(_p_(PM_MapToNonRoom),
                 p, "The second-named thing must be a room (beware ambiguities!).");
             return;
    @@ -862,7 +862,7 @@ the following:
                 } else bad_scope = TRUE;
                 break;
             case INSTANCE_MAP_SCOPE:
    -            if ((PL::Spatial::object_is_a_room(<<instance:iscope>>)) ||
    +            if ((PL::Spatial::object_is_a_room(<<instance:iscope>>)) ||
                     (PL::Regions::object_is_a_region(<<instance:iscope>>)))
                     scope_I = <<instance:iscope>>;
                 if (scope_I) {
    @@ -1220,7 +1220,7 @@ rectangle around the whole thing...
         LOOP_OVER_STORY_DIRECTIONS(dir) {
             instance *T = PL::SpatialMap::room_exit(R, dir, NULL);
             int exit = story_dir_to_page_dir[dir];
    -        if (PL::Spatial::object_is_a_room(T))
    +        if (PL::Spatial::object_is_a_room(T))
                 Draw a single map connection as an EPS arrow26.6.1;
         }
         PL::EPSMap::EPS_compile_line_width_unsetting(OUT);
    diff --git a/docs/if-module/3-rgn.html b/docs/if-module/3-rgn.html
    index aa6ae05e8..c4304a768 100644
    --- a/docs/if-module/3-rgn.html
    +++ b/docs/if-module/3-rgn.html
    @@ -106,6 +106,7 @@ following minimal structure, though it will only be relevant for instances of
     
     
     void PL::Regions::start(void) {
    +    PLUGIN_REGISTER(PLUGIN_CREATE_INFERENCES, PL::Regions::create_inference_subjects);
         PLUGIN_REGISTER(PLUGIN_NEW_BASE_KIND_NOTIFY, PL::Regions::regions_new_base_kind_notify);
         PLUGIN_REGISTER(PLUGIN_SET_SUBKIND_NOTIFY, PL::Regions::regions_set_subkind_notify);
         PLUGIN_REGISTER(PLUGIN_NEW_SUBJECT_NOTIFY, PL::Regions::regions_new_subject_notify);
    @@ -116,6 +117,9 @@ following minimal structure, though it will only be relevant for instances of
         PLUGIN_REGISTER(PLUGIN_INTERVENE_IN_ASSERTION, PL::Regions::regions_intervene_in_assertion);
         PLUGIN_REGISTER(PLUGIN_NAME_TO_EARLY_INFS, PL::Regions::regions_name_to_early_infs);
         PLUGIN_REGISTER(PLUGIN_ADD_TO_WORLD_INDEX, PL::Regions::regions_add_to_World_index);
    +}
    +
    +void PL::Regions::create_inference_subjects(void) {
         infs_region = InferenceSubjects::new(global_constants,
             FUND_SUB, NULL_GENERAL_POINTER, LIKELY_CE);
     }
    @@ -179,7 +183,7 @@ there is no need to translate this to other languages.)
     

    §9.

    -int PL::Regions::object_is_a_region(instance *I) {
    +int PL::Regions::object_is_a_region(instance *I) {
         if ((Plugins::Manage::plugged_in(regions_plugin)) && (K_region) && (I) &&
             (Instances::of_kind(I, K_region))) return TRUE;
         return FALSE;
    @@ -200,8 +204,8 @@ domains.)
         if ((r1) && (reg2)) return 1;
         if ((reg1) && (r2)) return -1;
         if ((reg1) && (reg2)) {
    -        if (PL::Spatial::encloses(I1, I2)) return 1;
    -        if (PL::Spatial::encloses(I2, I1)) return -1;
    +        if (PL::Spatial::encloses(I1, I2)) return 1;
    +        if (PL::Spatial::encloses(I2, I1)) return -1;
         }
         return 0;
     }
    @@ -387,8 +391,8 @@ region is either the next broadest region containing it, or else 
     instance *PL::Regions::enclosing(instance *reg) {
         instance *P = NULL;
    -    if (PL::Spatial::object_is_a_room(reg)) P = PF_I(regions, reg)->in_region;
    -    if (PL::Regions::object_is_a_region(reg)) P = PL::Spatial::progenitor(reg);
    +    if (PL::Spatial::object_is_a_room(reg)) P = PF_I(regions, reg)->in_region;
    +    if (PL::Regions::object_is_a_region(reg)) P = PL::Spatial::progenitor(reg);
         if (PL::Regions::object_is_a_region(P) == FALSE) return NULL;
         return P;
     }
    diff --git a/docs/if-module/3-scn.html b/docs/if-module/3-scn.html
    index 4e35448eb..121f30874 100644
    --- a/docs/if-module/3-scn.html
    +++ b/docs/if-module/3-scn.html
    @@ -391,7 +391,7 @@ ends merrily" and "when the Banquet Entertainment ends merrily".
             sc->allocation_id, end);
         Feeds::feed_text_expanding_strings(i6_code);
         Sentences::make_node(Task::syntax_tree(), Feeds::end(id), '.');
    -    Sentences::RuleSubtrees::register_recently_lexed_phrases();
    +    RuleSubtrees::register_recently_lexed_phrases();
         DISCARD_TEXT(i6_code)
     
    • This code is used in §15.
    diff --git a/docs/if-module/3-sm.html b/docs/if-module/3-sm.html index 013c8bb6c..848047bc6 100644 --- a/docs/if-module/3-sm.html +++ b/docs/if-module/3-sm.html @@ -67,7 +67,7 @@ function togglePopup(material_id) {

    A plugin which constructs the fundamental spatial model used by IF, to represent containment, support, carrying, wearing, and incorporation.

    -
    +

    §1. Definitions.

    @@ -168,25 +168,25 @@ timing issue to get around (see below).
     void PL::Spatial::start(void) {
    -    PLUGIN_REGISTER(PLUGIN_NEW_BASE_KIND_NOTIFY, PL::Spatial::spatial_new_base_kind_notify);
    -    PLUGIN_REGISTER(PLUGIN_ACT_ON_SPECIAL_NPS, PL::Spatial::spatial_act_on_special_NPs);
    -    PLUGIN_REGISTER(PLUGIN_COMPLETE_MODEL, PL::Spatial::IF_complete_model);
    -    PLUGIN_REGISTER(PLUGIN_DEFAULT_APPEARANCE, PL::Spatial::spatial_default_appearance);
    -    PLUGIN_REGISTER(PLUGIN_INFERENCES_CONTRADICT, PL::Spatial::spatial_inferences_contradict);
    -    PLUGIN_REGISTER(PLUGIN_EXPLAIN_CONTRADICTION, PL::Spatial::spatial_explain_contradiction);
    -    PLUGIN_REGISTER(PLUGIN_LOG_INFERENCE_TYPE, PL::Spatial::spatial_log_inference_type);
    -    PLUGIN_REGISTER(PLUGIN_NAME_TO_EARLY_INFS, PL::Spatial::spatial_name_to_early_infs);
    -    PLUGIN_REGISTER(PLUGIN_NEW_SUBJECT_NOTIFY, PL::Spatial::spatial_new_subject_notify);
    -    PLUGIN_REGISTER(PLUGIN_NEW_PROPERTY_NOTIFY, PL::Spatial::spatial_new_property_notify);
    -    PLUGIN_REGISTER(PLUGIN_PARSE_COMPOSITE_NQS, PL::Spatial::spatial_parse_composite_NQs);
    -    PLUGIN_REGISTER(PLUGIN_SET_KIND_NOTIFY, PL::Spatial::spatial_set_kind_notify);
    -    PLUGIN_REGISTER(PLUGIN_SET_SUBKIND_NOTIFY, PL::Spatial::spatial_set_subkind_notify);
    -    PLUGIN_REGISTER(PLUGIN_ADD_TO_WORLD_INDEX, PL::Spatial::spatial_add_to_World_index);
    -    PLUGIN_REGISTER(PLUGIN_INTERVENE_IN_ASSERTION, PL::Spatial::spatial_intervene_in_assertion);
    -    Create early inference subjects7.1;
    +    PLUGIN_REGISTER(PLUGIN_CREATE_INFERENCES, PL::Spatial::create_inference_subjects);
    +    PLUGIN_REGISTER(PLUGIN_NEW_BASE_KIND_NOTIFY, PL::Spatial::spatial_new_base_kind_notify);
    +    PLUGIN_REGISTER(PLUGIN_ACT_ON_SPECIAL_NPS, PL::Spatial::spatial_act_on_special_NPs);
    +    PLUGIN_REGISTER(PLUGIN_COMPLETE_MODEL, PL::Spatial::IF_complete_model);
    +    PLUGIN_REGISTER(PLUGIN_DEFAULT_APPEARANCE, PL::Spatial::spatial_default_appearance);
    +    PLUGIN_REGISTER(PLUGIN_INFERENCES_CONTRADICT, PL::Spatial::spatial_inferences_contradict);
    +    PLUGIN_REGISTER(PLUGIN_EXPLAIN_CONTRADICTION, PL::Spatial::spatial_explain_contradiction);
    +    PLUGIN_REGISTER(PLUGIN_LOG_INFERENCE_TYPE, PL::Spatial::spatial_log_inference_type);
    +    PLUGIN_REGISTER(PLUGIN_NAME_TO_EARLY_INFS, PL::Spatial::spatial_name_to_early_infs);
    +    PLUGIN_REGISTER(PLUGIN_NEW_SUBJECT_NOTIFY, PL::Spatial::spatial_new_subject_notify);
    +    PLUGIN_REGISTER(PLUGIN_NEW_PROPERTY_NOTIFY, PL::Spatial::spatial_new_property_notify);
    +    PLUGIN_REGISTER(PLUGIN_PARSE_COMPOSITE_NQS, PL::Spatial::spatial_parse_composite_NQs);
    +    PLUGIN_REGISTER(PLUGIN_SET_KIND_NOTIFY, PL::Spatial::spatial_set_kind_notify);
    +    PLUGIN_REGISTER(PLUGIN_SET_SUBKIND_NOTIFY, PL::Spatial::spatial_set_subkind_notify);
    +    PLUGIN_REGISTER(PLUGIN_ADD_TO_WORLD_INDEX, PL::Spatial::spatial_add_to_World_index);
    +    PLUGIN_REGISTER(PLUGIN_INTERVENE_IN_ASSERTION, PL::Spatial::spatial_intervene_in_assertion);
     }
     
    -

    §7.1. In talking about some of the fundamental spatial domains we potentially have +

    §8. In talking about some of the fundamental spatial domains we potentially have a vicious circle, because

    @@ -207,10 +207,8 @@ we will make them correspond to the actual kinds later on, at some point after stage (d) when they exist.

    -

    Create early inference subjects7.1 = -

    -
    +void PL::Spatial::create_inference_subjects(void) {
         infs_room = InferenceSubjects::new(global_constants,
             FUND_SUB, NULL_GENERAL_POINTER, LIKELY_CE);
         infs_thing = InferenceSubjects::new(global_constants,
    @@ -219,9 +217,9 @@ after stage (d) when they exist.
             FUND_SUB, NULL_GENERAL_POINTER, LIKELY_CE);
         infs_person = InferenceSubjects::new(global_constants,
             FUND_SUB, NULL_GENERAL_POINTER, LIKELY_CE);
    +}
     
    -
    • This code is used in §7.
    -

    §8. And this is where those IOUs are redeemed. What happens is that, ordinarily, +

    §9. And this is where those IOUs are redeemed. What happens is that, ordinarily, the machinery creating objects (and kinds) will allocate a new inference structure for each object, but it first invites plugins to choose an existing one instead. (The INFS structure is rewritten, but the important thing is that @@ -229,7 +227,7 @@ pointers to it remain consistent and valid.)

    -int PL::Spatial::spatial_name_to_early_infs(wording W, inference_subject **infs) {
    +int PL::Spatial::spatial_name_to_early_infs(wording W, inference_subject **infs) {
         if (<notable-spatial-kinds>(W)) {
             switch (<<r>>) {
                 case 0: if (K_room == NULL) *infs = infs_room; break;
    @@ -242,11 +240,11 @@ pointers to it remain consistent and valid.)
         return FALSE;
     }
     
    -

    §9. Here we initialise the data used by Spatial for each object: +

    §10. Here we initialise the data used by Spatial for each object:

    -spatial_data *PL::Spatial::new_data(inference_subject *subj) {
    +spatial_data *PL::Spatial::new_data(inference_subject *subj) {
         spatial_data *sd = CREATE(spatial_data);
         sd->progenitor = NULL; sd->progenitor_set_at = NULL; sd->part_flag = FALSE;
         sd->object_tree_parent = NULL; sd->object_tree_child = NULL; sd->object_tree_sibling = NULL;
    @@ -256,13 +254,13 @@ pointers to it remain consistent and valid.)
         return sd;
     }
     
    -

    §10. Special inferences. Four of these are quite simple inferences, but PARENTAGE_INF stores the +

    §11. Special inferences. Four of these are quite simple inferences, but PARENTAGE_INF stores the object to which a spatial relationship is being inferred; and this means that multiple PARENTAGE_INFs can contradict each other.

    -int PL::Spatial::spatial_log_inference_type(int it) {
    +int PL::Spatial::spatial_log_inference_type(int it) {
         switch(it) {
             case CONTAINS_THINGS_INF: LOG("CONTAINS_THINGS_INF"); return TRUE;
             case IS_ROOM_INF: LOG("IS_ROOM_INF"); return TRUE;
    @@ -274,7 +272,7 @@ multiple PARENTAGE_INF
         return FALSE;
     }
     
    -int PL::Spatial::spatial_inferences_contradict(inference *A, inference *B, int similarity) {
    +int PL::Spatial::spatial_inferences_contradict(inference *A, inference *B, int similarity) {
         if ((World::Inferences::get_inference_type(A) == PARENTAGE_INF) &&
             (World::Inferences::get_reference_as_object(A) !=
                 World::Inferences::get_reference_as_object(B)))
    @@ -282,7 +280,7 @@ multiple PARENTAGE_INF
         return FALSE;
     }
     
    -int PL::Spatial::spatial_explain_contradiction(inference *A, inference *B, int similarity,
    +int PL::Spatial::spatial_explain_contradiction(inference *A, inference *B, int similarity,
         inference_subject *subj) {
         if ((World::Inferences::get_inference_type(A) == PARENTAGE_INF) &&
             (World::Inferences::get_reference_as_object(A) !=
    @@ -307,7 +305,7 @@ multiple PARENTAGE_INF
         return FALSE;
     }
     
    -

    §11. Special kinds. These are kind names to do with spatial layout which Inform provides special +

    §12. Special kinds. These are kind names to do with spatial layout which Inform provides special support for; it recognises the Englishs name when defined by the Standard Rules. (So there is no need to translate this to other languages.)

    @@ -322,10 +320,10 @@ Rules. (So there is no need to translate this to other languages.) player's holdall
    -

    §12.

    +

    §13.

    -int PL::Spatial::spatial_new_base_kind_notify(kind *new_base, text_stream *name, wording W) {
    +int PL::Spatial::spatial_new_base_kind_notify(kind *new_base, text_stream *name, wording W) {
         if (<notable-spatial-kinds>(W)) {
             switch (<<r>>) {
                 case 0: K_room = new_base; return TRUE;
    @@ -339,18 +337,18 @@ Rules. (So there is no need to translate this to other languages.)
         return FALSE;
     }
     
    -int PL::Spatial::spatial_new_subject_notify(inference_subject *subj) {
    -    CREATE_PF_DATA(spatial, subj, PL::Spatial::new_data);
    +int PL::Spatial::spatial_new_subject_notify(inference_subject *subj) {
    +    CREATE_PF_DATA(spatial, subj, PL::Spatial::new_data);
         return FALSE;
     }
     
    -

    §13. When the rest of Inform makes something a room, for instance in response to +

    §14. When the rest of Inform makes something a room, for instance in response to an explicit sentence like "The Hall of Mirrors is a room.", we take notice; if it turns out to be news, we infer IS_ROOM_INF with certainty.

    -int PL::Spatial::spatial_set_kind_notify(instance *I, kind *k) {
    +int PL::Spatial::spatial_set_kind_notify(instance *I, kind *k) {
         kind *kw = Instances::to_kind(I);
         if ((!(Kinds::Compare::le(kw, K_room))) &&
             (Kinds::Compare::le(k, K_room)))
    @@ -359,12 +357,12 @@ if it turns out to be news, we infer     return FALSE;
     }
     
    -

    §14. Nothing in the core Inform language prevents room from being made a kind +

    §15. Nothing in the core Inform language prevents room from being made a kind of vehicle, and so on, but this would cause mayhem in the model world. So:

    -int PL::Spatial::spatial_set_subkind_notify(kind *sub, kind *super) {
    +int PL::Spatial::spatial_set_subkind_notify(kind *sub, kind *super) {
         if ((sub == K_thing) && (super != K_object)) {
             if (problem_count == 0)
                 StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_ThingAdrift),
    @@ -397,18 +395,18 @@ of vehicle, and so on, but this would cause mayhem in the model world. So:
         return FALSE;
     }
     
    -

    §15. This tests whether an object is an instance of "room": +

    §16. This tests whether an object is an instance of "room":

    -int PL::Spatial::object_is_a_room(instance *I) {
    +int PL::Spatial::object_is_a_room(instance *I) {
         if ((Plugins::Manage::plugged_in(spatial_plugin)) && (K_room) && (I) &&
             (Instances::of_kind(I, K_room)))
             return TRUE;
         return FALSE;
     }
     
    -

    §16. This is where we give Inform the numbers it needs to write the "a world +

    §17. This is where we give Inform the numbers it needs to write the "a world with 5 rooms and 27 things"-style text in a successful report on its run.

    @@ -420,7 +418,7 @@ with 5 rooms and 27 things"-style text in a successful report on its run. LOOP_OVER_INSTANCES(I, K_thing) (*things)++; }
    -

    §17. Special properties. These are property names to do with spatial layout which Inform provides +

    §18. Special properties. These are property names to do with spatial layout which Inform provides special support for; it recognises the English names when they are defined by the Standard Rules. (So there is no need to translate this to other languages.)

    @@ -439,10 +437,10 @@ special with it at all. matching key
  • -

    §18.

    +

    §19.

    -int PL::Spatial::spatial_new_property_notify(property *prn) {
    +int PL::Spatial::spatial_new_property_notify(property *prn) {
         if (<notable-spatial-properties>(prn->name)) {
             switch (<<r>>) {
                 case 0: P_initial_appearance = prn; break;
    @@ -456,14 +454,14 @@ special with it at all.
         return FALSE;
     }
     
    -

    §19. Default appearances. Spatial gets to decide here what raw text following a new object will be +

    §20. Default appearances. Spatial gets to decide here what raw text following a new object will be taken to mean: for scenery it will be the "description" (i.e., the text produced on examining), for any other thing it will be the "initial appearance".

    -int PL::Spatial::spatial_default_appearance(inference_subject *infs, parse_node *txt) {
    +int PL::Spatial::spatial_default_appearance(inference_subject *infs, parse_node *txt) {
         if (InferenceSubjects::is_within(infs, Kinds::Knowledge::as_subject(K_object))) {
             property *set_prn = P_description;
             if (InferenceSubjects::is_within(infs, Kinds::Knowledge::as_subject(K_thing))) {
    @@ -474,7 +472,7 @@ appearance".
                         property *prn = World::Inferences::get_property(inf);
                         if (((prn) && (World::Inferences::get_certainty(inf) > 0)) &&
                             (prn == P_description)) {
    -                        Produce a problem for doubly described scenery19.1;
    +                        Produce a problem for doubly described scenery20.1;
                             return TRUE;
                         }
                     }
    @@ -486,13 +484,13 @@ appearance".
         return FALSE;
     }
     
    -

    §19.1. A lone string as a sentence is a description for a room, but an initial +

    §20.1. A lone string as a sentence is a description for a room, but an initial description for an object. Only now can we know which, since we have only just decided whether I is a room or not. We therefore draw the necessary inference.

    -

    Produce a problem for doubly described scenery19.1 = +

    Produce a problem for doubly described scenery20.1 =

    @@ -505,8 +503,8 @@ inference.
             "it. But the source text writes out its description, too",
             "which means we have a subtle little contradiction here.");
     
    -
    • This code is used in §19.
    -

    §20. Composite noun-quantifiers. "Nothing" is conspicuously absent from the possibilities below. It gets +

    • This code is used in §20.
    +

    §21. Composite noun-quantifiers. "Nothing" is conspicuously absent from the possibilities below. It gets special treatment elsewhere since it can also double as a value (the "not an object" pseudo-value).

    @@ -524,7 +522,7 @@ an object" pseudo-value). _no _one *** ==> { -, K_person, <<quantifier:q>> = not_exists_quantifier }
    -

    §21. Words like "something" or "everywhere" combine a common noun — thing, +

    §22. Words like "something" or "everywhere" combine a common noun — thing, and implicitly room — with a determiner — one thing, all rooms. When we detect them, we set both quantifier_used and some_kind appropriately. None can be recognised if the basic kinds are not created yet, which we @@ -541,7 +539,7 @@ that such a door exists — we needn't set the variable.

    -int PL::Spatial::spatial_parse_composite_NQs(wording *W, wording *DW,
    +int PL::Spatial::spatial_parse_composite_NQs(wording *W, wording *DW,
         quantifier **quant, kind **some_kind) {
         if (K_thing) {
             <<quantifier:q>> = NULL;
    @@ -554,7 +552,7 @@ that such a door exists — we needn't set the variable.
         return FALSE;
     }
     
    -

    §22. Nowhere. This means the same as "nothing", in a noun context, but we annotate a parse +

    §23. Nowhere. This means the same as "nothing", in a noun context, but we annotate a parse node using this wording in order to produce better problem messages if need be.

    @@ -563,10 +561,10 @@ node using this wording in order to produce better problem messages if need be. nowhere
    -

    §23.

    +

    §24.

    -int PL::Spatial::spatial_act_on_special_NPs(parse_node *p) {
    +int PL::Spatial::spatial_act_on_special_NPs(parse_node *p) {
         if ((<notable-spatial-noun-phrases>(Node::get_text(p))) &&
             (Word::unexpectedly_upper_case(Wordings::first_wn(Node::get_text(p))) == FALSE) &&
             (K_room)) {
    @@ -577,11 +575,11 @@ node using this wording in order to produce better problem messages if need be.
         return FALSE;
     }
     
    -

    §24. Now in fact this often does get picked up: +

    §25. Now in fact this often does get picked up:

    -int PL::Spatial::spatial_intervene_in_assertion(parse_node *px, parse_node *py) {
    +int PL::Spatial::spatial_intervene_in_assertion(parse_node *px, parse_node *py) {
         if (Annotations::read_int(py, nowhere_ANNOT)) {
             inference_subject *left_subject = Node::get_subject(px);
             if (left_subject) {
    @@ -600,7 +598,7 @@ node using this wording in order to produce better problem messages if need be.
         return FALSE;
     }
     
    -

    §25. Here. A sentence like "The sonic screwdriver is here." is not copular, but instead +

    §26. Here. A sentence like "The sonic screwdriver is here." is not copular, but instead expresses a relationship — "here" is not a value but a relation to an unstated object. That object is the room we're currently talking about, which sounds easy to work out, but isn't: we don't yet know which of the objects @@ -619,7 +617,7 @@ with certainty read

    as creating a container called "washing machine", not a room.

    -

    §26.

    +

    §27.

     void PL::Spatial::infer_presence_here(instance *I) {
    @@ -640,7 +638,7 @@ with certainty read
         World::Inferences::draw(IS_ROOM_INF, infs, IMPOSSIBLE_CE, NULL, NULL);
     }
     
    -

    §27. Similarly: +

    §28. Similarly:

    @@ -651,22 +649,22 @@ with certainty read
             NULL, NULL);
     }
     
    -

    §28. Completing the model, stages I and II. That's enough preliminaries; time to get on with adding a sense of space +

    §29. Completing the model, stages I and II. That's enough preliminaries; time to get on with adding a sense of space to the model world.

    -int PL::Spatial::IF_complete_model(int stage) {
    +int PL::Spatial::IF_complete_model(int stage) {
         switch(stage) {
    -        case 1: PL::Spatial::spatial_stage_I(); break;
    -        case 2: PL::Spatial::spatial_stage_II(); break;
    -        case 3: PL::Spatial::spatial_stage_III(); break;
    -        case 4: PL::Spatial::spatial_stage_IV(); break;
    +        case 1: PL::Spatial::spatial_stage_I(); break;
    +        case 2: PL::Spatial::spatial_stage_II(); break;
    +        case 3: PL::Spatial::spatial_stage_III(); break;
    +        case 4: PL::Spatial::spatial_stage_IV(); break;
         }
         return FALSE;
     }
     
    -

    §29. Recall that as we begin stage I of model creation, all objects are, of +

    §30. Recall that as we begin stage I of model creation, all objects are, of course, created, and they have kinds associated with them if the source text has said explicitly what kind they have: but that is not good enough. It often happens that the source implicitly specifies a kind, and we need @@ -676,14 +674,14 @@ that Y is the destination of a map connection — to see which.

    -int PL::Spatial::spatial_stage_I(void) {
    +int PL::Spatial::spatial_stage_I(void) {
         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I)
    -        Perform kind determination for this object29.1;
    +        Perform kind determination for this object30.1;
         return FALSE;
     }
     
    -

    §29.1. Our main problem in what follows is caused by "in" being so ambiguous, +

    §30.1. Our main problem in what follows is caused by "in" being so ambiguous, or perhaps it might be said that the real problem is that we choose to distinguish between rooms and containers on a world-modelling level — when it could well be argued that they are linguistically the same thing. @@ -717,35 +715,35 @@ like "in", and from the spatial context in which the object appears. This is the "geography choice" for its kind.

    -

    Perform kind determination for this object29.1 = +

    Perform kind determination for this object30.1 =

         current_sentence = Instances::get_creating_sentence(I);
     
         kind *designers_choice = NULL;
    -    Determine the designer choice29.1.1;
    +    Determine the designer choice30.1.1;
     
         kind *geography_choice = NULL;
         inference *geography_inference = NULL;
         int geography_certainty = UNKNOWN_CE;
    -    Determine the geography choice29.1.2;
    +    Determine the geography choice30.1.2;
     
         if ((geography_choice) &&
             (Kinds::Compare::eq(geography_choice, designers_choice) == FALSE))
    -        Attempt to reconcile the two choices29.1.3;
    +        Attempt to reconcile the two choices30.1.3;
     
         if (Kinds::Compare::eq(Instances::to_kind(I), K_object))
             Calculus::Propositions::Abstract::assert_kind_of_object(I, K_thing);
     
    -
    • This code is used in §29.
    -

    §29.1.1. By this point, any explicit information is reflected in the hierarchy of +

    • This code is used in §30.
    +

    §30.1.1. By this point, any explicit information is reflected in the hierarchy of kinds. We look out for four specialised kinds of thing, but failing that, we simply take its broadest kind — usually "thing", "room", "direction" or "region".

    -

    Determine the designer choice29.1.1 = +

    Determine the designer choice30.1.1 =

    @@ -765,13 +763,13 @@ or "region".
         }
         if (designers_choice == NULL) designers_choice = f;
     
    - -

    §29.1.2. If there is any positive information that this is a room, that's the +

    +

    §30.1.2. If there is any positive information that this is a room, that's the geography choice; otherwise it's whichever of room or container is more probably suggested by inferences.

    -

    Determine the geography choice29.1.2 = +

    Determine the geography choice30.1.2 =

    @@ -790,8 +788,8 @@ probably suggested by inferences.
                 geography_inference = inf;
             }
     
    - -

    §29.1.3. Since the designer choice is the one currently in force, we have basically +

    +

    §30.1.3. Since the designer choice is the one currently in force, we have basically three choices here: impose the geography choice instead; do nothing; or issue a problem message. The case where we do nothing is if geography suggests something is a room, when it's actually a door: this is because sentences @@ -799,7 +797,7 @@ like "East is the Marble Portal" can suggest the "Marble Portal" is a room when it's legitimately a door.

    -

    Attempt to reconcile the two choices29.1.3 = +

    Attempt to reconcile the two choices30.1.3 =

    @@ -807,14 +805,14 @@ when it's legitimately a door.
         if ((designers_choice == NULL) ||
             ((geography_certainty == CERTAIN_CE) &&
                 (Kinds::Compare::le(geography_choice, designers_choice))))
    -        Accept the geography choice, since it only refines what we already know29.1.3.1
    +        Accept the geography choice, since it only refines what we already know30.1.3.1
         else if ((geography_certainty == CERTAIN_CE) &&
                 (!((Kinds::Compare::eq(designers_choice, K_door)) &&
                     (Kinds::Compare::eq(geography_choice, K_room)))))
    -        Issue a problem message, since the choices are irreconcilable29.1.3.2;
    +        Issue a problem message, since the choices are irreconcilable30.1.3.2;
     
    - -

    §29.1.3.1. Accept the geography choice, since it only refines what we already know29.1.3.1 = +

    +

    §30.1.3.1. Accept the geography choice, since it only refines what we already know30.1.3.1 =

    @@ -822,8 +820,8 @@ when it's legitimately a door.
             I, geography_choice);
         Calculus::Propositions::Abstract::assert_kind_of_object(I, geography_choice);
     
    - -

    §29.1.3.2. Issue a problem message, since the choices are irreconcilable29.1.3.2 = +

    +

    §30.1.3.2. Issue a problem message, since the choices are irreconcilable30.1.3.2 =

    @@ -831,15 +829,15 @@ when it's legitimately a door.
         parse_node *decider = Instances::get_creating_sentence(I);
         if (sentence_setting_kind) decider = sentence_setting_kind;
         if (Kinds::Compare::eq(designers_choice, K_person))
    -        Issue a problem message for implied containment by a person29.1.3.2.1
    +        Issue a problem message for implied containment by a person30.1.3.2.1
         else if ((Kinds::Compare::eq(designers_choice, K_supporter)) &&
                     (Kinds::Compare::eq(geography_choice, K_container)))
    -        Issue a problem message for simultaneous containment and support29.1.3.2.2
    +        Issue a problem message for simultaneous containment and support30.1.3.2.2
         else
    -        Issue a more generic problem message for irreconcilable kinds29.1.3.2.3;
    +        Issue a more generic problem message for irreconcilable kinds30.1.3.2.3;
     
    - -

    §29.1.3.2.1. Issue a problem message for implied containment by a person29.1.3.2.1 = +

    +

    §30.1.3.2.1. Issue a problem message for implied containment by a person30.1.3.2.1 =

    @@ -851,12 +849,12 @@ when it's legitimately a door.
             "so 'The briefcase is in Daphne.' is disallowed, but 'The briefcase is "
             "carried by Daphne.' is fine, or indeed 'Daphne carries the briefcase.'");
     
    - -

    §29.1.3.2.2. A notorious problem message for a notorious limitation of the traditional +

    +

    §30.1.3.2.2. A notorious problem message for a notorious limitation of the traditional Inform spatial model:

    -

    Issue a problem message for simultaneous containment and support29.1.3.2.2 = +

    Issue a problem message for simultaneous containment and support30.1.3.2.2 =

    @@ -869,8 +867,8 @@ Inform spatial model:
             "container called the drawer is part of the desk. In the drawer is a "
             "stapler.'");
     
    - -

    §29.1.3.2.3. Issue a more generic problem message for irreconcilable kinds29.1.3.2.3 = +

    +

    §30.1.3.2.3. Issue a more generic problem message for irreconcilable kinds30.1.3.2.3 =

    @@ -881,8 +879,8 @@ Inform spatial model:
             "sentences true",
             "and this is a contradiction.");
     
    - -

    §30. Stage II at last. Now the kinds are all known, and it's time to work out +

    +

    §31. Stage II at last. Now the kinds are all known, and it's time to work out the spatial arrangements. Inform's spatial model assigns every instance object a unique "progenitor", which may be NULL, representing the object which immediately contains, carries, wears, supports or incorporates it. @@ -895,13 +893,13 @@ provide access routines to read and write:

    -instance *PL::Spatial::progenitor(instance *I) {
    +instance *PL::Spatial::progenitor(instance *I) {
         if (I == NULL) return NULL;
         if (Plugins::Manage::plugged_in(spatial_plugin) == FALSE) return NULL;
         return PF_I(spatial, I)->progenitor;
     }
     
    -void PL::Spatial::set_progenitor(instance *of, instance *to, inference *reason) {
    +void PL::Spatial::set_progenitor(instance *of, instance *to, inference *reason) {
         if (Plugins::Manage::plugged_in(spatial_plugin) == FALSE)
             internal_error("spatial plugin inactive");
         if (to == NULL) internal_error("set progenitor of nothing");
    @@ -910,38 +908,38 @@ provide access routines to read and write:
             (reason)?World::Inferences::where_inferred(reason):NULL;
     }
     
    -

    §31. This is used for error recovery only. +

    §32. This is used for error recovery only.

    -void PL::Spatial::void_progenitor(instance *of) {
    +void PL::Spatial::void_progenitor(instance *of) {
         if (Plugins::Manage::plugged_in(spatial_plugin) == FALSE)
             internal_error("spatial plugin inactive");
         PF_I(spatial, of)->progenitor = NULL;
         PF_I(spatial, of)->progenitor_set_at = NULL;
     }
     
    -

    §32. We need to establish what the rooms are before we worry about objects which +

    §33. We need to establish what the rooms are before we worry about objects which are "here"; rooms are never "here", so there's no circularity in that, and we solve this problem by determining the kind of non-here objects before the kind of here-objects.

    -int PL::Spatial::spatial_stage_II(void) {
    -    Set the here flag for all those objects whose parentage is only thus known32.1;
    +int PL::Spatial::spatial_stage_II(void) {
    +    Set the here flag for all those objects whose parentage is only thus known33.1;
         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I)
             if (PF_I(spatial, I)->here_flag == FALSE)
    -            Position this object spatially32.3;
    +            Position this object spatially33.3;
         LOOP_OVER_OBJECT_INSTANCES(I)
             if (PF_I(spatial, I)->here_flag)
    -            Position this object spatially32.3;
    -    Issue problem messages if non-physical objects are spatially enclosed32.2;
    +            Position this object spatially33.3;
    +    Issue problem messages if non-physical objects are spatially enclosed33.2;
         return FALSE;
     }
     
    -

    §32.1. Set the here flag for all those objects whose parentage is only thus known32.1 = +

    §33.1. Set the here flag for all those objects whose parentage is only thus known33.1 =

    @@ -953,20 +951,20 @@ the kind of here-objects.
                 PF_I(spatial, I)->here_flag = TRUE;
         }
     
    -
    • This code is used in §32.
    -

    §32.2. Issue problem messages if non-physical objects are spatially enclosed32.2 = +

    • This code is used in §33.
    +

    §33.2. Issue problem messages if non-physical objects are spatially enclosed33.2 =

         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I) {
    -        if ((PL::Spatial::progenitor(I)) &&
    +        if ((PL::Spatial::progenitor(I)) &&
                 (Instances::of_kind(I, K_thing) == FALSE) &&
                 (Instances::of_kind(I, K_room) == FALSE) &&
                 (PL::Regions::object_is_a_region(I) == FALSE)) {
                 Problems::quote_source(1, Instances::get_creating_sentence(I));
                 Problems::quote_object(2, I);
    -            Problems::quote_object(3, PL::Spatial::progenitor(I));
    +            Problems::quote_object(3, PL::Spatial::progenitor(I));
                 Problems::quote_kind(4, Instances::to_kind(I));
                 StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_NonThingInModel));
                 Problems::issue_problem_segment(
    @@ -980,43 +978,43 @@ the kind of here-objects.
             }
         }
     
    -
    • This code is used in §32.
    -

    §32.3. At last we come to it: determining the progenitor, and part-flag, for the +

    • This code is used in §33.
    +

    §33.3. At last we come to it: determining the progenitor, and part-flag, for the object under investigation.

    -

    Position this object spatially32.3 = +

    Position this object spatially33.3 =

         inference *parent_setting_inference = NULL;
    -    Find the inference which will decide the progenitor32.3.1;
    +    Find the inference which will decide the progenitor33.3.1;
         if (parent_setting_inference) {
             instance *whereabouts =
                 World::Inferences::get_reference_as_object(parent_setting_inference);
    -        if (PF_I(spatial, I)->here_flag) Find the whereabouts of something here32.3.2;
    +        if (PF_I(spatial, I)->here_flag) Find the whereabouts of something here33.3.2;
             if (whereabouts) {
    -            PL::Spatial::set_progenitor(I, whereabouts, parent_setting_inference);
    +            PL::Spatial::set_progenitor(I, whereabouts, parent_setting_inference);
                 LOGIF(OBJECT_TREE, "Progenitor of $O is $O\n", I, whereabouts);
             }
         }
    -    Determine whether the object in question is a component part32.3.3;
    +    Determine whether the object in question is a component part33.3.3;
     
    -
    • This code is used in §32 (twice).
    -

    §32.3.1. Find the inference which will decide the progenitor32.3.1 = +

    • This code is used in §33 (twice).
    +

    §33.3.1. Find the inference which will decide the progenitor33.3.1 =

         inference *inf;
         POSITIVE_KNOWLEDGE_LOOP(inf, Instances::as_subject(I), PARENTAGE_NOWHERE_INF)
    -        Make this the determining inference32.3.1.1;
    +        Make this the determining inference33.3.1.1;
         POSITIVE_KNOWLEDGE_LOOP(inf, Instances::as_subject(I), PARENTAGE_HERE_INF)
    -        Make this the determining inference32.3.1.1;
    +        Make this the determining inference33.3.1.1;
         POSITIVE_KNOWLEDGE_LOOP(inf, Instances::as_subject(I), PARENTAGE_INF)
    -        Make this the determining inference32.3.1.1;
    +        Make this the determining inference33.3.1.1;
     
    - -

    §32.3.1.1. Make this the determining inference32.3.1.1 = +

    +

    §33.3.1.1. Make this the determining inference33.3.1.1 =

    @@ -1030,16 +1028,16 @@ object under investigation.
         }
         parent_setting_inference = inf;
     
    -
    • This code is used in §32.3.1 (three times).
    -

    §32.3.2. Find the whereabouts of something here32.3.2 = +

    • This code is used in §33.3.1 (three times).
    +

    §33.3.2. Find the whereabouts of something here33.3.2 =

    -    if (PL::Spatial::object_is_a_room(whereabouts) == FALSE) whereabouts = NULL;
    +    if (PL::Spatial::object_is_a_room(whereabouts) == FALSE) whereabouts = NULL;
         if (whereabouts == NULL) {
             parse_node *here_sentence =
                 World::Inferences::where_inferred(parent_setting_inference);
    -        Set the whereabouts to the last discussed room prior to this inference being drawn32.3.2.1;
    +        Set the whereabouts to the last discussed room prior to this inference being drawn33.3.2.1;
             if (whereabouts == NULL) {
                 current_sentence = here_sentence;
                 StandardProblems::object_problem_at_sentence(_p_(PM_NoHere),
    @@ -1050,27 +1048,27 @@ object under investigation.
             }
         }
     
    - -

    §32.3.2.1. This runs through the source text from the beginning up to the "here" +

    +

    §33.3.2.1. This runs through the source text from the beginning up to the "here" sentence, setting whereabouts to any rooms it finds along the way, so that when it finishes this will be set to the most recently mentioned.

    -

    Set the whereabouts to the last discussed room prior to this inference being drawn32.3.2.1 = +

    Set the whereabouts to the last discussed room prior to this inference being drawn33.3.2.1 =

         SyntaxTree::traverse_up_to_ip(Task::syntax_tree(), here_sentence,
    -        PL::Spatial::seek_room, (void **) &whereabouts);
    +        PL::Spatial::seek_room, (void **) &whereabouts);
     
    - -

    §32.3.3. Determine whether the object in question is a component part32.3.3 = +

    +

    §33.3.3. Determine whether the object in question is a component part33.3.3 =

         inference *inf;
         POSITIVE_KNOWLEDGE_LOOP(inf, Instances::as_subject(I), PART_OF_INF) {
    -        if ((PL::Spatial::object_is_a_room(I)) || (PL::Map::object_is_a_door(I))) {
    +        if ((PL::Spatial::object_is_a_room(I)) || (PL::Map::object_is_a_door(I))) {
                 StandardProblems::object_problem(_p_(PM_RoomOrDoorAsPart),
                     I,
                     "was set up as being part of something else, which doors and rooms "
    @@ -1086,18 +1084,18 @@ when it finishes this will be set to the most recently mentioned.
             PF_I(spatial, I)->part_flag = TRUE;
         }
     
    - -

    §33.

    + +

    §34.

    -void PL::Spatial::seek_room(parse_node *sent, void **v_I) {
    +void PL::Spatial::seek_room(parse_node *sent, void **v_I) {
         instance **I = (instance **) v_I;
         inference_subject *isub = Node::get_interpretation_of_subject(sent);
         instance *sub = InferenceSubjects::as_object_instance(isub);
    -    if (PL::Spatial::object_is_a_room(sub)) *I = sub;
    +    if (PL::Spatial::object_is_a_room(sub)) *I = sub;
     }
     
    -

    §34. Completing the model, stages III and IV. By the beginning of Stage III, the progenitor of every object is known, and +

    §35. Completing the model, stages III and IV. By the beginning of Stage III, the progenitor of every object is known, and so is whether it is a part. It's time to start work on compiling the I6 representation of all this, but unfortunately that will need to be quite a bit more complicated. So we're going to do this in two stages, the first @@ -1114,15 +1112,15 @@ other: an object is not allowed to have a parent in both trees at once. If it has a parent in either one, then that parent is required to be its progenitor.

    -

    §35. The following logs the more interesting tree: +

    §36. The following logs the more interesting tree:

    -void PL::Spatial::log_object_tree(void) {
    +void PL::Spatial::log_object_tree(void) {
         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I)
             if (PF_I(spatial, I)->object_tree_parent == NULL)
    -            PL::Spatial::log_object_tree_recursively(I, 0);
    +            PL::Spatial::log_object_tree_recursively(I, 0);
     }
     
     void PL::Spatial::log_object_tree_recursively(instance *I, int depth) {
    @@ -1130,12 +1128,12 @@ If it has a parent in either one, then that parent is required to be its progeni
         while (i>0) { LOG("  "); i--; }
         LOG("$O\n", I);
         if (PF_I(spatial, I)->object_tree_child)
    -        PL::Spatial::log_object_tree_recursively(PF_I(spatial, I)->object_tree_child, depth+1);
    +        PL::Spatial::log_object_tree_recursively(PF_I(spatial, I)->object_tree_child, depth+1);
         if (PF_I(spatial, I)->object_tree_sibling)
    -        PL::Spatial::log_object_tree_recursively(PF_I(spatial, I)->object_tree_sibling, depth);
    +        PL::Spatial::log_object_tree_recursively(PF_I(spatial, I)->object_tree_sibling, depth);
     }
     
    -

    §36. The initial state of both trees is total disconnection. They are then produced +

    §37. The initial state of both trees is total disconnection. They are then produced using only two operations, which we'll call "adoption" and "parting".

    @@ -1145,33 +1143,33 @@ The tree is grown entirely from its root by repeated use of this one operation.

    -void PL::Spatial::adopt_object(instance *orphan, instance *foster) {
    +void PL::Spatial::adopt_object(instance *orphan, instance *foster) {
         LOGIF(OBJECT_TREE, "Grafting $O to be child of $O\n", orphan, foster);
         if (orphan == NULL) internal_error("orphan is null in adoption");
         if (foster == NULL) internal_error("foster is null in adoption");
     
         instance *former_parent = PF_I(spatial, orphan)->object_tree_parent;
    -    if (former_parent) Remove the object from the main object tree36.2;
    -    Adopt the object into the main object tree36.3;
    +    if (former_parent) Remove the object from the main object tree37.2;
    +    Adopt the object into the main object tree37.3;
     }
     
    -

    §36.1. "Parting" is the operation of being removed from the main tree and placed +

    §37.1. "Parting" is the operation of being removed from the main tree and placed in the incorporation tree instead, but with the same parent.

    -void PL::Spatial::part_object(instance *orphan) {
    +void PL::Spatial::part_object(instance *orphan) {
         LOGIF(OBJECT_TREE, "Parting $O\n", orphan);
         if (orphan == NULL) internal_error("new part is null in parting");
     
         instance *former_parent = PF_I(spatial, orphan)->object_tree_parent;
         if (former_parent == NULL) internal_error("new part is without parent");
     
    -    Remove the object from the main object tree36.2;
    -    Adopt the object into the incorporation tree36.1.1;
    +    Remove the object from the main object tree37.2;
    +    Adopt the object into the incorporation tree37.1.1;
     }
     
    -

    §36.2. Remove the object from the main object tree36.2 = +

    §37.2. Remove the object from the main object tree37.2 =

    @@ -1190,8 +1188,8 @@ in the incorporation tree instead, but with the same parent.
         PF_I(spatial, orphan)->object_tree_parent = NULL;
         PF_I(spatial, orphan)->object_tree_sibling = NULL;
     
    - -

    §36.3. Adopt the object into the main object tree36.3 = +

    +

    §37.3. Adopt the object into the main object tree37.3 =

    @@ -1205,8 +1203,8 @@ in the incorporation tree instead, but with the same parent.
         }
         PF_I(spatial, orphan)->object_tree_parent = foster;
     
    -
    • This code is used in §36.
    -

    §36.1.1. Adopt the object into the incorporation tree36.1.1 = +

    • This code is used in §37.
    +

    §37.1.1. Adopt the object into the incorporation tree37.1.1 =

    @@ -1220,39 +1218,39 @@ in the incorporation tree instead, but with the same parent.
         }
         PF_I(spatial, orphan)->incorp_tree_parent = former_parent;
     
    - -

    §37. What will we use the trees for? Well, one use is to tell other plugins +

    +

    §38. What will we use the trees for? Well, one use is to tell other plugins which depend on Spatial whether or not one object spatially contains another:

    -int PL::Spatial::encloses(instance *I1, instance *I2) {
    +int PL::Spatial::encloses(instance *I1, instance *I2) {
         while (I1) {
    -        I1 = PL::Spatial::progenitor(I1);
    +        I1 = PL::Spatial::progenitor(I1);
             if (I1 == I2) return TRUE;
         }
         return FALSE;
     }
     
    -

    §38. But the main use for the trees is, as noted above, to form a convenient +

    §39. But the main use for the trees is, as noted above, to form a convenient intermediate state between the mass of progenitor data and the messy Inform 6 code it turns into. Here goes:

    -int PL::Spatial::spatial_stage_III(void) {
    +int PL::Spatial::spatial_stage_III(void) {
         int well_founded = TRUE;
    -    Define the Rucksack Class constant38.1;
    -    Check the well-foundedness of the hierarchy of the set of progenitors38.2;
    -    if (well_founded) Expand the progenitor data into the two object trees38.3;
    -    Assert the portability of any item carried or supported by a person38.4;
    -    Assert I6-level properties to express the spatial structure38.5;
    -    Set up the compilation sequence so that it traverses the main object tree38.6;
    -    if (Log::aspect_switched_on(OBJECT_TREE_DA)) PL::Spatial::log_object_tree();
    +    Define the Rucksack Class constant39.1;
    +    Check the well-foundedness of the hierarchy of the set of progenitors39.2;
    +    if (well_founded) Expand the progenitor data into the two object trees39.3;
    +    Assert the portability of any item carried or supported by a person39.4;
    +    Assert I6-level properties to express the spatial structure39.5;
    +    Set up the compilation sequence so that it traverses the main object tree39.6;
    +    if (Log::aspect_switched_on(OBJECT_TREE_DA)) PL::Spatial::log_object_tree();
         return FALSE;
     }
     
    -

    §38.1. To enable the use of player's holdalls, we must declare a constant +

    §39.1. To enable the use of player's holdalls, we must declare a constant RUCKSACK_CLASS to tell some code in the template layer to use possessions with this I6 class as the rucksack pro tem. This is all a bit of a hack, to retrofit a degree of generality onto the original I6 library feature, and even then @@ -1260,7 +1258,7 @@ it isn't really fully general: only the player has the benefit of a "player's holdall" (hence the name), with other actors oblivious.

    -

    Define the Rucksack Class constant38.1 = +

    Define the Rucksack Class constant39.1 =

    @@ -1270,14 +1268,14 @@ holdall" (hence the name), with other actors oblivious.
             Emit::named_iname_constant(iname, K_value, Kinds::RunTime::I6_classname(K_players_holdall));
         }
     
    -
    • This code is used in §38.
    -

    §38.2. The following verifies, in a brute-force way, that there are no cycles in +

    • This code is used in §39.
    +

    §39.2. The following verifies, in a brute-force way, that there are no cycles in the directed graph formed by the objects and progeniture. (We're doing this now, rather than at Stage II above, because other plugins may also have changed progenitors at Stage II.)

    -

    Check the well-foundedness of the hierarchy of the set of progenitors38.2 = +

    Check the well-foundedness of the hierarchy of the set of progenitors39.2 =

    @@ -1286,21 +1284,21 @@ changed progenitors at Stage II.)
         LOOP_OVER_OBJECT_INSTANCES(I) {
             int k;
             instance *I2;
    -        for (I2 = PL::Spatial::progenitor(I), k=0; (I2) && (k<max_loop);
    -            I2 = PL::Spatial::progenitor(I2), k++) {
    +        for (I2 = PL::Spatial::progenitor(I), k=0; (I2) && (k<max_loop);
    +            I2 = PL::Spatial::progenitor(I2), k++) {
                 if (I2 == I) {
    -                Diagnose the ill-foundedness with a problem message38.2.1;
    -                PL::Spatial::void_progenitor(I);  thus cutting the cycle
    +                Diagnose the ill-foundedness with a problem message39.2.1;
    +                PL::Spatial::void_progenitor(I);  thus cutting the cycle
                     well_founded = FALSE;
                 }
             }
         }
     
    -
    • This code is used in §38.
    -

    §38.2.1. The cutest of all the object problem messages, really: +

    • This code is used in §39.
    +

    §39.2.1. The cutest of all the object problem messages, really:

    -

    Diagnose the ill-foundedness with a problem message38.2.1 = +

    Diagnose the ill-foundedness with a problem message39.2.1 =

    @@ -1316,14 +1314,14 @@ changed progenitors at Stage II.)
             Problems::issue_problem_segment("%2 (created by %3) ");
             if (PF_I(spatial, I3)->part_flag) Problems::issue_problem_segment("part of ");
             else Problems::issue_problem_segment("in ");
    -        I3 = PL::Spatial::progenitor(I3);
    +        I3 = PL::Spatial::progenitor(I3);
             if (I3 == I) break;
         }
         Problems::issue_problem_segment("%1... and so on. This is forbidden.");
         Problems::issue_problem_end();
     
    - -

    §38.3. Intermediate states are always suspect in program design, and we might +

    +

    §39.3. Intermediate states are always suspect in program design, and we might ask what's wrong with simply making the trees as we go along, rather than storing all of those progenitors and then converting them into the trees. We don't do that because (for reasons to do with "here" and with how work @@ -1342,26 +1340,26 @@ first created being the eldest child. Looping over the objects to add them to the trees in creation order achieves this nicely:

    -

    Expand the progenitor data into the two object trees38.3 = +

    Expand the progenitor data into the two object trees39.3 =

         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I) {
    -        if (PL::Spatial::progenitor(I))
    -            PL::Spatial::adopt_object(I, PL::Spatial::progenitor(I));
    +        if (PL::Spatial::progenitor(I))
    +            PL::Spatial::adopt_object(I, PL::Spatial::progenitor(I));
             if (PF_I(spatial, I)->part_flag)
    -            PL::Spatial::part_object(I);
    +            PL::Spatial::part_object(I);
         }
     
    -
    • This code is used in §38.
    -

    §38.4. As a brief aside: if something is carried by a living person, we can +

    • This code is used in §39.
    +

    §39.4. As a brief aside: if something is carried by a living person, we can reasonably assume it's portable. (This is needed in particular to ensure that supporters which are initially carried don't pick up "fixed in place" in the absence of other information.)

    -

    Assert the portability of any item carried or supported by a person38.4 = +

    Assert the portability of any item carried or supported by a person39.4 =

    @@ -1370,7 +1368,7 @@ the absence of other information.)
             int portable = FALSE;
             instance *J = I;
             if (PF_I(spatial, I)->part_flag == FALSE)
    -            for (J = PL::Spatial::progenitor(I); J; J = PL::Spatial::progenitor(J)) {
    +            for (J = PL::Spatial::progenitor(I); J; J = PL::Spatial::progenitor(J)) {
                     if (PF_I(spatial, J)->part_flag) break;
                     if (Instances::of_kind(J, K_person)) {
                         portable = TRUE;
    @@ -1382,25 +1380,25 @@ the absence of other information.)
                     P_fixed_in_place, Instances::as_subject(I), FALSE, CERTAIN_CE);
         }
     
    -
    • This code is used in §38.
    -

    §38.5. Assert I6-level properties to express the spatial structure38.5 = +

    • This code is used in §39.
    +

    §39.5. Assert I6-level properties to express the spatial structure39.5 =

    -    Assert an explicit default description value for the room kind38.5.1;
    -    Assert room and thing indicator properties38.5.2;
    -    Assert container and supporter indicator properties38.5.3;
    -    Assert incorporation tree properties38.5.4;
    +    Assert an explicit default description value for the room kind39.5.1;
    +    Assert room and thing indicator properties39.5.2;
    +    Assert container and supporter indicator properties39.5.3;
    +    Assert incorporation tree properties39.5.4;
     
    -
    • This code is used in §38.
    -

    §38.5.1. We need to make sure that every room does have an I6 description value +

    • This code is used in §39.
    +

    §39.5.1. We need to make sure that every room does have an I6 description value which can be written to (i.e., we need to avoid accidental use of the Z-machine's readable-only default properties feature); hence the following, which ensures that any room with no explicit description will inherit EMPTY_TEXT_VALUE as a value for description from the room class.

    -

    Assert an explicit default description value for the room kind38.5.1 = +

    Assert an explicit default description value for the room kind39.5.1 =

    @@ -1419,14 +1417,14 @@ as a value for description        }
         }
     
    - -

    §38.5.2. These I6-only properties exist for speed. They're implemented in I6 as +

    +

    §39.5.2. These I6-only properties exist for speed. They're implemented in I6 as attributes, which means that testing them is very fast and there is no memory overhead for their storage. That shaves a little time off route-finding in extensive maps.

    -

    Assert room and thing indicator properties38.5.2 = +

    Assert room and thing indicator properties39.5.2 =

    @@ -1444,8 +1442,8 @@ extensive maps.
                     P_mark_as_thing, Instances::as_subject(I), TRUE, CERTAIN_CE);
         }
     
    - -

    §38.5.3. Assert container and supporter indicator properties38.5.3 = +

    +

    §39.5.3. Assert container and supporter indicator properties39.5.3 =

    @@ -1463,13 +1461,13 @@ extensive maps.
                     P_supporter, Instances::as_subject(I), TRUE, CERTAIN_CE);
         }
     
    - -

    §38.5.4. The main spatial tree is expressed in the compiled I6 code in an implicit +

    +

    §39.5.4. The main spatial tree is expressed in the compiled I6 code in an implicit way, using the I6 object tree, but the incorporation tree is expressed using a triplet of I6-only properties:

    -

    Assert incorporation tree properties38.5.4 = +

    Assert incorporation tree properties39.5.4 =

    @@ -1503,14 +1501,14 @@ a triplet of I6-only properties:
                 Rvalues::from_instance(cs), CERTAIN_CE);
         }
     
    - -

    §38.6. Because Inform 6 requires objects to be defined in a traversal order for +

    +

    §39.6. Because Inform 6 requires objects to be defined in a traversal order for the main spatial tree (only the main one because I6 has no concept of incorporation), we use the main tree to determine the compilation sequence for objects:

    -

    Set up the compilation sequence so that it traverses the main object tree38.6 = +

    Set up the compilation sequence so that it traverses the main object tree39.6 =

    @@ -1518,23 +1516,23 @@ for objects:
         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I)
             if (PF_I(spatial, I)->object_tree_parent == NULL)
    -            PL::Spatial::add_to_object_sequence(I, 0);
    +            PL::Spatial::add_to_object_sequence(I, 0);
     
    -
    • This code is used in §38.
    -

    §39.

    +
    • This code is used in §39.
    +

    §40.

    -void PL::Spatial::add_to_object_sequence(instance *I, int depth) {
    +void PL::Spatial::add_to_object_sequence(instance *I, int depth) {
         Instances::place_this_object_next(I);
         PF_I(spatial, I)->I6_definition_depth = depth;
     
         if (PF_I(spatial, I)->object_tree_child)
    -        PL::Spatial::add_to_object_sequence(PF_I(spatial, I)->object_tree_child, depth+1);
    +        PL::Spatial::add_to_object_sequence(PF_I(spatial, I)->object_tree_child, depth+1);
         if (PF_I(spatial, I)->object_tree_sibling)
    -        PL::Spatial::add_to_object_sequence(PF_I(spatial, I)->object_tree_sibling, depth);
    +        PL::Spatial::add_to_object_sequence(PF_I(spatial, I)->object_tree_sibling, depth);
     }
     
    -

    §40. The "definition depth" is the same thing as the depth in the main tree; +

    §41. The "definition depth" is the same thing as the depth in the main tree; 0 for a room, 1 for a player standing in that room, 2 for his hat, and so on.

    @@ -1545,18 +1543,18 @@ for objects: return 0; }
    -

    §41. At last, Stage IV. We're all done except for a little checking of the +

    §42. At last, Stage IV. We're all done except for a little checking of the degenerate case where Inform is just binding up an existing story file, so that there's really no spatial model at all — the world is, or should be, empty.

    -int PL::Spatial::spatial_stage_IV(void) {
    +int PL::Spatial::spatial_stage_IV(void) {
         if (Task::wraps_existing_storyfile()) {
             instance *I;
             LOOP_OVER_OBJECT_INSTANCES(I)
    -            if (PL::Spatial::object_is_a_room(I)) {
    +            if (PL::Spatial::object_is_a_room(I)) {
                     StandardProblems::unlocated_problem(Task::syntax_tree(), _p_(PM_RoomInIgnoredSource),
                         "This is supposed to be a source text which only contains "
                         "release instructions to bind up an existing story file "
    @@ -1570,12 +1568,12 @@ empty.
         return FALSE;
     }
     
    -

    §42.

    +

    §43.

     void PL::Spatial::index_spatial_relationship(OUTPUT_STREAM, instance *I) {
         char *rel = NULL;
    -    instance *P = PL::Spatial::progenitor(I);
    +    instance *P = PL::Spatial::progenitor(I);
         if (P) {
              we could set rel to "in" here, but the index omits that for clarity
             if (Instances::of_kind(P, K_supporter)) rel = "on";
    @@ -1589,7 +1587,7 @@ empty.
         if (rel) WRITE("<i>%s</i> ", rel);
     }
     
    -

    §43. If something is a part, we don't detail it on the World index page, since +

    §44. If something is a part, we don't detail it on the World index page, since it already turns up under its owner.

    @@ -1599,7 +1597,7 @@ it already turns up under its owner. return FALSE; }
    -

    §44. In the World index, we recurse to show the contents and parts: +

    §45. In the World index, we recurse to show the contents and parts:

    @@ -1614,11 +1612,11 @@ it already turns up under its owner.
         }
         if (PF_I(spatial, I)->object_tree_child)
             Data::Objects::index(OUT, PF_I(spatial, I)->object_tree_child, NULL, depth+1, details);
    -    if ((PL::Spatial::object_is_a_room(I)) &&
    +    if ((PL::Spatial::object_is_a_room(I)) &&
             (PL::Map::object_is_a_door(I) == FALSE)) {
             instance *I2;
             LOOP_OVER_OBJECT_INSTANCES(I2) {
    -            if ((PL::Map::object_is_a_door(I2)) && (PL::Spatial::progenitor(I2) != I)) {
    +            if ((PL::Map::object_is_a_door(I2)) && (PL::Spatial::progenitor(I2) != I)) {
                     instance *A = NULL, *B = NULL;
                     PL::Map::get_door_data(I2, &A, &B);
                     if (A == I) Data::Objects::index(OUT, I2, NULL, depth+1, details);
    @@ -1633,14 +1631,14 @@ it already turns up under its owner.
             Data::Objects::index(OUT, PF_I(spatial, I)->object_tree_sibling, NULL, depth, details);
     }
     
    -

    §45. And also: +

    §46. And also:

    -int PL::Spatial::spatial_add_to_World_index(OUTPUT_STREAM, instance *O) {
    +int PL::Spatial::spatial_add_to_World_index(OUTPUT_STREAM, instance *O) {
         if ((O) && (Instances::of_kind(O, K_thing))) {
             HTML::open_indented_p(OUT, 1, "tight");
    -        instance *P = PL::Spatial::progenitor(O);
    +        instance *P = PL::Spatial::progenitor(O);
             if (P) {
                 WRITE("<i>initial location:</i> ");
                 char *rel = "in";
    diff --git a/docs/if-module/3-sm2.html b/docs/if-module/3-sm2.html
    index 60354da09..53222e275 100644
    --- a/docs/if-module/3-sm2.html
    +++ b/docs/if-module/3-sm2.html
    @@ -186,7 +186,7 @@ than the number of rooms in the submap; this is why we keep the linked list.
     
     
    define LOOP_OVER_ROOMS(R)
         LOOP_OVER_OBJECT_INSTANCES(R)
    -        if (PL::Spatial::object_is_a_room(R))
    +        if (PL::Spatial::object_is_a_room(R))
     define LOOP_OVER_SUBMAP(R, sub)
         for (R = sub->first_room_in_submap; R; R = PF_I(map, R)->next_room_in_submap)
     
    @@ -565,12 +565,12 @@ door, which we take a note of if asked to do so.
     instance *PL::SpatialMap::room_exit(instance *origin, int dir_num, instance **via) {
         if (via) *via = NULL;
    -    if ((origin == NULL) || (PL::Spatial::object_is_a_room(origin) == FALSE) ||
    +    if ((origin == NULL) || (PL::Spatial::object_is_a_room(origin) == FALSE) ||
             (dir_num < 0) || (dir_num >= MAX_DIRECTIONS)) return NULL;
         instance *ultimate_destination = NULL;
         instance *immediate_destination = MAP_EXIT(origin, dir_num);
         if (immediate_destination) {
    -        if (PL::Spatial::object_is_a_room(immediate_destination))
    +        if (PL::Spatial::object_is_a_room(immediate_destination))
                 ultimate_destination = immediate_destination;
             if (PL::Map::object_is_a_door(immediate_destination)) {
                 if (via) *via = immediate_destination;
    diff --git a/docs/if-module/3-tm.html b/docs/if-module/3-tm.html
    index f64018ea3..60f3fa266 100644
    --- a/docs/if-module/3-tm.html
    +++ b/docs/if-module/3-tm.html
    @@ -347,7 +347,7 @@ Rules. (So there is no need to translate this to other languages.)
     

    §17.

    -int PL::Map::object_is_a_door(instance *I) {
    +int PL::Map::object_is_a_door(instance *I) {
         if ((Plugins::Manage::plugged_in(map_plugin)) && (K_door) && (I) &&
             (Instances::of_kind(I, K_door)))
             return TRUE;
    @@ -536,7 +536,7 @@ at run-time, so we can't know now how many we will need.
             Emit::array_divider(I"one row per room");
             instance *I;
             LOOP_OVER_OBJECT_INSTANCES(I)
    -            if (PL::Spatial::object_is_a_room(I)) {
    +            if (PL::Spatial::object_is_a_room(I)) {
                     int i;
                     for (i=0; i<registered_directions; i++) {
                         instance *to = MAP_EXIT(I, i);
    @@ -565,7 +565,7 @@ object has four pieces of data attached:
     

    -void PL::Map::get_door_data(instance *door, instance **c1, instance **c2) {
    +void PL::Map::get_door_data(instance *door, instance **c1, instance **c2) {
         if (c1) *c1 = PF_I(map, door)->map_connection_a;
         if (c2) *c2 = PF_I(map, door)->map_connection_b;
     }
    @@ -874,7 +874,7 @@ accommodate it.)
     
         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I)
    -        if (PL::Spatial::object_is_a_room(I))
    +        if (PL::Spatial::object_is_a_room(I))
                 Properties::Valued::assert(P_room_index,
                     Instances::as_subject(I), minus_one, CERTAIN_CE);
     
    @@ -894,9 +894,9 @@ checks that various mapping impossibilities do not occur. inference_subject *infs1; World::Inferences::get_references(inf, &infs1, NULL); instance *to = InferenceSubjects::as_object_instance(infs1); - if ((PL::Spatial::object_is_a_room(I)) && (to) && + if ((PL::Spatial::object_is_a_room(I)) && (to) && (PL::Map::object_is_a_door(to) == FALSE) && - (PL::Spatial::object_is_a_room(to) == FALSE)) + (PL::Spatial::object_is_a_room(to) == FALSE)) StandardProblems::contradiction_problem(_p_(PM_BadMapCell), Instances::get_creating_sentence(to), World::Inferences::where_inferred(inf), to, @@ -904,7 +904,7 @@ checks that various mapping impossibilities do not occur. "connection, but it seems to be neither a room nor a door", "and these are the only possibilities allowed by Inform."); if ((PL::Map::object_is_a_door(I)) && - (PL::Spatial::object_is_a_room(to) == FALSE)) + (PL::Spatial::object_is_a_room(to) == FALSE)) StandardProblems::object_problem(_p_(PM_DoorToNonRoom), I, "seems to be a door opening on something not a room", @@ -1010,7 +1010,7 @@ from which there's no way back.)
         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I)
    -        if (PL::Spatial::object_is_a_room(I)) {
    +        if (PL::Spatial::object_is_a_room(I)) {
                 inference *inf;
                 POSITIVE_KNOWLEDGE_LOOP(inf, Instances::as_subject(I), DIRECTION_INF) {
                     inference_subject *infs1;
    @@ -1083,9 +1083,9 @@ model at run-time.) This is where we apply the kill-joy rule in question:
         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I)
             if ((PL::Map::object_is_a_door(I)) &&
    -            (PL::Spatial::progenitor(I)) &&
    -            (PL::Spatial::progenitor(I) != PF_I(map, I)->map_connection_a) &&
    -            (PL::Spatial::progenitor(I) != PF_I(map, I)->map_connection_b))
    +            (PL::Spatial::progenitor(I)) &&
    +            (PL::Spatial::progenitor(I) != PF_I(map, I)->map_connection_a) &&
    +            (PL::Spatial::progenitor(I) != PF_I(map, I)->map_connection_b))
                 StandardProblems::object_problem(_p_(PM_DoorInThirdRoom),
                     I, "seems to be a door which is present in a room to which it is not connected",
                     "but this is not allowed. A door must be in one or both of the rooms it is "
    @@ -1105,8 +1105,8 @@ to them.
         LOOP_OVER_OBJECT_INSTANCES(I)
             if ((PL::Map::object_is_a_door(I)) &&
                 (PF_I(map, I)->map_connection_b == NULL) &&
    -            (PL::Spatial::progenitor(I) == NULL))
    -            PL::Spatial::set_progenitor(I, PF_I(map, I)->map_connection_a, NULL);
    +            (PL::Spatial::progenitor(I) == NULL))
    +            PL::Spatial::set_progenitor(I, PF_I(map, I)->map_connection_a, NULL);
     
    • This code is used in §37.

    §37.8. At this point we know that the doors are correctly plumbed in, and all we diff --git a/docs/if-module/3-tnt.html b/docs/if-module/3-tnt.html index fab1a4807..9c97f233b 100644 --- a/docs/if-module/3-tnt.html +++ b/docs/if-module/3-tnt.html @@ -257,7 +257,7 @@ from sentences, and this can include I6 properties with no I7 analogue. LOOP_OVER_OBJECT_INSTANCES(I) { wording W = Instances::get_name_in_play(I, FALSE); inference_subject *subj = Instances::as_subject(I); - int this_is_a_room = PL::Spatial::object_is_a_room(I); + int this_is_a_room = PL::Spatial::object_is_a_room(I); int this_has_a_printed_name = PL::Naming::look_for_printed_name(subj); int this_is_named_for_something_with_a_printed_name = FALSE; if (PL::Naming::object_this_is_named_after(I)) diff --git a/docs/if-module/3-tp.html b/docs/if-module/3-tp.html index 3226c049b..07f57dbee 100644 --- a/docs/if-module/3-tp.html +++ b/docs/if-module/3-tp.html @@ -387,11 +387,11 @@ we assume he is freestanding in the earliest defined room.

         instance *I;
         LOOP_OVER_OBJECT_INSTANCES(I)
    -        if ((PL::Spatial::object_is_a_room(I)) && (start_room == NULL)
    +        if ((PL::Spatial::object_is_a_room(I)) && (start_room == NULL)
                 && (Projects::draws_from_source_file(Task::project(), Instances::get_creating_file(I))))
                 start_room = I;
         LOOP_OVER_OBJECT_INSTANCES(I)
    -        if ((PL::Spatial::object_is_a_room(I)) && (start_room == NULL))
    +        if ((PL::Spatial::object_is_a_room(I)) && (start_room == NULL))
                 start_room = I;
         start_object = start_room;
     
    @@ -423,12 +423,12 @@ will do. But otherwise:
         if (player_character_object) {
    -        start_object = PL::Spatial::progenitor(player_character_object);
    +        start_object = PL::Spatial::progenitor(player_character_object);
             if (start_object) {
                 start_room = start_object;
    -            while ((start_room) && (PL::Spatial::progenitor(start_room)))
    -                start_room = PL::Spatial::progenitor(start_room);
    -            if ((start_room) && (PL::Spatial::object_is_a_room(start_room) == FALSE)) {
    +            while ((start_room) && (PL::Spatial::progenitor(start_room)))
    +                start_room = PL::Spatial::progenitor(start_room);
    +            if ((start_room) && (PL::Spatial::object_is_a_room(start_room) == FALSE)) {
                     StandardProblems::object_problem(_p_(PM_StartsOutsideRooms),
                         start_object,
                         "seems to be where the player is supposed to begin",
    @@ -489,7 +489,7 @@ usually appear anywhere.
     

    -void PL::Player::index_object_further(OUTPUT_STREAM, instance *I, int depth, int details) {
    +void PL::Player::index_object_further(OUTPUT_STREAM, instance *I, int depth, int details) {
         if ((I == start_room) && (I_yourself) &&
             (Instances::indexed_yet(I_yourself) == FALSE))
             Data::Objects::index(OUT, I_yourself, NULL, depth+1, details);
    diff --git a/docs/if-module/5-gpr.html b/docs/if-module/5-gpr.html
    index 666eecc05..45945e364 100644
    --- a/docs/if-module/5-gpr.html
    +++ b/docs/if-module/5-gpr.html
    @@ -156,7 +156,7 @@ will simply compile a parse_n
     
     inter_name *PL::Parsing::Tokens::General::get_gv_parse_name(grammar_verb *gv) {
         if (gv->gv_parse_name_iname == NULL) {
    -        compilation_module *C = Modules::find(gv->where_gv_created);
    +        compilation_unit *C = CompilationUnits::find(gv->where_gv_created);
             package_request *PR = Hierarchy::package(C, PARSE_NAMES_HAP);
             gv->gv_parse_name_iname = Hierarchy::make_iname_in(PARSE_NAME_FN_HL, PR);
         }
    @@ -171,7 +171,7 @@ will simply compile a parse_n
         } else {
             if (PL::Parsing::Visibility::any_property_visible_to_subject(subj, FALSE)) {
                 parse_name_notice *notice = CREATE(parse_name_notice);
    -            compilation_module *C = Modules::find(subj->infs_created_at);
    +            compilation_unit *C = CompilationUnits::find(subj->infs_created_at);
                 package_request *PR = Hierarchy::package(C, PARSE_NAMES_HAP);
                 notice->pnn_iname = Hierarchy::make_iname_in(PARSE_NAME_DASH_FN_HL, PR);
                 notice->parse_subject = subj;
    diff --git a/docs/inflections-module/3-vc.html b/docs/inflections-module/3-vc.html
    index 0ba89d632..502a0be63 100644
    --- a/docs/inflections-module/3-vc.html
    +++ b/docs/inflections-module/3-vc.html
    @@ -421,7 +421,7 @@ values representing verbs in story files compiled by Inform.
         if (vc->vc_iname == NULL) {
             if (vc->vc_conjugates == NULL) {
                 package_request *R =
    -                Hierarchy::package(Modules::find(vc->where_vc_created), MVERBS_HAP);
    +                Hierarchy::package(CompilationUnits::find(vc->where_vc_created), MVERBS_HAP);
                 TEMPORARY_TEXT(ANT)
                 WRITE_TO(ANT, "%A (modal)", &(vc->tabulations[ACTIVE_VOICE].vc_text[IS_TENSE][POSITIVE_SENSE][THIRD_PERSON]));
                 Hierarchy::markup(R, MVERB_NAME_HMD, ANT);
    diff --git a/docs/kinds-module/1-km.html b/docs/kinds-module/1-km.html
    index 93cafb25e..e7d044810 100644
    --- a/docs/kinds-module/1-km.html
    +++ b/docs/kinds-module/1-km.html
    @@ -74,7 +74,6 @@ which use this module:
     enum kind_constructor_CLASS
     enum kind_template_definition_CLASS
     enum kind_macro_definition_CLASS
    -enum kind_template_obligation_CLASS
     enum kind_constructor_comparison_schema_CLASS
     enum kind_constructor_casting_rule_CLASS
     enum kind_constructor_instance_CLASS
    @@ -87,7 +86,6 @@ which use this module:
     DECLARE_CLASS(kind_constructor)
     DECLARE_CLASS(kind_macro_definition)
     DECLARE_CLASS(kind_template_definition)
    -DECLARE_CLASS(kind_template_obligation)
     DECLARE_CLASS_ALLOCATED_IN_ARRAYS(kind_constructor_casting_rule, 100)
     DECLARE_CLASS_ALLOCATED_IN_ARRAYS(kind_constructor_comparison_schema, 100)
     DECLARE_CLASS_ALLOCATED_IN_ARRAYS(kind_constructor_instance, 100)
    diff --git a/docs/kinds-module/2-kc2.html b/docs/kinds-module/2-kc2.html
    index b12b1a7bb..a701b848f 100644
    --- a/docs/kinds-module/2-kc2.html
    +++ b/docs/kinds-module/2-kc2.html
    @@ -491,10 +491,10 @@ of the kind which the constructor makes:
     package_request *Kinds::Constructors::package(kind_constructor *con) {
         if (con->kc_package == NULL) {
             if (con->defined_in_source_text) {
    -            compilation_module *C = Modules::find(con->where_defined_in_source_text);
    +            compilation_unit *C = CompilationUnits::find(con->where_defined_in_source_text);
                 con->kc_package = Hierarchy::package(C, KIND_HAP);
             } else if (con->superkind_set_at) {
    -            compilation_module *C = Modules::find(con->superkind_set_at);
    +            compilation_unit *C = CompilationUnits::find(con->superkind_set_at);
                 con->kc_package = Hierarchy::package(C, KIND_HAP);
             } else {
                 con->kc_package = Hierarchy::synoptic_package(KIND_HAP);
    diff --git a/docs/supervisor-module/5-ks.html b/docs/supervisor-module/5-ks.html
    index 06bf38b1a..2738da317 100644
    --- a/docs/supervisor-module/5-ks.html
    +++ b/docs/supervisor-module/5-ks.html
    @@ -322,7 +322,7 @@ loads the base kinds in a kit 
     #ifdef CORE_MODULE
    -void Kits::load_types(inform_kit *K) {
    +void Kits::load_built_in_kind_constructors(inform_kit *K) {
         text_stream *segment;
         LOOP_OVER_LINKED_LIST(segment, text_stream, K->kind_definitions) {
             pathname *P = Pathnames::down(K->as_copy->location_if_path, I"kinds");
    diff --git a/docs/supervisor-module/5-ps2.html b/docs/supervisor-module/5-ps2.html
    index deb86df1c..ac4201a8f 100644
    --- a/docs/supervisor-module/5-ps2.html
    +++ b/docs/supervisor-module/5-ps2.html
    @@ -526,10 +526,10 @@ reads them in for every kit which is included in the project.
     
     
     #ifdef CORE_MODULE
    -void Projects::load_types(inform_project *project) {
    +void Projects::load_built_in_kind_constructors(inform_project *project) {
         kit_dependency *kd;
         LOOP_OVER_LINKED_LIST(kd, kit_dependency, project->kits_to_include)
    -        Kits::load_types(kd->kit);
    +        Kits::load_built_in_kind_constructors(kd->kit);
     }
     #endif
     
    diff --git a/inbuild/supervisor-module/Chapter 5/Kit Services.w b/inbuild/supervisor-module/Chapter 5/Kit Services.w index f7e5ec24c..8e36da201 100644 --- a/inbuild/supervisor-module/Chapter 5/Kit Services.w +++ b/inbuild/supervisor-module/Chapter 5/Kit Services.w @@ -216,7 +216,7 @@ loads the base kinds in a kit |K|: = #ifdef CORE_MODULE -void Kits::load_types(inform_kit *K) { +void Kits::load_built_in_kind_constructors(inform_kit *K) { text_stream *segment; LOOP_OVER_LINKED_LIST(segment, text_stream, K->kind_definitions) { pathname *P = Pathnames::down(K->as_copy->location_if_path, I"kinds"); diff --git a/inbuild/supervisor-module/Chapter 5/Project Services.w b/inbuild/supervisor-module/Chapter 5/Project Services.w index dd91c46f7..be0790c65 100644 --- a/inbuild/supervisor-module/Chapter 5/Project Services.w +++ b/inbuild/supervisor-module/Chapter 5/Project Services.w @@ -408,10 +408,10 @@ reads them in for every kit which is included in the project. = #ifdef CORE_MODULE -void Projects::load_types(inform_project *project) { +void Projects::load_built_in_kind_constructors(inform_project *project) { kit_dependency *kd; LOOP_OVER_LINKED_LIST(kd, kit_dependency, project->kits_to_include) - Kits::load_types(kd->kit); + Kits::load_built_in_kind_constructors(kd->kit); } #endif diff --git a/inform7/Downloads/preform-diagnostics.txt b/inform7/Downloads/preform-diagnostics.txt index 149e1f189..57d51885c 100644 --- a/inform7/Downloads/preform-diagnostics.txt +++ b/inform7/Downloads/preform-diagnostics.txt @@ -16,7 +16,7 @@ internal nti 20 constraint (none) extremes [1, 1] - internal hits 2894/22706 nti 21 constraint (none) extremes [1, 1] + internal hits 2894/22710 nti 21 constraint (none) extremes [1, 1] internal nti 22 constraint (none) extremes [1, 1] @@ -4728,7 +4728,7 @@ twelfth constraint CS = {27} extremes [1, 1] - internal hits 200/24206 nti r0 constraint CS = {r0} extremes [1, 1] + internal hits 200/24210 nti r0 constraint CS = {r0} extremes [1, 1] internal nti r1 constraint CS = {r1} extremes [1, 1] @@ -4750,23 +4750,23 @@ {...} constraint (none) extremes [1, infinity) - hits 81340/162680 nti 13 constraint (none) extremes [1, infinity) + hits 81344/162688 nti 13 constraint (none) extremes [1, infinity) English:
    {...} - (hits 15779/46514) (matched long text) constraint (none) extremes [2, infinity) + (hits 15781/46516) (matched long text) constraint (none) extremes [2, infinity) {...} - (hits 65561/65561) (matched long text) constraint (none) extremes [1, infinity) + (hits 65563/65563) (matched long text) constraint (none) extremes [1, infinity) nti 14 constraint (none) extremes [2, infinity) English:
    {...} constraint (none) extremes [2, infinity) -
    internal hits 16202/96550 nti r2 constraint (none) extremes [1, 1] +
    internal hits 16205/96556 nti r2 constraint (none) extremes [1, 1] - internal hits 21519/254248 nti r2 constraint (none) extremes [1, 1] + internal hits 21519/254264 nti r2 constraint (none) extremes [1, 1] - internal hits 2597/41498 nti r2 constraint (none) extremes [1, 1] + internal hits 2599/41502 nti r2 constraint (none) extremes [1, 1] nti r2 constraint CS = {r2} extremes [6, 6] English: @@ -4827,7 +4827,7 @@ other than constraint CS = {28} extremes [2, 2] - hits 16/21706 nti 29 constraint DS = {29} extremes [2, infinity) + hits 16/21710 nti 29 constraint DS = {29} extremes [2, infinity) English: not {...} (hits 16/6041) (matched long text) constraint DS = {29} extremes [2, infinity) @@ -4841,7 +4841,7 @@ {...} (hits 79/79) (matched: 'dvd carried by the person asked') constraint (none) extremes [1, infinity) - hits 0/21422 nti 31 constraint DS = {31} extremes [2, infinity) + hits 0/21426 nti 31 constraint DS = {31} extremes [2, infinity) English: no one {***} (hits 0/3663) constraint DS = {31} extremes [2, infinity) @@ -5123,7 +5123,7 @@ thing/something (hits 61/61) (matched: 'thing') constraint CS = {29} extremes [1, 1] - internal hits 388/16706 nti 14 constraint (none) extremes [1, 1] + internal hits 388/16708 nti 14 constraint (none) extremes [1, 1] hits 0/6 nti 22 constraint CS = {22} extremes [1, 2] English: @@ -5292,7 +5292,7 @@ (hits 5/5) (matched: 'value of kind k') constraint (none) extremes [1, infinity) - hits 5771/102258 nti r5 constraint (none) extremes [1, infinity) + hits 5771/102278 nti r5 constraint (none) extremes [1, infinity) English: ( ) (hits 0/2032) constraint DS = {r5} & CW = {r2, r5} extremes [3, infinity) @@ -5303,7 +5303,7 @@ (hits 3626/9236) (matched: 'an ice cream cone') constraint CW = {r2, r5} extremes [1, infinity) - (hits 2/15787) (matched: 'object-based rulebook') constraint DS = {r5} extremes [2, infinity) + (hits 2/15790) (matched: 'object-based rulebook') constraint DS = {r5} extremes [2, infinity) (hits 353/5608) (matched long text) constraint CW = {r2, r5} extremes [1, infinity) @@ -5323,7 +5323,7 @@ internal hits 3626/18472 nti r5 constraint CW = {r2, r5} extremes [1, infinity) - hits 2/31574 nti r5 constraint DS = {r5} extremes [2, infinity) + hits 2/31580 nti r5 constraint DS = {r5} extremes [2, infinity) English: indexed text (hits 0/976) constraint CS = {r5} extremes [2, 2] @@ -5699,14 +5699,14 @@ hits 2306/7528 nti 6 constraint DS = {6} extremes [3, infinity) English: {......} , {......} - (hits 2306/2583) (matched long text) constraint DS = {6} extremes [3, infinity) + (hits 2306/2582) (matched long text) constraint DS = {6} extremes [3, infinity) hits 30/9858 nti 7 constraint DS = {7} extremes [2, infinity) English: instead {...} - (hits 0/2252) constraint DS = {7} extremes [2, infinity) + (hits 0/1922) constraint DS = {7} extremes [2, infinity) {...} instead - (hits 30/2252) (matched long text) constraint DS = {7} extremes [2, infinity) + (hits 30/1922) (matched long text) constraint DS = {7} extremes [2, infinity) hits 0/880 nti 8 constraint DS = {8} extremes [2, infinity) English: @@ -5967,16 +5967,16 @@ internal nti 20 constraint (none) extremes [1, 1] - hits 0/3368 nti 8 constraint DS = {8} extremes [2, infinity) + hits 0/3332 nti 8 constraint DS = {8} extremes [2, infinity) English: at (hits 0/70) constraint DS = {8, 30} extremes [3, 3] at the time when {...} - (hits 0/1570) constraint DS = {8} extremes [5, infinity) + (hits 0/1562) constraint DS = {8} extremes [5, infinity) at the time that {...} - (hits 0/1570) constraint DS = {8} extremes [5, infinity) + (hits 0/1562) constraint DS = {8} extremes [5, infinity) at {...} - (hits 0/1684) constraint DS = {8} extremes [2, infinity) + (hits 0/1666) constraint DS = {8} extremes [2, infinity) nti 21 constraint (none) extremes [1, infinity) English: @@ -6306,9 +6306,9 @@
    (hits 0/73) constraint (none) extremes [1, 1] (/)/(- {***} - (hits 0/63) constraint DS = {7} extremes [1, infinity) + (hits 0/62) constraint DS = {7} extremes [1, infinity) {***} (/)/(- - (hits 0/63) constraint DS = {7} extremes [1, infinity) + (hits 0/62) constraint DS = {7} extremes [1, infinity) {...} (/)/(- {...} (hits 0/55) constraint DS = {7} extremes [3, infinity) ni--crash--1 @@ -6318,9 +6318,9 @@ ni--crash--11 constraint CS = {7} extremes [1, 1] , {...} - (hits 0/63) constraint DS = {7} extremes [2, infinity) + (hits 0/62) constraint DS = {7} extremes [2, infinity) {...} , - (hits 0/63) constraint DS = {7} extremes [2, infinity) + (hits 0/62) constraint DS = {7} extremes [2, infinity) {...} when/while {...} (hits 0/55) constraint DS = {7} extremes [3, infinity) {***} {***} @@ -6367,7 +6367,7 @@
    (hits 0/156) constraint (none) extremes [1, 1] {***} (/)/{/}/,/./(- {***} - (hits 0/286) constraint DS = {10} extremes [1, infinity) + (hits 0/201) constraint DS = {10} extremes [1, infinity) {***} {***} (hits 0/667) constraint (none) extremes [1, infinity) @@ -6450,7 +6450,7 @@ internal hits 4/8 nti 14 constraint (none) extremes [1, infinity) - internal hits 1945/5100 nti 15 constraint (none) extremes [1, infinity) + internal hits 1945/5102 nti 15 constraint (none) extremes [1, infinity) internal hits 1272/3058 nti 16 constraint (none) extremes [1, infinity) @@ -6467,33 +6467,33 @@ internal hits 0/244 nti 20 constraint (none) extremes [1, infinity) - hits 2097/23834 nti 6 constraint (none) extremes [1, infinity) + hits 2097/23842 nti 6 constraint (none) extremes [1, infinity) English: (hits 171/171) (matched: '100') constraint CS = {r0} extremes [1, 1] minus - (hits 0/479) constraint DS = {6} extremes [2, 2] + (hits 0/478) constraint DS = {6} extremes [2, 2] ( ) (hits 273/620) (matched: '"[current item from the multiple object list]: [run paragraph on]" ( a )') constraint DS = {6} extremes [4, 4] - (hits 1564/5548) (matched: 'Represents geographical locations, both indoor + (hits 1564/5550) (matched: 'Represents geographical locations, both indoor and outdoor, which are not necessarily areas in a building. A player in one room is mostly unable to sense, or interact with, anything in a different room. Rooms are arranged in a map.') constraint (none) extremes [1, 1] - (hits 11/9909) (matched: 'plus infinity') constraint (none) extremes [1, infinity) + (hits 11/9913) (matched: 'plus infinity') constraint (none) extremes [1, infinity) (hits 78/379) (matched: 'false') constraint CS = {26} extremes [1, 1] - (hits 0/3663) constraint DS = {28} extremes [2, infinity) + (hits 0/3665) constraint DS = {28} extremes [2, infinity) unicode - (hits 0/1924) constraint DS = {6} extremes [2, infinity) + (hits 0/1923) constraint DS = {6} extremes [2, infinity) (hits 0/3211) constraint DW = {29, 30, 31} extremes [2, 5] - (hits 0/9820) constraint (none) extremes [1, infinity) + (hits 0/9824) constraint (none) extremes [1, infinity) - internal hits 0/19640 nti 21 constraint (none) extremes [1, infinity) + internal hits 0/19648 nti 21 constraint (none) extremes [1, infinity) internal hits 680/1360 nti 22 constraint (none) extremes [1, 1] @@ -6504,29 +6504,29 @@ true (hits 49/350) (matched: 'true') constraint CS = {26} extremes [1, 1] - hits 11/19818 nti 24 constraint (none) extremes [1, infinity) + hits 11/19826 nti 24 constraint (none) extremes [1, infinity) English: _pi - (hits 1/714) (matched: 'pi') constraint CS = {24} extremes [1, 1] + (hits 1/716) (matched: 'pi') constraint CS = {24} extremes [1, 1] _e - (hits 1/713) (matched: 'e') constraint CS = {24} extremes [1, 1] + (hits 1/715) (matched: 'e') constraint CS = {24} extremes [1, 1] plus infinity - (hits 4/514) (matched: 'plus infinity') constraint CS = {24} extremes [2, 2] + (hits 4/516) (matched: 'plus infinity') constraint CS = {24} extremes [2, 2] minus infinity - (hits 4/510) (matched: 'minus infinity') constraint CS = {24} extremes [2, 2] + (hits 4/512) (matched: 'minus infinity') constraint CS = {24} extremes [2, 2] - (hits 1/9899) (matched: '0.5') constraint (none) extremes [1, infinity) + (hits 1/9903) (matched: '0.5') constraint (none) extremes [1, infinity) - internal hits 1/19798 nti 23 constraint (none) extremes [1, infinity) + internal hits 1/19806 nti 23 constraint (none) extremes [1, infinity) - hits 2367/20792 nti 19 constraint (none) extremes [1, infinity) + hits 2367/20796 nti 19 constraint (none) extremes [1, infinity) English: - (hits 1797/10396) (matched: '"[current item from the multiple object list]: [run paragraph on]" ( a )') constraint (none) extremes [1, infinity) + (hits 1797/10398) (matched: '"[current item from the multiple object list]: [run paragraph on]" ( a )') constraint (none) extremes [1, infinity) nothing (hits 97/125) (matched: 'nothing') constraint CS = {19} extremes [1, 1] - (hits 446/8502) (matched: 'printing the name of a dark room') constraint (none) extremes [1, infinity) + (hits 446/8504) (matched: 'printing the name of a dark room') constraint (none) extremes [1, infinity) outcome (hits 0/2934) constraint DS = {19} extremes [2, infinity) option @@ -6536,7 +6536,7 @@ response ( ) (hits 0/754) constraint DS = {19} extremes [5, infinity) - internal hits 446/17004 nti 24 constraint (none) extremes [1, infinity) + internal hits 446/17008 nti 24 constraint (none) extremes [1, infinity) internal hits 0/244 nti 25 constraint (none) extremes [1, infinity) @@ -6571,7 +6571,7 @@ (hits 1442/13694) (matched: 'marked for listing other') constraint (none) extremes [1, infinity) - hits 1513/29618 nti 21 constraint (none) extremes [1, infinity) + hits 1513/29620 nti 21 constraint (none) extremes [1, infinity) English: not (hits 12/2602) (matched: 'not lockable') constraint DS = {21} extremes [2, infinity) @@ -6582,12 +6582,12 @@ (hits 71/7202) (matched: 'marked for listing other') constraint (none) extremes [2, infinity) - internal hits 2217/18908 nti r3 constraint CS = {r3} extremes [1, infinity) + internal hits 2218/18908 nti r3 constraint CS = {r3} extremes [1, infinity) - hits 3590/89706 nti 7 constraint (none) extremes [1, infinity) + hits 3590/89722 nti 7 constraint (none) extremes [1, infinity) English: - (hits 2593/44853) (matched: 'value of kind k') constraint (none) extremes [1, infinity) + (hits 2593/44861) (matched: 'value of kind k') constraint (none) extremes [1, infinity) (hits 997/1932) (matched: 'the alfred cralle pool hall') constraint CW = {r2, r4} extremes [1, infinity) @@ -6608,50 +6608,50 @@ (hits 768/2511) (matched: 'marked for listing other') constraint (none) extremes [1, infinity) - hits 1652/38642 nti 11 constraint (none) extremes [1, infinity) + hits 1652/38646 nti 11 constraint (none) extremes [1, infinity) English: - (hits 1392/19321) (matched long text) constraint (none) extremes [1, infinity) + (hits 1392/19323) (matched long text) constraint (none) extremes [1, infinity) (hits 260/4814) (matched long text) constraint (none) extremes [3, infinity) - hits 257/2044 nti 12 constraint (none) extremes [1, infinity) + hits 257/2048 nti 12 constraint (none) extremes [1, infinity) English: - (hits 257/1022) (matched: 'thing ( called the item being printed )') constraint (none) extremes [1, infinity) + (hits 257/1024) (matched: 'thing ( called the item being printed )') constraint (none) extremes [1, infinity) - hits 1649/40686 nti 23 constraint (none) extremes [1, infinity) + hits 1649/40694 nti 23 constraint (none) extremes [1, infinity) English: ( called ) (hits 118/1437) (matched long text) constraint DS = {23} extremes [5, infinity) - (hits 1531/20225) (matched: 'the alfred cralle pool hall') constraint (none) extremes [1, infinity) + (hits 1531/20229) (matched: 'the alfred cralle pool hall') constraint (none) extremes [1, infinity) - hits 1649/40686 nti 13 constraint (none) extremes [1, infinity) + hits 1649/40694 nti 13 constraint (none) extremes [1, infinity) English: - (hits 51/10558) (matched: 'at least two stamped envelopes') constraint (none) extremes [2, infinity) + (hits 51/10560) (matched: 'at least two stamped envelopes') constraint (none) extremes [2, infinity) - (hits 156/20292) (matched: 'something') constraint (none) extremes [1, infinity) + (hits 156/20296) (matched: 'something') constraint (none) extremes [1, infinity) - (hits 22/10507) (matched: 'something switched on') constraint (none) extremes [2, infinity) + (hits 22/10509) (matched: 'something switched on') constraint (none) extremes [2, infinity) - (hits 2/10485) (matched: 'the person') constraint (none) extremes [2, infinity) + (hits 2/10487) (matched: 'the person') constraint (none) extremes [2, infinity) ^ ^ - (hits 0/10483) constraint (none) extremes [2, infinity) + (hits 0/10485) constraint (none) extremes [2, infinity) - (hits 56/10483) (matched: 'the alfred cralle pool hall') constraint (none) extremes [2, infinity) + (hits 56/10485) (matched: 'the alfred cralle pool hall') constraint (none) extremes [2, infinity) - (hits 617/10427) (matched: 'a marked for listing person') constraint (none) extremes [2, infinity) + (hits 617/10429) (matched: 'a marked for listing person') constraint (none) extremes [2, infinity) - (hits 745/19439) (matched: 'marked for listing other people') constraint (none) extremes [1, infinity) + (hits 745/19443) (matched: 'marked for listing other people') constraint (none) extremes [1, infinity) - hits 1413/40652 nti 14 constraint (none) extremes [1, infinity) + hits 1413/40664 nti 14 constraint (none) extremes [1, infinity) English: - (hits 1029/20326) (matched: 'nancy johnson memorial square') constraint (none) extremes [1, infinity) + (hits 1029/20332) (matched: 'nancy johnson memorial square') constraint (none) extremes [1, infinity) - (hits 384/10129) (matched: 'marked for listing other people') constraint (none) extremes [2, infinity) + (hits 384/10131) (matched: 'marked for listing other people') constraint (none) extremes [2, infinity) hits 2/148 nti 15 constraint (none) extremes [1, infinity) English: @@ -6667,7 +6667,7 @@ (hits 0/1386) constraint (none) extremes [2, infinity) - internal hits 1086/31390 nti 17 constraint (none) extremes [0, 0] + internal hits 1086/31394 nti 17 constraint (none) extremes [0, 0] internal hits 4743/9700 nti 18 constraint (none) extremes [0, 0] @@ -6720,38 +6720,38 @@ {...} (hits 35/35) (matched: 'random bystander') constraint (none) extremes [1, infinity) - internal hits 79/21422 nti 23 constraint (none) extremes [1, infinity) + internal hits 79/21426 nti 23 constraint (none) extremes [1, infinity) - internal hits 336/62416 nti 24 constraint (none) extremes [1, infinity) + internal hits 336/62428 nti 24 constraint (none) extremes [1, infinity) - hits 1940/4790 nti 25 constraint (none) extremes [1, infinity) + hits 1940/4792 nti 25 constraint (none) extremes [1, infinity) English:
    - (hits 109/385) (matched long text) constraint (none) extremes [2, infinity) + (hits 109/386) (matched long text) constraint (none) extremes [2, infinity) - (hits 1831/2286) (matched long text) constraint (none) extremes [1, infinity) + (hits 1831/2287) (matched long text) constraint (none) extremes [1, infinity) - hits 3118/7704 nti 31 constraint (none) extremes [1, infinity) + hits 3118/7708 nti 31 constraint (none) extremes [1, infinity) English: variable/variables (hits 2/488) (matched: 'text variables') constraint DS = {31} extremes [2, infinity) that/which vary/varies (hits 59/321) (matched: 'action name based rule producing nothing that varies') constraint DS = {31} extremes [3, infinity) - (hits 2436/3791) (matched long text) constraint (none) extremes [1, infinity) + (hits 2436/3793) (matched long text) constraint (none) extremes [1, infinity) - (hits 221/1355) (matched: 'Represents geographical locations, both indoor + (hits 221/1357) (matched: 'Represents geographical locations, both indoor and outdoor, which are not necessarily areas in a building. A player in one room is mostly unable to sense, or interact with, anything in a different room. Rooms are arranged in a map.') constraint (none) extremes [1, infinity) - (hits 113/1134) (matched: 'for deciding whether all includes rules') constraint (none) extremes [1, infinity) + (hits 113/1136) (matched: 'for deciding whether all includes rules') constraint (none) extremes [1, infinity) - (hits 257/1021) (matched: 'thing ( called the item being printed )') constraint (none) extremes [1, infinity) + (hits 257/1023) (matched: 'thing ( called the item being printed )') constraint (none) extremes [1, infinity) - (hits 3/764) (matched: 'smelling') constraint (none) extremes [1, infinity) + (hits 3/766) (matched: 'smelling') constraint (none) extremes [1, infinity) - (hits 27/761) (matched long text) constraint (none) extremes [1, infinity) + (hits 27/763) (matched long text) constraint (none) extremes [1, infinity) hits 1252/3018 nti 26 constraint (none) extremes [1, infinity) English: @@ -6902,7 +6902,7 @@ of in (hits 2/580) (matched long text) constraint DS = {26} extremes [5, infinity) - internal hits 3/19876 nti 14 constraint (none) extremes [1, infinity) + internal hits 3/19880 nti 14 constraint (none) extremes [1, infinity) hits 1074/2238 nti 15 constraint (none) extremes [3, infinity) English: @@ -7336,7 +7336,7 @@ {...} constraint (none) extremes [1, infinity) - hits 0/7326 nti 28 constraint DS = {28} extremes [2, infinity) + hits 0/7330 nti 28 constraint DS = {28} extremes [2, infinity) English: { } (hits 0/34) constraint CS = {28} extremes [2, 2] @@ -7946,35 +7946,35 @@ definition (hits 88/88) (matched: 'definition') constraint CS = {9} extremes [1, 1] this is the {... rule} - (hits 58/1634) (matched long text) constraint DS = {9} extremes [5, infinity) + (hits 58/1626) (matched long text) constraint DS = {9} extremes [5, infinity) this is the rule constraint CS = {9} extremes [4, 4] this is {...} rule - (hits 0/1602) constraint DS = {9} extremes [4, infinity) + (hits 0/1590) constraint DS = {9} extremes [4, infinity) this is {...} rules - (hits 0/1602) constraint DS = {9} extremes [4, infinity) + (hits 0/1590) constraint DS = {9} extremes [4, infinity) - (hits 0/1684) constraint DS = {8} extremes [2, infinity) + (hits 0/1666) constraint DS = {8} extremes [2, infinity) to constraint CS = {9} extremes [1, 1] to {...} ( called {...} ) - (hits 0/1546) constraint DS = {9} extremes [6, infinity) + (hits 0/1541) constraint DS = {9} extremes [6, infinity) {to ...} ( this is the {### function} inverse to {###} ) (hits 32/1346) (matched long text) constraint DS = {9} extremes [12, infinity) {to ...} ( this is the {### function} ) (hits 8/1418) (matched long text) constraint DS = {9} extremes [9, infinity) {to ...} ( this is {...} ) - (hits 0/1478) constraint DS = {9} extremes [7, infinity) + (hits 0/1476) constraint DS = {9} extremes [7, infinity) to {...} - (hits 952/1660) (matched long text) constraint DS = {9} extremes [2, infinity) + (hits 952/1640) (matched long text) constraint DS = {9} extremes [2, infinity) {...} ( this is the {... rule} ) - (hits 562/606) (matched long text) constraint DS = {9} extremes [8, infinity) + (hits 562/605) (matched long text) constraint DS = {9} extremes [8, infinity) {...} ( this is the rule ) - (hits 0/62) constraint DS = {9} extremes [7, infinity) + (hits 0/60) constraint DS = {9} extremes [7, infinity) {...} ( this is {...} rule ) - (hits 0/62) constraint DS = {9} extremes [7, infinity) + (hits 0/60) constraint DS = {9} extremes [7, infinity) {...} ( this is {...} rules ) - (hits 0/62) constraint DS = {9} extremes [7, infinity) + (hits 0/60) constraint DS = {9} extremes [7, infinity) {...} (hits 180/180) (matched long text) constraint (none) extremes [1, infinity) @@ -9356,7 +9356,7 @@ internal hits 958/2310 nti 10 constraint (none) extremes [1, infinity) - hits 556/21216 nti 6 constraint (none) extremes [1, infinity) + hits 556/21220 nti 6 constraint (none) extremes [1, infinity) English: asking to try (hits 0/948) constraint DS = {6} extremes [5, infinity) @@ -9369,7 +9369,7 @@ trying (hits 0/1963) constraint DS = {6} extremes [2, infinity) - (hits 125/10177) (matched long text) constraint (none) extremes [1, infinity) + (hits 125/10179) (matched long text) constraint (none) extremes [1, infinity) hits 28/2746 nti 13 constraint (none) extremes [1, infinity) English: @@ -9443,16 +9443,16 @@ we have not (hits 0/952) constraint DS = {12} extremes [4, infinity) - hits 150/23094 nti 11 constraint (none) extremes [1, infinity) + hits 150/23098 nti 11 constraint (none) extremes [1, infinity) English: - (hits 85/11547) (matched long text) constraint (none) extremes [1, infinity) + (hits 85/11549) (matched long text) constraint (none) extremes [1, infinity) - (hits 65/6514) (matched long text) constraint (none) extremes [2, infinity) + (hits 65/6515) (matched long text) constraint (none) extremes [2, infinity) - internal hits 76/13028 nti 12 constraint (none) extremes [1, infinity) + internal hits 76/13030 nti 12 constraint (none) extremes [1, infinity) - internal hits 584/24114 nti 13 constraint (none) extremes [1, infinity) + internal hits 584/24118 nti 13 constraint (none) extremes [1, infinity) internal nti 14 constraint (none) extremes [1, infinity) diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt index bcb27f22c..b8cb86c6e 100644 --- a/inform7/Figures/memory-diagnostics.txt +++ b/inform7/Figures/memory-diagnostics.txt @@ -1,16 +1,16 @@ -Total memory consumption was 257267K = 251 MB +Total memory consumption was 256459K = 250 MB -62.5% was used for 1339939 objects, in 273664 frames in 201 x 800K = 160800K = 157 MB: +62.3% was used for 1331461 objects, in 273669 frames in 200 x 800K = 160000K = 156 MB: 9.8% inter_tree_node_array 36 x 8192 = 294912 objects, 25953408 bytes 5.5% text_stream_array 2579 x 100 = 257900 objects, 14524928 bytes - 3.9% parse_node 130008 objects, 10400640 bytes + 3.9% parse_node 130012 objects, 10400960 bytes 2.8% verb_conjugation 164 objects, 7610912 bytes - 2.7% parse_node_annotation_array 445 x 500 = 222500 objects, 7134240 bytes - 2.3% inter_symbol_array 70 x 1024 = 71680 objects, 6310080 bytes - 1.8% linked_list 8929 objects, 5000240 bytes + 2.6% parse_node_annotation_array 428 x 500 = 214000 objects, 6861696 bytes + 2.4% inter_symbol_array 70 x 1024 = 71680 objects, 6310080 bytes + 1.9% linked_list 8928 objects, 4999680 bytes 1.3% pcalc_prop_array 24 x 1000 = 24000 objects, 3648768 bytes - 1.1% map_data 660 objects, 3131040 bytes + 1.2% map_data 666 objects, 3159504 bytes 0.9% kind_array 65 x 1000 = 65000 objects, 2602080 bytes 0.7% inter_schema_token 13536 objects, 1949184 bytes 0.6% vocabulary_entry_array 161 x 100 = 16100 objects, 1808352 bytes @@ -19,19 +19,19 @@ Total memory consumption was 257267K = 251 MB 0.3% inter_name_array 21 x 1000 = 21000 objects, 1008672 bytes 0.3% adjective_meaning 202 objects, 1001920 bytes 0.3% excerpt_meaning 3102 objects, 967824 bytes - 0.3% inter_package 13237 objects, 953064 bytes + 0.3% inter_package 13238 objects, 953136 bytes 0.3% production 3896 objects, 903872 bytes 0.3% grammatical_usage 3658 objects, 877920 bytes 0.3% ptoken 8416 objects, 875264 bytes 0.3% individual_form 2564 objects, 861504 bytes - 0.3% inter_symbols_table 13237 objects, 847168 bytes + 0.3% inter_symbols_table 13238 objects, 847232 bytes 0.3% inter_schema_node 8716 objects, 836736 bytes 0.2% dictionary 16401 objects, 787248 bytes 0.2% dict_entry_array 234 x 100 = 23400 objects, 756288 bytes - 0.2% package_request 7952 objects, 699776 bytes + 0.2% package_request 7953 objects, 699864 bytes 0.2% inter_name_generator_array 16 x 1000 = 16000 objects, 640512 bytes 0.1% local_variable_array 46 x 100 = 4600 objects, 516672 bytes - 0.1% inference_subject 663 objects, 434928 bytes + 0.1% inference_subject 662 objects, 434272 bytes 0.1% verb_usage 1172 objects, 403168 bytes 0.1% rule 469 objects, 363944 bytes 0.1% verb_form 394 objects, 349872 bytes @@ -59,7 +59,7 @@ Total memory consumption was 257267K = 251 MB ---- inter_schema 1513 objects, 72624 bytes ---- rulebook 407 objects, 71632 bytes ---- kind_macro_definition 10 objects, 64400 bytes - ---- spatial_data 664 objects, 63744 bytes + ---- spatial_data 666 objects, 63936 bytes ---- booking 860 objects, 61920 bytes ---- grammar_verb 130 objects, 57200 bytes ---- property_permission 96 objects, 56832 bytes @@ -75,15 +75,15 @@ Total memory consumption was 257267K = 251 MB ---- production_list 615 objects, 34440 bytes ---- unary_predicate_array 8 x 1000 = 8000 objects, 32192 bytes ---- HTML_tag_array 1 x 1000 objects, 32032 bytes - ---- regions_data 660 objects, 31680 bytes + ---- regions_data 666 objects, 31968 bytes ---- property 146 objects, 31536 bytes ---- verb_sense 411 objects, 29592 bytes ---- stacked_variable_owner_array 6 x 100 = 600 objects, 28992 bytes ---- heading 198 objects, 28512 bytes - ---- counting_data 664 objects, 26560 bytes + ---- counting_data 666 objects, 26640 bytes ---- instance 167 objects, 22712 bytes ---- ap_optional_clause_array 1 x 400 objects, 22432 bytes - ---- parsing_data 664 objects, 21248 bytes + ---- parsing_data 666 objects, 21312 bytes ---- pcalc_prop_deferral 90 objects, 19440 bytes ---- nonlocal_variable 93 objects, 19344 bytes ---- action_name 90 objects, 18720 bytes @@ -93,7 +93,7 @@ Total memory consumption was 257267K = 251 MB ---- adjective_iname_holder 320 objects, 15360 bytes ---- plugin 23 objects, 13432 bytes ---- literal_text 147 objects, 12936 bytes - ---- stopwatch_timer 154 objects, 12320 bytes + ---- stopwatch_timer 152 objects, 12160 bytes ---- understanding_reference_array 2 x 100 = 200 objects, 11264 bytes ---- pathname 265 objects, 10600 bytes ---- adjective 137 objects, 9864 bytes @@ -118,22 +118,22 @@ Total memory consumption was 257267K = 251 MB ---- inbuild_edition 54 objects, 3888 bytes ---- inbuild_copy 35 objects, 3640 bytes ---- command_line_switch 42 objects, 3360 bytes - ---- instance_usage_array 1 x 200 objects, 3232 bytes ---- kind_constructor_comparison_schema_array 1 x 100 objects, 3232 bytes - ---- compatibility_specification 66 objects, 3168 bytes + ---- instance_usage_array 1 x 200 objects, 3232 bytes ---- definition 44 objects, 3168 bytes + ---- compatibility_specification 66 objects, 3168 bytes ---- inform_extension 19 objects, 3040 bytes ---- property_of_value_storage 93 objects, 2976 bytes - ---- submodule_request 71 objects, 2840 bytes + ---- submodule_request 72 objects, 2880 bytes ---- inter_construct 32 objects, 2560 bytes ---- kind_constructor_casting_rule_array 1 x 100 objects, 2432 bytes ---- equation_symbol 30 objects, 2400 bytes ---- semver_range 22 objects, 2288 bytes ---- method_set 56 objects, 1792 bytes ---- pronoun_usage 42 objects, 1680 bytes + ---- table_contribution_array 1 x 100 objects, 1632 bytes ---- activity_crossref_array 1 x 100 objects, 1632 bytes ---- plugin_call_array 1 x 100 objects, 1632 bytes - ---- table_contribution_array 1 x 100 objects, 1632 bytes ---- use_option 29 objects, 1624 bytes ---- kind_interaction 39 objects, 1560 bytes ---- inter_annotation_form 37 objects, 1480 bytes @@ -161,72 +161,72 @@ Total memory consumption was 257267K = 251 MB ---- implication 13 objects, 728 bytes ---- rulebook_outcome 17 objects, 680 bytes ---- inform_language 6 objects, 672 bytes - ---- I6T_intervention 8 objects, 640 bytes - ---- inter_warehouse_room 10 objects, 640 bytes ---- relation_guard 5 objects, 640 bytes + ---- inter_warehouse_room 10 objects, 640 bytes + ---- I6T_intervention 8 objects, 640 bytes ---- nascent_array 7 objects, 616 bytes ---- named_rulebook_outcome 15 objects, 600 bytes ---- inbuild_search_result 15 objects, 600 bytes ---- label_namespace 10 objects, 560 bytes ---- small_word_set 11 objects, 528 bytes ---- inform_kit 5 objects, 520 bytes - ---- equation 4 objects, 416 bytes ---- i6_memory_setting 13 objects, 416 bytes - ---- module_package 10 objects, 400 bytes + ---- equation 4 objects, 416 bytes ---- dval_written 10 objects, 400 bytes + ---- module_package 10 objects, 400 bytes ---- article_usage 8 objects, 384 bytes ---- source_file 5 objects, 360 bytes ---- inbuild_genre 7 objects, 336 bytes ---- door_dir_notice 5 objects, 320 bytes - ---- grammatical_category 8 objects, 320 bytes ---- pronoun 8 objects, 320 bytes + ---- grammatical_category 8 objects, 320 bytes ---- build_step 4 objects, 288 bytes ---- door_to_notice 5 objects, 280 bytes ---- inform_pipeline 4 objects, 256 bytes ---- verb_usage_tier 5 objects, 240 bytes ---- test_scenario 1 object, 208 bytes - ---- compilation_module 5 objects, 200 bytes + ---- compilation_unit 5 objects, 200 bytes ---- build_skill 5 objects, 200 bytes - ---- plural_dictionary_entry 4 objects, 192 bytes ---- kit_dependency 4 objects, 192 bytes + ---- plural_dictionary_entry 4 objects, 192 bytes ---- inform_project 1 object, 176 bytes - ---- code_generation_target 4 objects, 160 bytes - ---- pointer_allocation 2 objects, 160 bytes - ---- link_instruction 4 objects, 160 bytes ---- inter_architecture 4 objects, 160 bytes + ---- link_instruction 4 objects, 160 bytes + ---- pointer_allocation 2 objects, 160 bytes + ---- code_generation_target 4 objects, 160 bytes ---- codegen_pipeline 1 object, 128 bytes ---- element_activation 4 objects, 128 bytes ---- inbuild_nest 3 objects, 120 bytes ---- inform_kit_ittt 2 objects, 96 bytes ---- article 2 objects, 80 bytes - ---- list_together_routine 2 objects, 80 bytes ---- compile_task_data 1 object, 80 bytes + ---- list_together_routine 2 objects, 80 bytes ---- inter_warehouse 1 object, 56 bytes ---- build_methodology 1 object, 56 bytes ---- blorb_figure 1 object, 48 bytes ---- HTML_file_state 1 object, 48 bytes ---- kind_template_definition 1 object, 40 bytes - ---- loop_over_scope 1 object, 40 bytes ---- parse_name_notice 1 object, 40 bytes + ---- loop_over_scope 1 object, 40 bytes -37.4% was used for memory not allocated for objects: +37.6% was used for memory not allocated for objects: - 15.9% text stream storage 41937428 bytes in 264287 claims - 3.5% dictionary storage 9293824 bytes in 16401 claims - ---- sorting 1096 bytes in 3 claims + 15.9% text stream storage 41935164 bytes in 264253 claims + 3.5% dictionary storage 9293312 bytes in 16401 claims + ---- sorting 1080 bytes in 3 claims 2.7% source text 7200000 bytes in 3 claims - 4.0% source text details 10800000 bytes in 2 claims + 4.1% source text details 10800000 bytes in 2 claims ---- linguistic stock array 81920 bytes in 2 claims ---- small word set array 105600 bytes in 22 claims - 0.8% inter symbols storage 2283584 bytes in 13951 claims + 0.8% inter symbols storage 2283712 bytes in 13952 claims 6.3% inter bytecode storage 16802820 bytes in 14 claims 3.3% inter links storage 8750208 bytes in 246 claims - 0.5% instance-of-kind counting 1464100 bytes in 1 claim + 0.5% instance-of-kind counting 1459264 bytes in 1 claim ---- lists for type-checking invocations 16000 bytes in 1 claim ---- size estimates for compiled objects 300 bytes in 1 claim - ---- compilation workspace for objects 21776 bytes in 25 claims + ---- compilation workspace for objects 21736 bytes in 25 claims ---- emitter array storage 14368 bytes in 8 claims ---- code generation workspace for objects 9200 bytes in 9 claims -20.1% was overhead - 53028840 bytes = 51785K = 50 MB +19.9% was overhead - 52453888 bytes = 51224K = 50 MB diff --git a/inform7/Figures/preform-summary.txt b/inform7/Figures/preform-summary.txt index 8d2423fce..780ee3132 100644 --- a/inform7/Figures/preform-summary.txt +++ b/inform7/Figures/preform-summary.txt @@ -1,25 +1,25 @@ - hits 2097/23834 nti 6 constraint (none) extremes [1, infinity) + hits 2097/23842 nti 6 constraint (none) extremes [1, infinity) English: (@1)=1 (hits 171/171) (matched: '100') constraint CS = {r0} extremes [1, 1] (@1)minus (@2)=1 - (hits 0/479) constraint DS = {6} extremes [2, 2] + (hits 0/478) constraint DS = {6} extremes [2, 2] (@1)=1 (@2)( (@3)=2 (@4)) (hits 273/620) (matched: '"[current item from the multiple object list]: [run paragraph on]" ( a )') constraint DS = {6} extremes [4, 4] (@1)=1 - (hits 1564/5548) (matched: 'Represents geographical locations, both indoor + (hits 1564/5550) (matched: 'Represents geographical locations, both indoor and outdoor, which are not necessarily areas in a building. A player in one room is mostly unable to sense, or interact with, anything in a different room. Rooms are arranged in a map.') constraint (none) extremes [1, 1] =1 - (hits 11/9909) (matched: 'plus infinity') constraint (none) extremes [1, infinity) + (hits 11/9913) (matched: 'plus infinity') constraint (none) extremes [1, infinity) (@1)=1 (hits 78/379) (matched: 'false') constraint CS = {26} extremes [1, 1] =1 - (hits 0/3663) constraint DS = {28} extremes [2, infinity) + (hits 0/3665) constraint DS = {28} extremes [2, infinity) (@1)unicode =1 - (hits 0/1924) constraint DS = {6} extremes [2, infinity) + (hits 0/1923) constraint DS = {6} extremes [2, infinity) =1 (hits 0/3211) constraint DW = {29, 30, 31} extremes [2, 5] =1 - (hits 0/9820) constraint (none) extremes [1, infinity) + (hits 0/9824) constraint (none) extremes [1, infinity) diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt index 5b25f5410..ff5fae771 100644 --- a/inform7/Figures/timings-diagnostics.txt +++ b/inform7/Figures/timings-diagnostics.txt @@ -1,13 +1,13 @@ 100.0% in inform7 run - 67.0% in compilation to Inter - 26.2% in //Phrases::Manager::compile_first_block// - 9.3% in //Phrases::Manager::compile_as_needed// - 6.8% in //Strings::compile_responses// - 5.9% in //World::Compile::compile// - 3.2% in //Assertions::Traverse::traverse1// - 3.0% in //Classifying::traverse// - 2.1% in //Phrases::Manager::RulePrintingRule_routine// - 1.9% in //Phrases::Manager::rulebooks_array// + 66.2% in compilation to Inter + 25.8% in //Phrases::Manager::compile_first_block// + 9.1% in //Phrases::Manager::compile_as_needed// + 6.9% in //Strings::compile_responses// + 5.8% in //World::Compile::compile// + 3.1% in //Assertions::Traverse::traverse1// + 3.1% in //Classifying::traverse// + 2.0% in //Phrases::Manager::RulePrintingRule_routine// + 1.8% in //Phrases::Manager::rulebooks_array// 0.9% in //NewVerbs::ConjugateVerb// 0.7% in //Phrases::Manager::traverse// 0.5% in //Phrases::Manager::parse_rule_parameters// @@ -16,14 +16,14 @@ 0.3% in //Relations::compile_defined_relations// 0.1% in //Assertions::Traverse::traverse2// 0.1% in //PL::Parsing::Verbs::compile_all// - 0.1% in //Sentences::RuleSubtrees::register_recently_lexed_phrases// - 0.1% in //Task::load_types// + 0.1% in //RuleSubtrees::register_recently_lexed_phrases// + 0.1% in //Task::make_built_in_kind_constructors// 0.1% in //World::complete// 3.8% not specifically accounted for - 30.8% in running Inter pipeline - 10.1% in step preparation - 9.7% in inter step 2/12: link - 7.2% in inter step 12/12: generate inform6 -> auto.inf + 31.5% in running Inter pipeline + 10.3% in step preparation + 9.9% in inter step 2/12: link + 7.5% in inter step 12/12: generate inform6 -> auto.inf 0.3% in inter step 9/12: make-identifiers-unique 0.1% in inter step 10/12: reconcile-verbs 0.1% in inter step 11/12: eliminate-redundant-labels @@ -31,5 +31,6 @@ 0.1% in inter step 6/12: assimilate 0.1% in inter step 7/12: resolve-external-symbols 0.1% in inter step 8/12: inspect-plugs - 2.1% not specifically accounted for - 2.1% in supervisor + 2.3% not specifically accounted for + 2.0% in supervisor + 0.2% not specifically accounted for diff --git a/inform7/core-module/Chapter 1/Core Module.w b/inform7/core-module/Chapter 1/Core Module.w index 796d240bc..05eea4e0a 100644 --- a/inform7/core-module/Chapter 1/Core Module.w +++ b/inform7/core-module/Chapter 1/Core Module.w @@ -461,7 +461,6 @@ tree; though it's a little like itemising the baubles on a Christmas tree. @e rule_placement_sense_ANNOT /* |int|: are we listing a rule into something, or out of it? */ @e lpe_options_ANNOT /* |int|: options set for a literal pattern part */ @e modal_verb_ANNOT /* |verb_conjugation|: relevant only for that: e.g., "might" */ -@e module_ANNOT /* |compilation_module|: set only for headings, routines and sentences */ @e multiplicity_ANNOT /* |int|: e.g., 5 for "five gold rings" */ @e negated_boolean_ANNOT /* int: set if adjective/verb meant negatively */ @e new_relation_here_ANNOT /* |binary_predicate|: new relation as subject of "relates" sentence */ @@ -499,6 +498,7 @@ tree; though it's a little like itemising the baubles on a Christmas tree. @e token_check_to_do_ANNOT /* |parse_node|: what if anything is returned */ @e token_to_be_parsed_against_ANNOT /* |parse_node|: what if anything is returned */ @e turned_already_ANNOT /* |int|: aliasing like "player" to "yourself" performed already */ +@e unit_ANNOT /* |compilation_unit|: set only for headings, routines and sentences */ @e unproven_ANNOT /* |int|: this invocation needs run-time typechecking */ @e verb_problem_issued_ANNOT /* |int|: has a problem message about the primary verb been issued already? */ @e vu_ANNOT /* |verb_usage|: for e.g. "does not carry" */ @@ -540,7 +540,6 @@ DECLARE_ANNOTATION_FUNCTIONS(kind_resulting, kind) DECLARE_ANNOTATION_FUNCTIONS(kind_variable_declarations, kind_variable_declaration) DECLARE_ANNOTATION_FUNCTIONS(explicit_iname, inter_name) DECLARE_ANNOTATION_FUNCTIONS(modal_verb, verb_conjugation) -DECLARE_ANNOTATION_FUNCTIONS(module, compilation_module) DECLARE_ANNOTATION_FUNCTIONS(new_relation_here, binary_predicate) DECLARE_ANNOTATION_FUNCTIONS(phrase_invoked, phrase) DECLARE_ANNOTATION_FUNCTIONS(phrase_options_invoked, invocation_options) @@ -555,6 +554,7 @@ DECLARE_ANNOTATION_FUNCTIONS(tense_marker, grammatical_usage) DECLARE_ANNOTATION_FUNCTIONS(token_as_parsed, parse_node) DECLARE_ANNOTATION_FUNCTIONS(token_check_to_do, parse_node) DECLARE_ANNOTATION_FUNCTIONS(token_to_be_parsed_against, parse_node) +DECLARE_ANNOTATION_FUNCTIONS(unit, compilation_unit) DECLARE_ANNOTATION_FUNCTIONS(vu, verb_usage) @ So we itemise the pointer-valued annotations below, and the macro expands diff --git a/inform7/core-module/Chapter 1/How To Compile.w b/inform7/core-module/Chapter 1/How To Compile.w index db4381f73..6c3a1a03e 100644 --- a/inform7/core-module/Chapter 1/How To Compile.w +++ b/inform7/core-module/Chapter 1/How To Compile.w @@ -11,11 +11,9 @@ on to the next. 150 is a great many, so we group the stages into 16 departments, which are, in order of when they work: -@e STARTED_CSEQ from 0 -@e SEMANTIC_LANGUAGE_CSEQ -@e SEMANTIC_I_CSEQ -@e SEMANTIC_II_CSEQ -@e SEMANTIC_III_CSEQ +@e SUBDIVIDING_CSEQ from 0 +@e BUILT_IN_STUFF_CSEQ +@e SEMANTIC_ANALYSIS_CSEQ @e ASSERTIONS_PASS_1_CSEQ @e ASSERTIONS_PASS_2_CSEQ @e MODEL_CSEQ @@ -35,19 +33,14 @@ with building that grammar are skipped unless the relevant language element is active. = -int compiler_booted_up = FALSE; - int Sequence::carry_out(int debugging) { stopwatch_timer *sequence_timer = Time::start_stopwatch(inform7_timer, I"compilation to Inter"); - Task::advance_stage_to(STARTED_CSEQ, I"Starting", -1); - if (compiler_booted_up == FALSE) { - @; - compiler_booted_up = TRUE; - } - @; - @; + @; + @; + @; + @; @; @; @; @@ -115,45 +108,53 @@ as possible. commentary. For what they do, see the relevant sections. Note that although most of these worker functions are in the |core| module, some are not. -@ = +Before anything else can be done, we must create an empty Inter hierarchy +into which we will "emit" an Inter program. No actual code will be emitted for +some time yet, but identifier names and type declarations need somewhere to go. +We then break the source into "compilation units" -- basically, one for the +main source text and one for each extension -- because the Inter hierarchy +will divide according to these units. + +@ = + Task::advance_stage_to(SUBDIVIDING_CSEQ, I"Dividing source into compilation units", -1); BENCH(Emit::begin); - BENCH(InferenceSubjects::begin); - BENCH(Index::DocReferences::read_xrefs); - -@ = - Task::advance_stage_to(SEMANTIC_LANGUAGE_CSEQ, I"Semantic analysis Ia", -1); - BENCH(Plugins::Manage::start_plugins); - BENCH(Task::load_types); - BENCH(BinaryPredicates::make_built_in) - - Task::advance_stage_to(SEMANTIC_I_CSEQ, I"Semantic analysis Ib", -1); - BENCH(BootVerbs::bootstrap) - BENCH(Classifying::traverse) - BENCH(Sentences::RuleSubtrees::register_recently_lexed_phrases) - BENCH(ParseTreeUsage::verify) - - Task::advance_stage_to(SEMANTIC_II_CSEQ, I"Semantic analysis II", -1); BENCH(Sentences::Headings::make_the_tree) BENCH(Sentences::Headings::write_as_xml) - BENCH(Modules::traverse_to_define) + BENCH(CompilationUnits::determine) - Task::advance_stage_to(SEMANTIC_III_CSEQ, I"Semantic analysis III", -1); +@ Most of the conceptual infrastructure in Inform is created by Inform source +text in the Basic Inform or Standard Rules extensions, but not basic kinds of +value such as "number", or the verb "to mean", or the meaning relation, and +so on. Those absolute basics are made here. + +@ = + Task::advance_stage_to(BUILT_IN_STUFF_CSEQ, I"Making built in infrastructure", -1); + BENCH(InferenceSubjects::make_built_in); + BENCH(Task::make_built_in_kind_constructors); + BENCH(BinaryPredicates::make_built_in) + BENCH(BootVerbs::make_built_in) + +@ = + Task::advance_stage_to(SEMANTIC_ANALYSIS_CSEQ, I"Semantic analysis", -1); + BENCH(RuleSubtrees::register_recently_lexed_phrases) BENCH(Phrases::Adjectives::traverse) BENCH(Equations::traverse_to_create) BENCH(Tables::traverse_to_create) BENCH(Phrases::Manager::traverse_for_names) -@ = +@ = + BENCH(Classifying::traverse) Task::advance_stage_to(ASSERTIONS_PASS_1_CSEQ, I"First pass through assertions", 2); BENCH(Assertions::Traverse::traverse1) BENCH(Tables::traverse_to_stock) Task::advance_stage_to(ASSERTIONS_PASS_2_CSEQ, I"Second pass through assertions", -1); BENCH(Assertions::Traverse::traverse2) BENCH(Kinds::RunTime::kind_declarations) + BENCH(UseOptions::compile) + BENCH(ParseTreeUsage::verify) @ = Task::advance_stage_to(MODEL_CSEQ, I"Making the model world", -1); - BENCH(UseOptions::compile) BENCH(Properties::emit) BENCH(Properties::Emit::allocate_attributes) BENCH(PL::Actions::name_all) diff --git a/inform7/core-module/Chapter 1/What To Compile.w b/inform7/core-module/Chapter 1/What To Compile.w index b504f3534..bce706dfc 100644 --- a/inform7/core-module/Chapter 1/What To Compile.w +++ b/inform7/core-module/Chapter 1/What To Compile.w @@ -29,7 +29,7 @@ typedef struct compile_task_data { @ An early and perhaps arguable design decision for inform7 was that it would compile just one source text in its lifetime as a process: and because of that, |Task::carry_out| can only in fact be called once, and Inbuild only does so -once. But the following routine allows in principle for multiple calls, +once. But the following function allows in principle for multiple calls, against the day when we change our minds about all this. Something we will never do is attempt to make |inform7| thread-safe in the @@ -48,7 +48,9 @@ int Task::carry_out(build_step *S) { if (project == NULL) internal_error("no project"); latest_syntax_tree = project->syntax_tree; + Index::DocReferences::read_xrefs(); Task::issue_problems_arising(project->as_copy->vertex); + Plugins::Manage::start_plugins(); if (problem_count > 0) return FALSE; @@ -178,9 +180,9 @@ int Task::rng_seed(void) { referring something back up to Inbuild. = -void Task::load_types(void) { +void Task::make_built_in_kind_constructors(void) { if (inform7_task == NULL) internal_error("there is no current task"); - Projects::load_types(inform7_task->project); + Projects::load_built_in_kind_constructors(inform7_task->project); } int Task::begin_execution_at_to_begin(void) { diff --git a/inform7/core-module/Chapter 15/Measurement Adjectives.w b/inform7/core-module/Chapter 15/Measurement Adjectives.w index 041e5ef3f..2eb402217 100644 --- a/inform7/core-module/Chapter 15/Measurement Adjectives.w +++ b/inform7/core-module/Chapter 15/Measurement Adjectives.w @@ -328,7 +328,7 @@ can't normally be unravelled at compile time. mdef->superlative = EMPTY_WORDING; /* but it may be set below */ mdef->headword_as_adjective = NULL; /* but it will certainly be set below */ - package_request *P = Hierarchy::package(Modules::current(), ADJECTIVE_MEANINGS_HAP); + package_request *P = Hierarchy::package(CompilationUnits::current(), ADJECTIVE_MEANINGS_HAP); mdef->mdef_iname = Hierarchy::make_iname_in(MEASUREMENT_FN_HL, P); @ = @@ -336,7 +336,7 @@ can't normally be unravelled at compile time. Grading::make_superlative(mdef->headword, Task::language_of_syntax()); @; @; - Sentences::RuleSubtrees::register_recently_lexed_phrases(); + RuleSubtrees::register_recently_lexed_phrases(); @ = TEMPORARY_TEXT(TEMP) diff --git a/inform7/core-module/Chapter 15/Properties.w b/inform7/core-module/Chapter 15/Properties.w index 22bf31a66..021ee7c09 100644 --- a/inform7/core-module/Chapter 15/Properties.w +++ b/inform7/core-module/Chapter 15/Properties.w @@ -26,7 +26,7 @@ a value with the owner; it isn't that either/or properties are unloved.) typedef struct property { struct wording name; /* name of property */ int ambiguous_name; /* does this look like a property test, e.g., "point of view"? */ - struct compilation_module *owning_module; /* where defined */ + struct compilation_unit *owning_module; /* where defined */ /* the basic nature of this property */ int either_or; /* is this an either/or property? if not, it is a valued one */ @@ -193,7 +193,7 @@ something. @ = prn->name = W; - prn->owning_module = Modules::find(current_sentence); + prn->owning_module = CompilationUnits::find(current_sentence); prn->ambiguous_name = (W); prn->applicable_to = NULL; prn->either_or = FALSE; diff --git a/inform7/core-module/Chapter 16/Inference Subjects.w b/inform7/core-module/Chapter 16/Inference Subjects.w index c97ac00d9..7490387df 100644 --- a/inform7/core-module/Chapter 16/Inference Subjects.w +++ b/inform7/core-module/Chapter 16/Inference Subjects.w @@ -127,11 +127,12 @@ At the start of Inform's run, the subject tree consists only of the following. = -void InferenceSubjects::begin(void) { +void InferenceSubjects::make_built_in(void) { model_world = InferenceSubjects::new_fundamental(NULL, "model-world"); nonlocal_variables = InferenceSubjects::new_fundamental(model_world, "global-variables"); global_constants = InferenceSubjects::new_fundamental(model_world, "global-constants"); relations = InferenceSubjects::new_fundamental(model_world, "relations"); + Plugins::Call::create_inference_subjects(); } inference_subject *InferenceSubjects::new_fundamental(inference_subject *from, char *lname) { diff --git a/inform7/core-module/Chapter 17/Text Substitutions.w b/inform7/core-module/Chapter 17/Text Substitutions.w index c5b54e945..563bd6136 100644 --- a/inform7/core-module/Chapter 17/Text Substitutions.w +++ b/inform7/core-module/Chapter 17/Text Substitutions.w @@ -27,7 +27,7 @@ typedef struct text_substitution { struct inter_name *ts_iname; /* the I6 array for this */ struct inter_name *ts_routine_iname; /* the routine to implement it */ int ts_sb_needed; /* reference copy of small block needed as a constant? */ - struct compilation_module *belongs_to_module; + struct compilation_unit *belongs_to_module; CLASS_DEFINITION } text_substitution; @@ -83,7 +83,7 @@ text_substitution *Strings::TextSubstitutions::new_text_substitution(wording W, package_request *PR = Hierarchy::package_within(LITERALS_HAP, P); ts->ts_iname = Hierarchy::make_iname_in(TEXT_SUBSTITUTION_HL, PR); ts->ts_routine_iname = Hierarchy::make_iname_in(TEXT_SUBSTITUTION_FN_HL, PR); - ts->belongs_to_module = Modules::current(); + ts->belongs_to_module = CompilationUnits::current(); LOGIF(TEXT_SUBSTITUTIONS, "Requesting text routine %d %08x %W %08x\n", ts->allocation_id, (int) phsf, W, R); return ts; @@ -327,20 +327,20 @@ a request for a new text substitution to be compiled later... } parse_node *ts_code_block = Node::new(RULE_NT); - Node::set_module(ts_code_block, ts->belongs_to_module); - compilation_module *cm = Modules::current(); - Modules::set_current_to(ts->belongs_to_module); + Node::set_unit(ts_code_block, ts->belongs_to_module); + compilation_unit *cm = CompilationUnits::current(); + CompilationUnits::set_current_to(ts->belongs_to_module); ts_code_block->down = Node::new(INVOCATION_LIST_NT); Node::set_text(ts_code_block->down, ts->unsubstituted_text); Annotations::write_int(ts_code_block->down, from_text_substitution_ANNOT, TRUE); - Sentences::RuleSubtrees::parse_routine_structure(ts_code_block); + RuleSubtrees::parse_routine_structure(ts_code_block); Routines::Compile::code_block_outer(0, ts_code_block->down); Produce::rtrue(Emit::tree()); END_COMPILATION_MODE; - Modules::set_current_to(cm); + CompilationUnits::set_current_to(cm); @ See the "Responses" section for why, but we sometimes want to force the coroutine to go through the whole queue once, then go back to the diff --git a/inform7/core-module/Chapter 19/Tables.w b/inform7/core-module/Chapter 19/Tables.w index 86586cd7f..9be417b66 100644 --- a/inform7/core-module/Chapter 19/Tables.w +++ b/inform7/core-module/Chapter 19/Tables.w @@ -141,7 +141,7 @@ table *Tables::new_table_structure(parse_node *PN) { t->preserve_row_order_at_run_time = FALSE; t->amendment_of = NULL; t->has_been_amended = FALSE; - t->table_package = Hierarchy::package(Modules::find(PN), TABLES_HAP); + t->table_package = Hierarchy::package(CompilationUnits::find(PN), TABLES_HAP); t->table_identifier = Hierarchy::make_iname_in(TABLE_DATA_HL, t->table_package); t->approximate_array_space_needed = 0; t->disable_block_constant_correction = FALSE; diff --git a/inform7/core-module/Chapter 21/Rules.w b/inform7/core-module/Chapter 21/Rules.w index e3e8ee60f..30977d29b 100644 --- a/inform7/core-module/Chapter 21/Rules.w +++ b/inform7/core-module/Chapter 21/Rules.w @@ -960,15 +960,6 @@ ph_stack_frame *Rules::stack_frame(rule *R) { return &(R->defn_as_phrase->stack_frame); } -int Rules::portable(rule *R) { - if ((R) && (Wordings::nonempty(R->name)) && - (R->first_applicability_condition == NULL) && - (R->rule_extern_iname == NULL) && - (Modules::find(R->defn_as_phrase->declaration_node) == Modules::SR())) - return TRUE; - return FALSE; -} - package_request *Rules::package(rule *R) { return R->rule_package; } diff --git a/inform7/core-module/Chapter 22/Phrases.w b/inform7/core-module/Chapter 22/Phrases.w index fe361103f..f5fc8d6c9 100644 --- a/inform7/core-module/Chapter 22/Phrases.w +++ b/inform7/core-module/Chapter 22/Phrases.w @@ -50,7 +50,7 @@ typedef struct phrase { int inter_defn_converted; /* has this been tried yet? */ int inline_mor; /* manner of return for inline I6 definition, or |UNKNOWN_NT| */ struct wording ph_documentation_symbol; /* cross-reference with documentation */ - struct compilation_module *owning_module; + struct compilation_unit *owning_module; struct package_request *requests_package; struct package_request *rule_package; @@ -229,7 +229,7 @@ of it: new_ph->ph_iname = NULL; new_ph->to_begin = FALSE; new_ph->imported = FALSE; - new_ph->owning_module = Modules::find(current_sentence); + new_ph->owning_module = CompilationUnits::find(current_sentence); new_ph->requests_package = NULL; if (inline_wn >= 0) { new_ph->at_least_one_compiled_form_needed = FALSE; diff --git a/inform7/core-module/Chapter 22/To Phrases.w b/inform7/core-module/Chapter 22/To Phrases.w index 45adfe07d..6a2321ff7 100644 --- a/inform7/core-module/Chapter 22/To Phrases.w +++ b/inform7/core-module/Chapter 22/To Phrases.w @@ -168,8 +168,8 @@ to_phrase_request *Routines::ToPhrases::make_request(phrase *ph, kind *K, req = CREATE(to_phrase_request); req->requested_exact_kind = K; req->requested_phrase = ph; - compilation_module *cm = Modules::current(); - if (ph->declaration_node) cm = Modules::find(ph->declaration_node); + compilation_unit *cm = CompilationUnits::current(); + if (ph->declaration_node) cm = CompilationUnits::find(ph->declaration_node); package_request *P = Hierarchy::package_within(REQUESTS_HAP, ph->requests_package); req->req_iname = Hierarchy::make_localised_iname_in(PHRASE_FN_HL, P, cm); diff --git a/inform7/core-module/Chapter 23/Adjectival Definitions.w b/inform7/core-module/Chapter 23/Adjectival Definitions.w index 5b74b67d8..c15e64b36 100644 --- a/inform7/core-module/Chapter 23/Adjectival Definitions.w +++ b/inform7/core-module/Chapter 23/Adjectival Definitions.w @@ -104,8 +104,8 @@ void Phrases::Adjectives::traverse(void) { void Phrases::Adjectives::look_for_headers(parse_node *p) { if (Node::get_type(p) == RULE_NT) if ((Node::get_text(p))) { - compilation_module *cm = Modules::current(); - Modules::set_current(p); + compilation_unit *cm = CompilationUnits::current(); + CompilationUnits::set_current(p); parse_node *q = (p->down)?(p->down->down):NULL; if (q == NULL) @; @@ -122,7 +122,7 @@ void Phrases::Adjectives::look_for_headers(parse_node *p) { if (the_format != DEFINED_PHRASALLY) p->down = NULL; - Modules::set_current_to(cm); + CompilationUnits::set_current_to(cm); } } diff --git a/inform7/core-module/Chapter 25/Compile Phrases.w b/inform7/core-module/Chapter 25/Compile Phrases.w index 8863077c1..3e25f5cee 100644 --- a/inform7/core-module/Chapter 25/Compile Phrases.w +++ b/inform7/core-module/Chapter 25/Compile Phrases.w @@ -35,7 +35,7 @@ void Routines::Compile::routine(phrase *ph, internal_error("tried to compile phrase with bad ROUTINE node"); LOGIF(PHRASE_COMPILATION, "Compiling phrase:\n$T", ph->declaration_node); - Modules::set_current(ph->declaration_node); + CompilationUnits::set_current(ph->declaration_node); phrase_being_compiled = ph; @; @@ -49,7 +49,7 @@ void Routines::Compile::routine(phrase *ph, phrase_being_compiled = NULL; current_sentence = NULL; - Modules::set_current(NULL); + CompilationUnits::set_current(NULL); } @ = diff --git a/inform7/core-module/Chapter 26/Jump Labels.w b/inform7/core-module/Chapter 26/Jump Labels.w index 8ed716c2f..ebdf3fc64 100644 --- a/inform7/core-module/Chapter 26/Jump Labels.w +++ b/inform7/core-module/Chapter 26/Jump Labels.w @@ -26,7 +26,7 @@ typedef struct label_namespace { int label_counter; /* next free ID number for this label namespace */ int allocate_storage; /* number of words of memory to reserve for each label */ struct inter_name *label_storage_iname; - struct compilation_module *module; + struct compilation_unit *module; CLASS_DEFINITION } label_namespace; @@ -34,7 +34,7 @@ typedef struct label_namespace { reserves no memory. = -label_namespace *JumpLabels::new_namespace(text_stream *name, compilation_module *cm) { +label_namespace *JumpLabels::new_namespace(text_stream *name, compilation_unit *cm) { if (Str::len(name) > MAX_NAMESPACE_PREFIX_LENGTH) { #ifdef CORE_MODULE StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_LabelNamespaceTooLong), @@ -62,7 +62,7 @@ few namespaces and it happens fairly seldom, so there is no point in optimising. = -label_namespace *JumpLabels::namespace_by_prefix(text_stream *name, compilation_module *cm) { +label_namespace *JumpLabels::namespace_by_prefix(text_stream *name, compilation_unit *cm) { label_namespace *lns; LOOP_OVER(lns, label_namespace) if ((lns->module == cm) && (Str::eq(name, lns->label_prefix))) @@ -71,7 +71,7 @@ label_namespace *JumpLabels::namespace_by_prefix(text_stream *name, compilation_ } label_namespace *JumpLabels::read_or_create_namespace(text_stream *name) { - compilation_module *cm = Modules::current(); + compilation_unit *cm = CompilationUnits::current(); label_namespace *lns = JumpLabels::namespace_by_prefix(name, cm); if (lns == NULL) lns = JumpLabels::new_namespace(name, cm); return lns; diff --git a/inform7/core-module/Chapter 26/Plugin Calls.w b/inform7/core-module/Chapter 26/Plugin Calls.w index f86201f4b..0880808c5 100644 --- a/inform7/core-module/Chapter 26/Plugin Calls.w +++ b/inform7/core-module/Chapter 26/Plugin Calls.w @@ -40,6 +40,7 @@ To place calls to the plugins. @d PLUGIN_ADD_TO_WORLD_INDEX 40 @d PLUGIN_ANNOTATE_IN_WORLD_INDEX 41 @d PLUGIN_SET_SUBKIND_NOTIFY 42 +@d PLUGIN_CREATE_INFERENCES 43 @ @@ -241,3 +242,7 @@ int Plugins::Call::add_to_World_index(OUTPUT_STREAM, instance *O) { int Plugins::Call::annotate_in_World_index(OUTPUT_STREAM, instance *O) { PLUGINS_CALL(PLUGIN_ANNOTATE_IN_WORLD_INDEX, OUT, O); } + +int Plugins::Call::create_inference_subjects(void) { + PLUGINS_CALLV(PLUGIN_CREATE_INFERENCES); +} diff --git a/inform7/core-module/Chapter 27/Compilation Modules.w b/inform7/core-module/Chapter 27/Compilation Modules.w index 923a26d1a..8084213bf 100644 --- a/inform7/core-module/Chapter 27/Compilation Modules.w +++ b/inform7/core-module/Chapter 27/Compilation Modules.w @@ -1,10 +1,9 @@ -[Modules::] Compilation Modules. +[CompilationUnits::] Compilation Units. To identify which parts of the source text come from which source (the main source text, the Standard Rules, or another extension). -@h Compilation modules. -Inform is a language in which it is semantically relevant which source file the +@ Inform is a language in which it is semantically relevant which source file the source text is coming from: unlike, say, C, where |#include| allows files to include each other in arbitrary ways. In Inform, all source text comes from one of the following places: @@ -13,47 +12,42 @@ following places: (b) An extension file, including the Standard Rules extension; (c) Invented text created by the compiler itself. -The Inter hierarchy also splits, with named modules representing each possibility -in (a) or (b) above. This section of code determines to which module any new +The Inter hierarchy also splits, with named units representing each possibility +in (a) or (b) above. This section of code determines to which unit any new definition (of, say, a property or kind) belongs. = -compilation_module *source_text_module = NULL; /* the one for the main text */ -compilation_module *SR_module = NULL; /* the one for the Standard Rules */ - -compilation_module *Modules::SR(void) { - return SR_module; -} +compilation_unit *source_text_unit = NULL; /* the one for the main text */ @ We find these by performing a traverse of the parse tree, and looking for level-0 headings, which are the nodes from which these blocks of source text hang: = -void Modules::traverse_to_define(void) { - SyntaxTree::traverse(Task::syntax_tree(), Modules::look_for_cu); +void CompilationUnits::determine(void) { + SyntaxTree::traverse(Task::syntax_tree(), CompilationUnits::look_for_cu); } -void Modules::look_for_cu(parse_node *p) { +void CompilationUnits::look_for_cu(parse_node *p) { if (Node::get_type(p) == HEADING_NT) { heading *h = Headings::from_node(p); - if ((h) && (h->level == 0)) Modules::new(p); + if ((h) && (h->level == 0)) CompilationUnits::new(p); } } -compilation_module *Modules::new(parse_node *from) { +compilation_unit *CompilationUnits::new(parse_node *from) { source_location sl = Wordings::location(Node::get_text(from)); if (sl.file_of_origin == NULL) return NULL; inform_extension *owner = Extensions::corresponding_to( Lexer::file_of_origin(Wordings::first_wn(Node::get_text(from)))); - compilation_module *C = Packaging::new_cm(); + compilation_unit *C = Packaging::new_cu(); C->hanging_from = from; - Node::set_module(from, C); - Modules::propagate_downwards(from->down, C); + Node::set_unit(from, C); + CompilationUnits::propagate_downwards(from->down, C); TEMPORARY_TEXT(pname) - @; - C->inter_presence = Packaging::get_module(Emit::tree(), pname); + @; + C->inter_presence = Packaging::get_unit(Emit::tree(), pname); DISCARD_TEXT(pname) if (owner) { @@ -66,15 +60,14 @@ compilation_module *Modules::new(parse_node *from) { DISCARD_TEXT(V) } - if (Extensions::is_standard(owner)) SR_module = C; - if (owner == NULL) source_text_module = C; + if (owner == NULL) source_text_unit = C; return C; } @ Here we must find a unique name, valid as an Inter identifier: the code -compiled from the compilation module will go into a package of that name. +compiled from the compilation unit will go into a package of that name. -@ = +@ = if (Extensions::is_standard(owner)) WRITE_TO(pname, "standard_rules"); else if (owner == NULL) WRITE_TO(pname, "source_text"); else { @@ -87,47 +80,47 @@ compiled from the compilation module will go into a package of that name. } @ We are eventually going to need to be able to look at a given node in the parse -tree and say which compilation module it belongs to. If there were a fast way +tree and say which compilation unit it belongs to. If there were a fast way to go up in the tree, that would be easy -- we could simply run upward until we reach a level-0 heading. But the node links all run downwards. Instead, we'll -"mark" nodes in the tree, annotating them with the compilation module which owns +"mark" nodes in the tree, annotating them with the compilation unit which owns them. This is done by "propagating downwards", as follows. @ = -void Modules::propagate_downwards(parse_node *P, compilation_module *C) { +void CompilationUnits::propagate_downwards(parse_node *P, compilation_unit *C) { while (P) { - Node::set_module(P, C); - Modules::propagate_downwards(P->down, C); + Node::set_unit(P, C); + CompilationUnits::propagate_downwards(P->down, C); P = P->next; } } -@ As promised, then, given a parse node, we have to return its compilation module: +@ As promised, then, given a parse node, we have to return its compilation unit: but that's now easy, as we just have to read off the annotation made above -- = -compilation_module *Modules::find(parse_node *from) { +compilation_unit *CompilationUnits::find(parse_node *from) { if (from == NULL) return NULL; - return Node::get_module(from); + return Node::get_unit(from); } -@h Current module. -Inform has a concept of the "current module" it's working on, much as it has +@h Current unit. +Inform has a concept of the "current unit" it's working on, much as it has a concept of "current sentence". = -compilation_module *current_CM = NULL; +compilation_unit *current_CM = NULL; -compilation_module *Modules::current(void) { +compilation_unit *CompilationUnits::current(void) { return current_CM; } -void Modules::set_current_to(compilation_module *CM) { +void CompilationUnits::set_current_to(compilation_unit *CM) { current_CM = CM; } -void Modules::set_current(parse_node *P) { - if (P) current_CM = Modules::find(P); +void CompilationUnits::set_current(parse_node *P) { + if (P) current_CM = CompilationUnits::find(P); else current_CM = NULL; } @@ -136,7 +129,7 @@ Creating the necessary package, of type |_module|, is the work of the Packaging code. = -module_package *Modules::inter_presence(compilation_module *C) { - if (C == NULL) internal_error("no module"); +module_package *CompilationUnits::inter_presence(compilation_unit *C) { + if (C == NULL) internal_error("no unit"); return C->inter_presence; } diff --git a/inform7/core-module/Chapter 27/Emit.w b/inform7/core-module/Chapter 27/Emit.w index 5a126f68d..5487fb519 100644 --- a/inform7/core-module/Chapter 27/Emit.w +++ b/inform7/core-module/Chapter 27/Emit.w @@ -23,9 +23,9 @@ void Emit::begin(void) { I7_generation_tree = I; Packaging::incarnate(Site::veneer_request(I)); - Packaging::incarnate(Packaging::get_module(I, I"generic")->the_package); - Packaging::incarnate(Packaging::get_module(I, I"synoptic")->the_package); - Packaging::incarnate(Packaging::get_module(I, I"standard_rules")->the_package); + Packaging::incarnate(Packaging::get_unit(I, I"generic")->the_package); + Packaging::incarnate(Packaging::get_unit(I, I"synoptic")->the_package); + Packaging::incarnate(Packaging::get_unit(I, I"standard_rules")->the_package); Hierarchy::establish(I); diff --git a/inform7/core-module/Chapter 27/Hierarchy.w b/inform7/core-module/Chapter 27/Hierarchy.w index 6492f647b..978872f2d 100644 --- a/inform7/core-module/Chapter 27/Hierarchy.w +++ b/inform7/core-module/Chapter 27/Hierarchy.w @@ -1580,7 +1580,7 @@ void Hierarchy::make_available(inter_tree *I, inter_name *iname) { Inter::Connectors::socket(Emit::tree(), ma_as, S); } -package_request *Hierarchy::package(compilation_module *C, int hap_id) { +package_request *Hierarchy::package(compilation_unit *C, int hap_id) { return HierarchyLocations::attach_new_package(Emit::tree(), C, NULL, hap_id); } @@ -1589,7 +1589,7 @@ package_request *Hierarchy::synoptic_package(int hap_id) { } package_request *Hierarchy::local_package(int hap_id) { - return HierarchyLocations::attach_new_package(Emit::tree(), Modules::find(current_sentence), NULL, hap_id); + return HierarchyLocations::attach_new_package(Emit::tree(), CompilationUnits::find(current_sentence), NULL, hap_id); } package_request *Hierarchy::package_in_enclosure(int hap_id) { @@ -1612,7 +1612,7 @@ inter_name *Hierarchy::derive_iname_in(int id, inter_name *derive_from, package_ return HierarchyLocations::find_in_package(Emit::tree(), id, P, EMPTY_WORDING, derive_from, -1, NULL); } -inter_name *Hierarchy::make_localised_iname_in(int id, package_request *P, compilation_module *C) { +inter_name *Hierarchy::make_localised_iname_in(int id, package_request *P, compilation_unit *C) { return HierarchyLocations::find_in_package(Emit::tree(), id, P, EMPTY_WORDING, NULL, -1, NULL); } diff --git a/inform7/core-module/Chapter 3/Booting Verbs.w b/inform7/core-module/Chapter 3/Booting Verbs.w index b4a39ccf2..b5738ab9f 100644 --- a/inform7/core-module/Chapter 3/Booting Verbs.w +++ b/inform7/core-module/Chapter 3/Booting Verbs.w @@ -18,7 +18,7 @@ defined "to mean", how can we recognise "means" as the verb, or know what it means? We break this circularity by hard-wiring it, as follows. = -void BootVerbs::bootstrap(void) { +void BootVerbs::make_built_in(void) { verb *to_mean; special_meaning_holder *meaning_of_mean; @; diff --git a/inform7/core-module/Chapter 4/Adjective Meanings.w b/inform7/core-module/Chapter 4/Adjective Meanings.w index c9736c5c8..7cd7ad9cb 100644 --- a/inform7/core-module/Chapter 4/Adjective Meanings.w +++ b/inform7/core-module/Chapter 4/Adjective Meanings.w @@ -146,7 +146,7 @@ typedef struct adjective_compilation_data { = void Adjectives::Meanings::initialise(adjective *adj) { - adj->adjective_compilation.aph_package = Hierarchy::package(Modules::current(), ADJECTIVES_HAP); + adj->adjective_compilation.aph_package = Hierarchy::package(CompilationUnits::current(), ADJECTIVES_HAP); adj->adjective_compilation.aph_iname = Hierarchy::make_iname_in(ADJECTIVE_HL, adj->adjective_compilation.aph_package); } diff --git a/inform7/core-module/Chapter 5/Literal Patterns.w b/inform7/core-module/Chapter 5/Literal Patterns.w index c2598ae0a..e087e23b7 100644 --- a/inform7/core-module/Chapter 5/Literal Patterns.w +++ b/inform7/core-module/Chapter 5/Literal Patterns.w @@ -2982,7 +2982,7 @@ void LiteralPatterns::define_named_phrases(void) { @; } } - Sentences::RuleSubtrees::register_recently_lexed_phrases(); + RuleSubtrees::register_recently_lexed_phrases(); } @ These text substitutions correspond exactly neither to the LPs nor to the @@ -3035,7 +3035,7 @@ void LiteralPatterns::define_packing_phrases(literal_pattern *lp, kind *K) { Kinds::Textual::write(TEMP, K); @; @; - Sentences::RuleSubtrees::register_recently_lexed_phrases(); + RuleSubtrees::register_recently_lexed_phrases(); DISCARD_TEXT(TEMP) } diff --git a/inform7/core-module/Chapter 5/Nonlocal Variables.w b/inform7/core-module/Chapter 5/Nonlocal Variables.w index 7b9e49cd7..fc0459614 100644 --- a/inform7/core-module/Chapter 5/Nonlocal Variables.w +++ b/inform7/core-module/Chapter 5/Nonlocal Variables.w @@ -413,7 +413,7 @@ inference_subject *NonlocalVariables::get_knowledge(nonlocal_variable *nlv) { = inter_name *NonlocalVariables::iname(nonlocal_variable *nlv) { if (nlv->nlv_iname == NULL) { - package_request *R = Hierarchy::package(Modules::find(nlv->nlv_created_at), VARIABLES_HAP); + package_request *R = Hierarchy::package(CompilationUnits::find(nlv->nlv_created_at), VARIABLES_HAP); Hierarchy::markup_wording(R, VARIABLE_NAME_HMD, nlv->name); nlv->nlv_iname = Hierarchy::make_iname_with_memo(VARIABLE_HL, R, nlv->name); } diff --git a/inform7/core-module/Chapter 6/Binary Predicates.w b/inform7/core-module/Chapter 6/Binary Predicates.w index 3d81d3c0d..e4c1ac2b8 100644 --- a/inform7/core-module/Chapter 6/Binary Predicates.w +++ b/inform7/core-module/Chapter 6/Binary Predicates.w @@ -617,7 +617,7 @@ binary_predicate *BinaryPredicates::make_single(int family, package_request *BinaryPredicates::package(binary_predicate *bp) { if (bp == NULL) internal_error("null bp"); if (bp->bp_package == NULL) - bp->bp_package = Hierarchy::package(Modules::find(bp->bp_created_at), RELATIONS_HAP); + bp->bp_package = Hierarchy::package(CompilationUnits::find(bp->bp_created_at), RELATIONS_HAP); return bp->bp_package; } diff --git a/inform7/core-module/Chapter 6/New Verbs.w b/inform7/core-module/Chapter 6/New Verbs.w index 3374685fe..89c86e066 100644 --- a/inform7/core-module/Chapter 6/New Verbs.w +++ b/inform7/core-module/Chapter 6/New Verbs.w @@ -43,7 +43,7 @@ package_request *NewVerbs::package(verb *V, parse_node *where) { if (V == NULL) internal_error("no verb identity"); if (V->verb_compilation.verb_package == NULL) V->verb_compilation.verb_package = - Hierarchy::package(Modules::find(where), VERBS_HAP); + Hierarchy::package(CompilationUnits::find(where), VERBS_HAP); return V->verb_compilation.verb_package; } diff --git a/inform7/core-module/Chapter 7/Parse Tree Usage.w b/inform7/core-module/Chapter 7/Parse Tree Usage.w index 3af257d95..cc6e47bc8 100644 --- a/inform7/core-module/Chapter 7/Parse Tree Usage.w +++ b/inform7/core-module/Chapter 7/Parse Tree Usage.w @@ -179,7 +179,7 @@ void ParseTreeUsage::write_permissions(void) { Annotations::allow(HEADING_NT, interpretation_of_subject_ANNOT); Annotations::allow(HEADING_NT, suppress_heading_dependencies_ANNOT); Annotations::allow(HEADING_NT, implied_heading_ANNOT); - Annotations::allow_for_category(L1_NCAT, module_ANNOT); + Annotations::allow_for_category(L1_NCAT, unit_ANNOT); Annotations::allow_for_category(L2_NCAT, clears_pronouns_ANNOT); Annotations::allow_for_category(L2_NCAT, interpretation_of_subject_ANNOT); @@ -188,12 +188,12 @@ void ParseTreeUsage::write_permissions(void) { Annotations::allow(SENTENCE_NT, implicit_in_creation_of_ANNOT); Annotations::allow(SENTENCE_NT, implicitness_count_ANNOT); Annotations::allow(SENTENCE_NT, you_can_ignore_ANNOT); - Annotations::allow_for_category(L2_NCAT, module_ANNOT); + Annotations::allow_for_category(L2_NCAT, unit_ANNOT); LOOP_OVER_ENUMERATED_NTS(t) if (NodeType::has_flag(t, ASSERT_NFLAG)) Annotations::allow(t, resolved_ANNOT); - Annotations::allow_for_category(L3_NCAT, module_ANNOT); + Annotations::allow_for_category(L3_NCAT, unit_ANNOT); Annotations::allow_for_category(L3_NCAT, creation_proposition_ANNOT); Annotations::allow_for_category(L3_NCAT, evaluation_ANNOT); Annotations::allow_for_category(L3_NCAT, subject_ANNOT); @@ -243,7 +243,7 @@ void ParseTreeUsage::write_permissions(void) { Annotations::allow_for_category(L4_NCAT, token_to_be_parsed_against_ANNOT); Annotations::allow_for_category(L4_NCAT, verb_problem_issued_ANNOT); Annotations::allow_for_category(L4_NCAT, problem_falls_under_ANNOT); - Annotations::allow_for_category(L4_NCAT, module_ANNOT); + Annotations::allow_for_category(L4_NCAT, unit_ANNOT); Annotations::allow(INVOCATION_LIST_NT, from_text_substitution_ANNOT); Annotations::allow(INVOCATION_LIST_SAY_NT, suppress_newlines_ANNOT); Annotations::allow(INVOCATION_NT, epistemological_status_ANNOT); diff --git a/inform7/core-module/Chapter 7/Rule Subtrees.w b/inform7/core-module/Chapter 7/Rule Subtrees.w index 88a229c94..95f4a67ef 100644 --- a/inform7/core-module/Chapter 7/Rule Subtrees.w +++ b/inform7/core-module/Chapter 7/Rule Subtrees.w @@ -1,4 +1,4 @@ -[Sentences::RuleSubtrees::] Rule Subtrees. +[RuleSubtrees::] Rule Subtrees. To tidy up |INVOCATION_LIST_NT| nodes into a list of children under the relevant |RULE_NT| node, and so turn each rule definition into a single @@ -21,16 +21,16 @@ acts so as to leave a non-zero number of children, and since it acts only on childless nodes, it cannot ever act on the same node twice. = -void Sentences::RuleSubtrees::register_recently_lexed_phrases(void) { +void RuleSubtrees::register_recently_lexed_phrases(void) { if (problem_count > 0) return; /* for then the tree is perhaps broken anyway */ - SyntaxTree::traverse(Task::syntax_tree(), Sentences::RuleSubtrees::demote_command_nodes); - SyntaxTree::traverse(Task::syntax_tree(), Sentences::RuleSubtrees::detect_loose_command_nodes); + SyntaxTree::traverse(Task::syntax_tree(), RuleSubtrees::demote_command_nodes); + SyntaxTree::traverse(Task::syntax_tree(), RuleSubtrees::detect_loose_command_nodes); } @ Command nodes are demoted to be children of routine nodes: = -void Sentences::RuleSubtrees::demote_command_nodes(parse_node *p) { +void RuleSubtrees::demote_command_nodes(parse_node *p) { if ((Node::get_type(p) == RULE_NT) && (p->down == NULL)) { parse_node *end_def = p; while ((end_def->next) && (Node::get_type(end_def->next) == INVOCATION_LIST_NT)) @@ -40,14 +40,14 @@ void Sentences::RuleSubtrees::demote_command_nodes(parse_node *p) { p->down = p->next; p->next = end_def->next; end_def->next = NULL; - Sentences::RuleSubtrees::parse_routine_structure(p); + RuleSubtrees::parse_routine_structure(p); } } @ And just in case: = -void Sentences::RuleSubtrees::detect_loose_command_nodes(parse_node *p) { +void RuleSubtrees::detect_loose_command_nodes(parse_node *p) { if (Node::get_type(p) == INVOCATION_LIST_NT) internal_error("loose COMMAND node outside of rule definition"); } @@ -70,7 +70,7 @@ it's kept for the benefit of partially sighted users, who find tabbed indentation difficult to manage with screen-readers. = -void Sentences::RuleSubtrees::parse_routine_structure(parse_node *routine_node) { +void RuleSubtrees::parse_routine_structure(parse_node *routine_node) { int initial_problem_count = problem_count; parse_node *uses_colon_syntax = NULL; @@ -285,7 +285,7 @@ to break this up. @; if (uses_colon_syntax == FALSE) { - last_node_of_if_construction->next = Sentences::RuleSubtrees::end_node(p); + last_node_of_if_construction->next = RuleSubtrees::end_node(p); last_node_of_if_construction->next->next = rest_of_routine; } else { last_node_of_if_construction->next = rest_of_routine; @@ -524,7 +524,7 @@ above it: here we insert such a marker at a place where the source text indentation implicitly requires it. @ = - parse_node *implicit_end = Sentences::RuleSubtrees::end_node(opening); + parse_node *implicit_end = RuleSubtrees::end_node(opening); implicit_end->next = prev->next; prev->next = implicit_end; prev = implicit_end; @@ -765,13 +765,13 @@ where we look for such mistakes. @<(f) Police the structure of the parse tree@> = int n = problem_count; - Sentences::RuleSubtrees::police_code_block(routine_node->down, NULL); + RuleSubtrees::police_code_block(routine_node->down, NULL); if (problem_count > n) LOG("Local parse tree: $T\n", routine_node); @ Which recursively uses the following: = -void Sentences::RuleSubtrees::police_code_block(parse_node *block, control_structure_phrase *context) { +void RuleSubtrees::police_code_block(parse_node *block, control_structure_phrase *context) { for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) { current_sentence = p; @@ -801,7 +801,7 @@ void Sentences::RuleSubtrees::police_code_block(parse_node *block, control_struc } } - if (p->down) Sentences::RuleSubtrees::police_code_block(p, csp); + if (p->down) RuleSubtrees::police_code_block(p, csp); } } @@ -913,7 +913,7 @@ can now become "otherwise: if whatever: ...". @<(g) Optimise out the otherwise if nodes@> = int n = problem_count; - Sentences::RuleSubtrees::purge_otherwise_if(routine_node->down); + RuleSubtrees::purge_otherwise_if(routine_node->down); if (problem_count > n) LOG("Local parse tree: $T\n", routine_node); @ We made a similar manoeuvre above, but for one-line "otherwise do something" @@ -922,7 +922,7 @@ didn't handle this back then because to do so would have made it impossible to issue good problem messages for failures to use "otherwise if" correctly. = -void Sentences::RuleSubtrees::purge_otherwise_if(parse_node *block) { +void RuleSubtrees::purge_otherwise_if(parse_node *block) { for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) { if (Node::get_control_structure_used(p) == otherwise_if_CSP) { parse_node *former_contents = p->down; @@ -949,7 +949,7 @@ void Sentences::RuleSubtrees::purge_otherwise_if(parse_node *block) { /* any further "otherwise if" or "otherwise" nodes after p follow */ p->down->next = former_successors; } - if (p->down) Sentences::RuleSubtrees::purge_otherwise_if(p); + if (p->down) RuleSubtrees::purge_otherwise_if(p); } } @@ -959,15 +959,15 @@ but now that the structure is known to be correct they serve no further purpose. We remove them. @<(h) Remove any end markers as no longer necessary@> = - Sentences::RuleSubtrees::purge_end_markers(routine_node->down); + RuleSubtrees::purge_end_markers(routine_node->down); @ = -void Sentences::RuleSubtrees::purge_end_markers(parse_node *block) { +void RuleSubtrees::purge_end_markers(parse_node *block) { for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) { if (Node::get_end_control_structure_used(p)) { if (prev_p) prev_p->next = p->next; else block->down = p->next; } - if (p->down) Sentences::RuleSubtrees::purge_end_markers(p); + if (p->down) RuleSubtrees::purge_end_markers(p); } } @@ -975,15 +975,15 @@ void Sentences::RuleSubtrees::purge_end_markers(parse_node *block) { can now be removed, too. @<(i) Remove any begin markers as no longer necessary@> = - Sentences::RuleSubtrees::purge_begin_markers(routine_node->down); + RuleSubtrees::purge_begin_markers(routine_node->down); @ = -void Sentences::RuleSubtrees::purge_begin_markers(parse_node *block) { +void RuleSubtrees::purge_begin_markers(parse_node *block) { for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) { if (Node::get_control_structure_used(p)) if ((Node::get_text(p))) Node::set_text(p, GET_RW(, 1)); - if (p->down) Sentences::RuleSubtrees::purge_begin_markers(p); + if (p->down) RuleSubtrees::purge_begin_markers(p); } } @@ -995,10 +995,10 @@ code block nodes to mark these phrases, and transfer the control structure annotations to them. @<(j) Insert code block nodes so that nodes needing to be parsed are childless@> = - Sentences::RuleSubtrees::insert_cb_nodes(routine_node->down); + RuleSubtrees::insert_cb_nodes(routine_node->down); @ = -void Sentences::RuleSubtrees::insert_cb_nodes(parse_node *block) { +void RuleSubtrees::insert_cb_nodes(parse_node *block) { for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) { if (ControlStructures::opens_block(Node::get_control_structure_used(p))) { parse_node *blank_cb_node = Node::new(CODE_BLOCK_NT); @@ -1012,17 +1012,17 @@ void Sentences::RuleSubtrees::insert_cb_nodes(parse_node *block) { if (prev_p) prev_p->next = blank_cb_node; else block->down = blank_cb_node; p = blank_cb_node; } - if (p->down) Sentences::RuleSubtrees::insert_cb_nodes(p); + if (p->down) RuleSubtrees::insert_cb_nodes(p); } } @ Now: @<(k) Insert instead marker nodes@> = - Sentences::RuleSubtrees::read_instead_markers(routine_node->down); + RuleSubtrees::read_instead_markers(routine_node->down); @ = -void Sentences::RuleSubtrees::read_instead_markers(parse_node *block) { +void RuleSubtrees::read_instead_markers(parse_node *block) { for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) { if ((Node::get_text(p))) { Node::set_text(p, GET_RW(, 1)); @@ -1031,17 +1031,17 @@ void Sentences::RuleSubtrees::read_instead_markers(parse_node *block) { instead_node->next = p->next; p->next = instead_node; } - if (p->down) Sentences::RuleSubtrees::read_instead_markers(p); + if (p->down) RuleSubtrees::read_instead_markers(p); } } @ Now: @<(l) Break up say phrases@> = - Sentences::RuleSubtrees::break_up_says(routine_node->down); + RuleSubtrees::break_up_says(routine_node->down); @ = -void Sentences::RuleSubtrees::break_up_says(parse_node *block) { +void RuleSubtrees::break_up_says(parse_node *block) { for (parse_node *p = block->down, *prev_p = NULL; p; prev_p = p, p = p->next) { int sf = NO_SIGF; wording W = Node::get_text(p); @@ -1059,7 +1059,7 @@ void Sentences::RuleSubtrees::break_up_says(parse_node *block) { if (prev_p) prev_p->next = blank_cb_node; else block->down = blank_cb_node; current_sentence = p; - Sentences::RuleSubtrees::unroll_says(blank_cb_node, W, 0); + RuleSubtrees::unroll_says(blank_cb_node, W, 0); p = blank_cb_node; break; } @@ -1071,11 +1071,11 @@ void Sentences::RuleSubtrees::break_up_says(parse_node *block) { break; } } - if (p->down) Sentences::RuleSubtrees::break_up_says(p); + if (p->down) RuleSubtrees::break_up_says(p); } } -void Sentences::RuleSubtrees::unroll_says(parse_node *cb_node, wording W, int depth) { +void RuleSubtrees::unroll_says(parse_node *cb_node, wording W, int depth) { while ((W)) { wording AW = GET_RW(, 1); wording BW = GET_RW(, 2); @@ -1093,7 +1093,7 @@ void Sentences::RuleSubtrees::unroll_says(parse_node *cb_node, wording W, int de @; wording A = Feeds::feed_C_string_expanding_strings(p); if ((A)) - Sentences::RuleSubtrees::unroll_says(cb_node, A, depth+1); + RuleSubtrees::unroll_says(cb_node, A, depth+1); } else { parse_node *say_term_node = Node::new(INVOCATION_LIST_SAY_NT); Node::set_text(say_term_node, W); @@ -1220,7 +1220,7 @@ to parse the list. match a given begin node. = -parse_node *Sentences::RuleSubtrees::end_node(parse_node *opening) { +parse_node *RuleSubtrees::end_node(parse_node *opening) { parse_node *implicit_end = Node::new(INVOCATION_LIST_NT); Node::set_end_control_structure_used(implicit_end, Node::get_control_structure_used(opening)); diff --git a/inform7/core-module/Chapter 9/Traverse for Assertions.w b/inform7/core-module/Chapter 9/Traverse for Assertions.w index 8c61ebca5..7d3376716 100644 --- a/inform7/core-module/Chapter 9/Traverse for Assertions.w +++ b/inform7/core-module/Chapter 9/Traverse for Assertions.w @@ -149,12 +149,12 @@ artificially to run through those sentences. = void Assertions::Traverse::visit(parse_node *p, parse_node **last) { assembly_position = current_sentence; - compilation_module *cm = Modules::current(); - Modules::set_current(p); + compilation_unit *cm = CompilationUnits::current(); + CompilationUnits::set_current(p); @; *last = p; @; - Modules::set_current_to(cm); + CompilationUnits::set_current_to(cm); } @ If this hasn't already been done: diff --git a/inform7/if-module/Chapter 3/Regions.w b/inform7/if-module/Chapter 3/Regions.w index 4eabea1f7..c43e398e0 100644 --- a/inform7/if-module/Chapter 3/Regions.w +++ b/inform7/if-module/Chapter 3/Regions.w @@ -36,6 +36,7 @@ typedef struct regions_data { = void PL::Regions::start(void) { + PLUGIN_REGISTER(PLUGIN_CREATE_INFERENCES, PL::Regions::create_inference_subjects); PLUGIN_REGISTER(PLUGIN_NEW_BASE_KIND_NOTIFY, PL::Regions::regions_new_base_kind_notify); PLUGIN_REGISTER(PLUGIN_SET_SUBKIND_NOTIFY, PL::Regions::regions_set_subkind_notify); PLUGIN_REGISTER(PLUGIN_NEW_SUBJECT_NOTIFY, PL::Regions::regions_new_subject_notify); @@ -46,6 +47,9 @@ void PL::Regions::start(void) { PLUGIN_REGISTER(PLUGIN_INTERVENE_IN_ASSERTION, PL::Regions::regions_intervene_in_assertion); PLUGIN_REGISTER(PLUGIN_NAME_TO_EARLY_INFS, PL::Regions::regions_name_to_early_infs); PLUGIN_REGISTER(PLUGIN_ADD_TO_WORLD_INDEX, PL::Regions::regions_add_to_World_index); +} + +void PL::Regions::create_inference_subjects(void) { infs_region = InferenceSubjects::new(global_constants, FUND_SUB, NULL_GENERAL_POINTER, LIKELY_CE); } diff --git a/inform7/if-module/Chapter 3/Scenes.w b/inform7/if-module/Chapter 3/Scenes.w index ee5dfa803..d21423a1d 100644 --- a/inform7/if-module/Chapter 3/Scenes.w +++ b/inform7/if-module/Chapter 3/Scenes.w @@ -284,7 +284,7 @@ ends merrily" and "when the Banquet Entertainment ends merrily". sc->allocation_id, end); Feeds::feed_text_expanding_strings(i6_code); Sentences::make_node(Task::syntax_tree(), Feeds::end(id), '.'); - Sentences::RuleSubtrees::register_recently_lexed_phrases(); + RuleSubtrees::register_recently_lexed_phrases(); DISCARD_TEXT(i6_code) @h Anchors. diff --git a/inform7/if-module/Chapter 3/Spatial Model.w b/inform7/if-module/Chapter 3/Spatial Model.w index 8533048b2..6a9de6ae9 100644 --- a/inform7/if-module/Chapter 3/Spatial Model.w +++ b/inform7/if-module/Chapter 3/Spatial Model.w @@ -95,6 +95,7 @@ inference_subject *infs_person = NULL; = void PL::Spatial::start(void) { + PLUGIN_REGISTER(PLUGIN_CREATE_INFERENCES, PL::Spatial::create_inference_subjects); PLUGIN_REGISTER(PLUGIN_NEW_BASE_KIND_NOTIFY, PL::Spatial::spatial_new_base_kind_notify); PLUGIN_REGISTER(PLUGIN_ACT_ON_SPECIAL_NPS, PL::Spatial::spatial_act_on_special_NPs); PLUGIN_REGISTER(PLUGIN_COMPLETE_MODEL, PL::Spatial::IF_complete_model); @@ -110,7 +111,6 @@ void PL::Spatial::start(void) { PLUGIN_REGISTER(PLUGIN_SET_SUBKIND_NOTIFY, PL::Spatial::spatial_set_subkind_notify); PLUGIN_REGISTER(PLUGIN_ADD_TO_WORLD_INDEX, PL::Spatial::spatial_add_to_World_index); PLUGIN_REGISTER(PLUGIN_INTERVENE_IN_ASSERTION, PL::Spatial::spatial_intervene_in_assertion); - @; } @ In talking about some of the fundamental spatial domains we potentially have @@ -131,7 +131,8 @@ kinds they will one day infer about. These amount to promisory notes that we will make them correspond to the actual kinds later on, at some point after stage (d) when they exist. -@ = += +void PL::Spatial::create_inference_subjects(void) { infs_room = InferenceSubjects::new(global_constants, FUND_SUB, NULL_GENERAL_POINTER, LIKELY_CE); infs_thing = InferenceSubjects::new(global_constants, @@ -140,6 +141,7 @@ after stage (d) when they exist. FUND_SUB, NULL_GENERAL_POINTER, LIKELY_CE); infs_person = InferenceSubjects::new(global_constants, FUND_SUB, NULL_GENERAL_POINTER, LIKELY_CE); +} @ And this is where those IOUs are redeemed. What happens is that, ordinarily, the machinery creating objects (and kinds) will allocate a new inference diff --git a/inform7/if-module/Chapter 5/General Parsing Routines.w b/inform7/if-module/Chapter 5/General Parsing Routines.w index a878f87ce..3ff744a00 100644 --- a/inform7/if-module/Chapter 5/General Parsing Routines.w +++ b/inform7/if-module/Chapter 5/General Parsing Routines.w @@ -85,7 +85,7 @@ will simply compile a |parse_name| routine inline, in the usual I6 way. = inter_name *PL::Parsing::Tokens::General::get_gv_parse_name(grammar_verb *gv) { if (gv->gv_parse_name_iname == NULL) { - compilation_module *C = Modules::find(gv->where_gv_created); + compilation_unit *C = CompilationUnits::find(gv->where_gv_created); package_request *PR = Hierarchy::package(C, PARSE_NAMES_HAP); gv->gv_parse_name_iname = Hierarchy::make_iname_in(PARSE_NAME_FN_HL, PR); } @@ -100,7 +100,7 @@ inter_name *PL::Parsing::Tokens::General::compile_parse_name_property(inference_ } else { if (PL::Parsing::Visibility::any_property_visible_to_subject(subj, FALSE)) { parse_name_notice *notice = CREATE(parse_name_notice); - compilation_module *C = Modules::find(subj->infs_created_at); + compilation_unit *C = CompilationUnits::find(subj->infs_created_at); package_request *PR = Hierarchy::package(C, PARSE_NAMES_HAP); notice->pnn_iname = Hierarchy::make_iname_in(PARSE_NAME_DASH_FN_HL, PR); notice->parse_subject = subj; diff --git a/inform7/kinds-module/Chapter 1/Kinds Module.w b/inform7/kinds-module/Chapter 1/Kinds Module.w index b48406e0d..75e3c8b4e 100644 --- a/inform7/kinds-module/Chapter 1/Kinds Module.w +++ b/inform7/kinds-module/Chapter 1/Kinds Module.w @@ -16,7 +16,6 @@ which use this module: @e kind_constructor_CLASS @e kind_template_definition_CLASS @e kind_macro_definition_CLASS -@e kind_template_obligation_CLASS @e kind_constructor_comparison_schema_CLASS @e kind_constructor_casting_rule_CLASS @e kind_constructor_instance_CLASS @@ -29,7 +28,6 @@ DECLARE_CLASS(kind_variable_declaration) DECLARE_CLASS(kind_constructor) DECLARE_CLASS(kind_macro_definition) DECLARE_CLASS(kind_template_definition) -DECLARE_CLASS(kind_template_obligation) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(kind_constructor_casting_rule, 100) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(kind_constructor_comparison_schema, 100) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(kind_constructor_instance, 100) diff --git a/inform7/kinds-module/Chapter 2/Kind Constructors.w b/inform7/kinds-module/Chapter 2/Kind Constructors.w index 6b1aee32e..3462d0793 100644 --- a/inform7/kinds-module/Chapter 2/Kind Constructors.w +++ b/inform7/kinds-module/Chapter 2/Kind Constructors.w @@ -398,10 +398,10 @@ inter_name *Kinds::Constructors::UNKNOWN_iname(void) { package_request *Kinds::Constructors::package(kind_constructor *con) { if (con->kc_package == NULL) { if (con->defined_in_source_text) { - compilation_module *C = Modules::find(con->where_defined_in_source_text); + compilation_unit *C = CompilationUnits::find(con->where_defined_in_source_text); con->kc_package = Hierarchy::package(C, KIND_HAP); } else if (con->superkind_set_at) { - compilation_module *C = Modules::find(con->superkind_set_at); + compilation_unit *C = CompilationUnits::find(con->superkind_set_at); con->kc_package = Hierarchy::package(C, KIND_HAP); } else { con->kc_package = Hierarchy::synoptic_package(KIND_HAP); diff --git a/inter/building-module/Chapter 1/Building Module.w b/inter/building-module/Chapter 1/Building Module.w index 018d15591..76252e48d 100644 --- a/inter/building-module/Chapter 1/Building Module.w +++ b/inter/building-module/Chapter 1/Building Module.w @@ -18,7 +18,7 @@ We need to itemise the structures we'll want to allocate: @e module_package_CLASS @e submodule_identity_CLASS @e submodule_request_CLASS -@e compilation_module_CLASS +@e compilation_unit_CLASS @e inter_schema_CLASS @e inter_schema_node_CLASS @e inter_schema_token_CLASS @@ -33,7 +33,7 @@ DECLARE_CLASS(package_request) DECLARE_CLASS(module_package) DECLARE_CLASS(submodule_identity) DECLARE_CLASS(submodule_request) -DECLARE_CLASS(compilation_module) +DECLARE_CLASS(compilation_unit) DECLARE_CLASS(inter_schema) DECLARE_CLASS(inter_schema_node) DECLARE_CLASS(inter_schema_token) @@ -43,7 +43,7 @@ DECLARE_CLASS_ALLOCATED_IN_ARRAYS(inter_name_generator, 1000) #ifdef CORE_MODULE MAKE_ANNOTATION_FUNCTIONS(explicit_iname, inter_name) -MAKE_ANNOTATION_FUNCTIONS(module, compilation_module) +MAKE_ANNOTATION_FUNCTIONS(unit, compilation_unit) #endif @h The beginning. diff --git a/inter/building-module/Chapter 1/Building Site.w b/inter/building-module/Chapter 1/Building Site.w index 36bab2cf7..9247dbfcf 100644 --- a/inter/building-module/Chapter 1/Building Site.w +++ b/inter/building-module/Chapter 1/Building Site.w @@ -209,7 +209,7 @@ package_request *Site::main_request(inter_tree *I) { package_request *Site::connectors_request(inter_tree *I) { if (I->site.connectors_pr == NULL) { - module_package *T = Packaging::get_module(I, I"connectors"); + module_package *T = Packaging::get_unit(I, I"connectors"); I->site.connectors_pr = T->the_package; } return I->site.connectors_pr; @@ -217,7 +217,7 @@ package_request *Site::connectors_request(inter_tree *I) { package_request *Site::veneer_request(inter_tree *I) { if (I->site.veneer_pr == NULL) { - module_package *T = Packaging::get_module(I, I"veneer"); + module_package *T = Packaging::get_unit(I, I"veneer"); I->site.veneer_pr = T->the_package; packaging_state save = Packaging::enter(I->site.veneer_pr); I->site.veneer_bookmark = Packaging::bubble(I); diff --git a/inter/building-module/Chapter 1/Hierarchy Locations.w b/inter/building-module/Chapter 1/Hierarchy Locations.w index 0ea4fcc79..c20e06355 100644 --- a/inter/building-module/Chapter 1/Hierarchy Locations.w +++ b/inter/building-module/Chapter 1/Hierarchy Locations.w @@ -322,7 +322,7 @@ hierarchy_attachment_point *HierarchyLocations::ap(inter_tree *I, int hap_id, lo return hap; } -package_request *HierarchyLocations::attach_new_package(inter_tree *I, compilation_module *C, package_request *R, int hap_id) { +package_request *HierarchyLocations::attach_new_package(inter_tree *I, compilation_unit *C, package_request *R, int hap_id) { if ((hap_id < 0) || (hap_id >= NO_DEFINED_HAP_VALUES) || (I->site.haps_indexed_by_id[hap_id] == NULL)) internal_error("invalid HAP request"); hierarchy_attachment_point *hap = I->site.haps_indexed_by_id[hap_id]; diff --git a/inter/building-module/Chapter 1/Packaging.w b/inter/building-module/Chapter 1/Packaging.w index ddfa80ca6..cb37583a9 100644 --- a/inter/building-module/Chapter 1/Packaging.w +++ b/inter/building-module/Chapter 1/Packaging.w @@ -277,14 +277,14 @@ inter_package *Packaging::incarnate(package_request *R) { @h Compilation modules. = -typedef struct compilation_module { +typedef struct compilation_unit { struct module_package *inter_presence; struct parse_node *hanging_from; CLASS_DEFINITION -} compilation_module; +} compilation_unit; -compilation_module *Packaging::new_cm(void) { - return CREATE(compilation_module); +compilation_unit *Packaging::new_cu(void) { + return CREATE(compilation_unit); } @h Modules. @@ -303,7 +303,7 @@ typedef struct module_package { CLASS_DEFINITION } module_package; -module_package *Packaging::get_module(inter_tree *I, text_stream *name) { +module_package *Packaging::get_unit(inter_tree *I, text_stream *name) { if (Dictionaries::find(Site::modules_dictionary(I), name)) return (module_package *) Dictionaries::read_value(Site::modules_dictionary(I), name); @@ -345,26 +345,26 @@ module to have this submodule. It should call one of the following four function = #ifdef CORE_MODULE -package_request *Packaging::request_submodule(inter_tree *I, compilation_module *C, submodule_identity *sid) { +package_request *Packaging::request_submodule(inter_tree *I, compilation_unit *C, submodule_identity *sid) { if (C == NULL) return Packaging::generic_submodule(I, sid); - return Packaging::new_submodule_inner(I, Modules::inter_presence(C), sid); + return Packaging::new_submodule_inner(I, CompilationUnits::inter_presence(C), sid); } package_request *Packaging::local_submodule(inter_tree *I, submodule_identity *sid) { - return Packaging::request_submodule(I, Modules::find(current_sentence), sid); + return Packaging::request_submodule(I, CompilationUnits::find(current_sentence), sid); } #endif package_request *Packaging::generic_submodule(inter_tree *I, submodule_identity *sid) { - return Packaging::new_submodule_inner(I, Packaging::get_module(I, I"generic"), sid); + return Packaging::new_submodule_inner(I, Packaging::get_unit(I, I"generic"), sid); } package_request *Packaging::synoptic_submodule(inter_tree *I, submodule_identity *sid) { - return Packaging::new_submodule_inner(I, Packaging::get_module(I, I"synoptic"), sid); + return Packaging::new_submodule_inner(I, Packaging::get_unit(I, I"synoptic"), sid); } package_request *Packaging::template_submodule(inter_tree *I, submodule_identity *sid) { - return Packaging::new_submodule_inner(I, Packaging::get_module(I, I"template"), sid); + return Packaging::new_submodule_inner(I, Packaging::get_unit(I, I"template"), sid); } @ Those in turn all make use of this back-end function: diff --git a/services/inflections-module/Chapter 3/Verb Conjugation.w b/services/inflections-module/Chapter 3/Verb Conjugation.w index 3031b76c6..b93c00abe 100644 --- a/services/inflections-module/Chapter 3/Verb Conjugation.w +++ b/services/inflections-module/Chapter 3/Verb Conjugation.w @@ -301,7 +301,7 @@ inter_name *Conjugation::conj_iname(verb_conjugation *vc) { if (vc->vc_iname == NULL) { if (vc->vc_conjugates == NULL) { package_request *R = - Hierarchy::package(Modules::find(vc->where_vc_created), MVERBS_HAP); + Hierarchy::package(CompilationUnits::find(vc->where_vc_created), MVERBS_HAP); TEMPORARY_TEXT(ANT) WRITE_TO(ANT, "%A (modal)", &(vc->tabulations[ACTIVE_VOICE].vc_text[IS_TENSE][POSITIVE_SENSE][THIRD_PERSON])); Hierarchy::markup(R, MVERB_NAME_HMD, ANT); diff --git a/services/lexicon-module/Figures/excerpts-diagnostics.txt b/services/lexicon-module/Figures/excerpts-diagnostics.txt index 7cf946eff..ff3340bf8 100644 --- a/services/lexicon-module/Figures/excerpts-diagnostics.txt +++ b/services/lexicon-module/Figures/excerpts-diagnostics.txt @@ -5,11 +5,11 @@ Size of lexicon: 3102 excerpt meanings 29 words have a middle list: longest belongs to to (with 4 meanings) 108 words have a subset list: longest belongs to street (with 4 meanings) -Number of attempts to retrieve: 104689 - of which unsuccessful: 87188 - of which successful: 17501 +Number of attempts to retrieve: 104693 + of which unsuccessful: 87191 + of which successful: 17502 -Total attempts to match against excerpt meanings: 249425 - of which, total with incorrect hash codes: 227436 - of which, total with correct hash codes: 21989 - of which, total which matched: 19267 +Total attempts to match against excerpt meanings: 249444 + of which, total with incorrect hash codes: 227454 + of which, total with correct hash codes: 21990 + of which, total which matched: 19268 diff --git a/services/linguistics-module/Figures/stock-diagnostics.txt b/services/linguistics-module/Figures/stock-diagnostics.txt index b395fde73..5d8f5fb6d 100644 --- a/services/linguistics-module/Figures/stock-diagnostics.txt +++ b/services/linguistics-module/Figures/stock-diagnostics.txt @@ -212,61 +212,6 @@ noun: proper: 'concealment relation' noun: proper: 'enclosure relation' noun: proper: 'adjacency relation' noun: proper: 'regional-containment relation' -noun: proper: 'variable initial value' -noun: proper: 'property variable initial value' -noun: proper: 'specification' -noun: proper: 'property specification' -noun: proper: 'indefinite appearance text' -noun: proper: 'property indefinite appearance text' -noun: proper: 'printed name' -noun: proper: 'property printed name' -noun: proper: 'printed plural name' -noun: proper: 'property printed plural name' -noun: proper: 'indefinite article' -noun: proper: 'property indefinite article' -noun: proper: 'adaptive text viewpoint' -noun: proper: 'property adaptive text viewpoint' -noun: proper: 'description' -noun: proper: 'property description' -noun: proper: 'map region' -noun: proper: 'property map region' -noun: proper: 'initial appearance' -noun: proper: 'property initial appearance' -noun: proper: 'opposite' -noun: proper: 'property opposite' -noun: proper: 'mapping north relation' -noun: proper: 'mapping northeast relation' -noun: proper: 'mapping northwest relation' -noun: proper: 'mapping south relation' -noun: proper: 'mapping southeast relation' -noun: proper: 'mapping southwest relation' -noun: proper: 'mapping east relation' -noun: proper: 'mapping west relation' -noun: proper: 'mapping up relation' -noun: proper: 'mapping down relation' -noun: proper: 'mapping inside relation' -noun: proper: 'mapping outside relation' -noun: proper: 'other side' -noun: proper: 'property other side' -noun: proper: 'leading-through relation' -noun: proper: 'carrying capacity' -noun: proper: 'property carrying capacity' -noun: proper: 'matching key' -noun: proper: 'property matching key' -noun: proper: 'lock-fitting relation' -noun: proper: 'list grouping key' -noun: proper: 'property list grouping key' -noun: proper: 'protection relation' -noun: proper: 'ownership relation' -noun: proper: 'unbolting relation' -noun: proper: 'destination' -noun: proper: 'property destination' -noun: proper: 'conversation' -noun: proper: 'property conversation' -noun: proper: 'walk style' -noun: proper: 'property walk style' -noun: proper: 'last opener' -noun: proper: 'property last opener' noun: proper: 'table of final question options' noun: proper: 'final question wording' noun: proper: 'final question wording column' @@ -636,6 +581,61 @@ noun: proper: 'must have accessible the second noun rule' noun: proper: 'lock debugging rule' noun: proper: 'report universal unlocking rule' noun: proper: 'movement reporting rule' +noun: proper: 'variable initial value' +noun: proper: 'property variable initial value' +noun: proper: 'specification' +noun: proper: 'property specification' +noun: proper: 'indefinite appearance text' +noun: proper: 'property indefinite appearance text' +noun: proper: 'printed name' +noun: proper: 'property printed name' +noun: proper: 'printed plural name' +noun: proper: 'property printed plural name' +noun: proper: 'indefinite article' +noun: proper: 'property indefinite article' +noun: proper: 'adaptive text viewpoint' +noun: proper: 'property adaptive text viewpoint' +noun: proper: 'description' +noun: proper: 'property description' +noun: proper: 'map region' +noun: proper: 'property map region' +noun: proper: 'initial appearance' +noun: proper: 'property initial appearance' +noun: proper: 'opposite' +noun: proper: 'property opposite' +noun: proper: 'mapping north relation' +noun: proper: 'mapping northeast relation' +noun: proper: 'mapping northwest relation' +noun: proper: 'mapping south relation' +noun: proper: 'mapping southeast relation' +noun: proper: 'mapping southwest relation' +noun: proper: 'mapping east relation' +noun: proper: 'mapping west relation' +noun: proper: 'mapping up relation' +noun: proper: 'mapping down relation' +noun: proper: 'mapping inside relation' +noun: proper: 'mapping outside relation' +noun: proper: 'other side' +noun: proper: 'property other side' +noun: proper: 'leading-through relation' +noun: proper: 'carrying capacity' +noun: proper: 'property carrying capacity' +noun: proper: 'matching key' +noun: proper: 'property matching key' +noun: proper: 'lock-fitting relation' +noun: proper: 'list grouping key' +noun: proper: 'property list grouping key' +noun: proper: 'protection relation' +noun: proper: 'ownership relation' +noun: proper: 'unbolting relation' +noun: proper: 'destination' +noun: proper: 'property destination' +noun: proper: 'conversation' +noun: proper: 'property conversation' +noun: proper: 'walk style' +noun: proper: 'property walk style' +noun: proper: 'last opener' +noun: proper: 'property last opener' noun: proper: 'ineffectual' noun: proper: 'american dialect' noun: proper: 'serial comma'