From 39a7ca64171e3101a261205d68f2da208163d6f7 Mon Sep 17 00:00:00 2001 From: Graham Nelson Date: Thu, 7 Apr 2022 21:26:04 +0100 Subject: [PATCH] Fix for Mantis bug 2054 --- inform7/Figures/timings-diagnostics.txt | 32 +++++++++---------- .../Chapter 2/Passes through Major Nodes.w | 15 +++++++-- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt index 83d68bb957..996fdaf26b 100644 --- a/inform7/Figures/timings-diagnostics.txt +++ b/inform7/Figures/timings-diagnostics.txt @@ -1,37 +1,37 @@ 100.0% in inform7 run - 68.2% in compilation to Inter - 47.7% in //Sequence::undertake_queued_tasks// - 4.5% in //MajorNodes::pre_pass// + 68.6% in compilation to Inter + 48.1% in //Sequence::undertake_queued_tasks// + 4.4% in //MajorNodes::pre_pass// 3.2% in //MajorNodes::pass_1// 2.4% in //RTPhrasebook::compile_entries// - 1.8% in //ImperativeDefinitions::assess_all// - 1.5% in //RTKindConstructors::compile// - 1.0% in //Sequence::lint_inter// + 1.9% in //ImperativeDefinitions::assess_all// + 1.4% in //RTKindConstructors::compile// + 1.2% in //Sequence::lint_inter// 0.5% in //MajorNodes::pass_2// + 0.5% in //Sequence::undertake_queued_tasks// 0.5% in //World::stage_V// 0.4% in //ImperativeDefinitions::compile_first_block// 0.4% in //Sequence::undertake_queued_tasks// - 0.4% in //Sequence::undertake_queued_tasks// 0.2% in //CompletionModule::compile// 0.2% in //RTKindConstructors::compile_permissions// 0.1% in //InferenceSubjects::emit_all// 0.1% in //Task::make_built_in_kind_constructors// 0.1% in //Understand::traverse// 0.1% in //World::stages_II_and_III// - 2.2% not specifically accounted for - 29.0% in running Inter pipeline - 10.2% in step 14/14: generate inform6 -> auto.inf - 7.5% in step 5/14: load-binary-kits - 6.6% in step 6/14: make-synoptic-module + 2.1% not specifically accounted for + 28.7% in running Inter pipeline + 10.0% in step 14/14: generate inform6 -> auto.inf + 7.4% in step 5/14: load-binary-kits + 6.7% in step 6/14: make-synoptic-module 1.6% in step 9/14: make-identifiers-unique 0.5% in step 4/14: compile-splats 0.4% in step 12/14: eliminate-redundant-operations - 0.4% in step 7/14: shorten-wiring - 0.3% in step 11/14: eliminate-redundant-labels + 0.3% in step 7/14: shorten-wiring 0.3% in step 8/14: detect-indirect-calls + 0.2% in step 11/14: eliminate-redundant-labels 0.1% in step 10/14: reconcile-verbs 0.1% in step 2/14: parse-insertions 0.1% in step 3/14: resolve-conditional-compilation - 0.3% not specifically accounted for - 2.3% in supervisor + 0.6% not specifically accounted for + 2.1% in supervisor 0.4% not specifically accounted for diff --git a/inform7/assertions-module/Chapter 2/Passes through Major Nodes.w b/inform7/assertions-module/Chapter 2/Passes through Major Nodes.w index a9f9e73754..b5a4761601 100644 --- a/inform7/assertions-module/Chapter 2/Passes through Major Nodes.w +++ b/inform7/assertions-module/Chapter 2/Passes through Major Nodes.w @@ -192,7 +192,11 @@ identifying unparsed noun phrases. //Refiner::refine_coupling// returns |TRUE| if it succeeds in this. After that, there are two cases: existential sentences (such as "there are -two cases") and all others (such as "regular meaning are more subtle"). +two cases") and all others (such as "regular meanings are more subtle"). + +The trickiest form is "There is a container with carrying capacity 30", say, +which equates |DEFECTIVE_NOUN_NT| with |WITH_NT|. This is somehow both cases +at once, and we have to perform both an existential assertion and a coupling. @ = parse_node *px = p->down->next; @@ -201,7 +205,14 @@ two cases") and all others (such as "regular meaning are more subtle"). (Refiner::refine_coupling(px, py, FALSE))) { if (Node::get_type(px) == DEFECTIVE_NOUN_NT) { Assertions::make_existential(py); - Anaphora::change_discussion_from_coupling(py, py); + if (Node::get_type(py) == WITH_NT) { + px = py->down; + py = py->down->next; + Assertions::make_coupling(px, py); + Anaphora::change_discussion_from_coupling(px, py); + } else { + Anaphora::change_discussion_from_coupling(py, py); + } } else { Assertions::make_coupling(px, py); Anaphora::change_discussion_from_coupling(px, py);