From b2cf29137d05a438edd17bf54a207033ab70878b Mon Sep 17 00:00:00 2001 From: Graham Nelson Date: Fri, 21 Aug 2020 22:38:20 +0100 Subject: [PATCH] Further progress towards calculus module --- README.md | 2 +- build.txt | 4 +- docs/calculus-module/1-cm.html | 18 +- docs/calculus-module/2-ap.html | 4 +- docs/calculus-module/2-bp.html | 306 +++----- docs/calculus-module/2-bpf.html | 56 +- .../12-is.html => calculus-module/2-cs.html} | 291 ++++---- docs/calculus-module/2-itpc.html | 2 +- docs/calculus-module/2-ter.html | 142 ++++ docs/calculus-module/2-trm.html | 24 +- docs/calculus-module/2-up.html | 2 +- docs/calculus-module/P-htitm.html | 3 + docs/calculus-module/index.html | 10 + docs/calculus-test/1-dcl.html | 2 +- docs/calculus-test/1-pc.html | 30 +- docs/calculus-test/1-rlt.html | 150 ---- docs/calculus-test/index.html | 10 +- docs/core-module/1-cm.html | 75 +- docs/core-module/1-cp.html | 2 +- docs/core-module/1-cs.html | 2 +- docs/core-module/1-htc.html | 2 +- docs/core-module/1-pp.html | 2 +- docs/core-module/1-wtc.html | 6 +- docs/core-module/10-aots.html | 2 +- docs/core-module/10-cad.html | 2 +- docs/core-module/10-cap.html | 2 +- docs/core-module/10-its.html | 2 +- docs/core-module/10-pl.html | 2 +- docs/core-module/10-teav.html | 2 +- docs/core-module/10-varc.html | 2 +- docs/core-module/11-bas.html | 6 +- docs/core-module/11-pr.html | 4 +- docs/core-module/11-sc.html | 2 +- docs/core-module/11-sm.html | 2 +- docs/core-module/11-tc.html | 2 +- docs/core-module/11-tcp.html | 301 ++++---- docs/core-module/12-ap.html | 6 +- docs/core-module/12-ca.html | 223 +++--- docs/core-module/12-cad.html | 4 +- docs/core-module/12-cdp.html | 14 +- docs/core-module/12-dtd.html | 36 +- docs/core-module/12-qr.html | 46 +- .../core-module/{12-ter.html => 12-terr.html} | 222 ++---- docs/core-module/13-ca.html | 2 +- docs/core-module/13-kak.html | 4 +- docs/core-module/13-ki.html | 2 +- docs/core-module/13-rsfk.html | 58 +- docs/core-module/14-cfs.html | 6 +- docs/core-module/14-cn.html | 2 +- docs/core-module/14-ds.html | 22 +- docs/core-module/14-ds2.html | 14 +- docs/core-module/14-lv.html | 14 +- docs/core-module/14-rv.html | 30 +- docs/core-module/14-sp.html | 4 +- docs/core-module/15-cp.html | 6 +- docs/core-module/15-cr.html | 50 +- docs/core-module/15-ep.html | 34 +- docs/core-module/15-epv.html | 2 +- docs/core-module/15-ia.html | 2 +- docs/core-module/15-ma.html | 18 +- docs/core-module/15-pov.html | 2 +- docs/core-module/15-pr.html | 4 +- docs/core-module/15-ps.html | 5 +- docs/core-module/15-spr.html | 18 +- docs/core-module/15-spr2.html | 18 +- docs/core-module/15-tpr.html | 28 +- docs/core-module/15-vp.html | 2 +- docs/core-module/16-cmw.html | 2 +- docs/core-module/16-cmw2.html | 2 +- docs/core-module/16-ic.html | 8 +- docs/core-module/16-in.html | 12 +- docs/core-module/16-is.html | 31 +- docs/core-module/16-kar.html | 159 ++++ docs/core-module/16-pp.html | 2 +- docs/core-module/17-rs.html | 6 +- docs/core-module/17-tl.html | 2 +- docs/core-module/17-ts.html | 2 +- docs/core-module/18-lc.html | 2 +- docs/core-module/19-lr.html | 12 +- docs/core-module/19-rsft.html | 2 +- docs/core-module/19-tb.html | 2 +- docs/core-module/19-tc.html | 2 +- docs/core-module/2-pwst.html | 2 +- docs/core-module/2-si.html | 12 +- docs/core-module/2-sq.html | 6 +- docs/core-module/2-up.html | 2 +- docs/core-module/20-eq.html | 2 +- docs/core-module/21-ac.html | 2 +- docs/core-module/21-fao.html | 2 +- docs/core-module/21-rb.html | 2 +- docs/core-module/21-rl.html | 2 +- docs/core-module/21-rl2.html | 2 +- docs/core-module/21-sv.html | 2 +- docs/core-module/22-cs.html | 2 +- docs/core-module/22-dptd.html | 2 +- docs/core-module/22-itp.html | 2 +- docs/core-module/22-pav.html | 2 +- docs/core-module/22-ph.html | 2 +- docs/core-module/22-pi.html | 2 +- docs/core-module/22-po.html | 2 +- docs/core-module/22-prcd.html | 2 +- docs/core-module/22-ptd.html | 2 +- docs/core-module/22-pu.html | 2 +- docs/core-module/22-tp.html | 2 +- docs/core-module/22-tp2.html | 2 +- docs/core-module/23-abc.html | 2 +- docs/core-module/23-abp.html | 6 +- docs/core-module/23-abrc.html | 6 +- docs/core-module/23-abrp.html | 14 +- docs/core-module/23-ad.html | 2 +- docs/core-module/24-ch.html | 2 +- docs/core-module/24-lv.html | 4 +- docs/core-module/24-pb.html | 2 +- docs/core-module/24-sf.html | 8 +- docs/core-module/25-ci.html | 2 +- docs/core-module/25-ciac.html | 2 +- docs/core-module/25-cii.html | 6 +- docs/core-module/25-cp.html | 4 +- docs/core-module/25-in.html | 2 +- docs/core-module/25-pi.html | 2 +- docs/core-module/26-ct.html | 2 +- docs/core-module/26-fc.html | 2 +- docs/core-module/26-i6i.html | 2 +- docs/core-module/26-itc.html | 10 +- docs/core-module/26-iti.html | 2 +- docs/core-module/26-jl.html | 2 +- docs/core-module/26-lt.html | 2 +- docs/core-module/26-pc.html | 6 +- docs/core-module/26-pl.html | 2 +- docs/core-module/26-rt.html | 6 +- docs/core-module/26-ts.html | 2 +- docs/core-module/26-uoart.html | 2 +- docs/core-module/27-cm.html | 2 +- docs/core-module/27-em.html | 4 +- docs/core-module/27-hr.html | 4 +- docs/core-module/3-ar.html | 2 +- docs/core-module/3-bv.html | 2 +- docs/core-module/3-cs.html | 2 +- docs/core-module/3-ptmn.html | 2 +- docs/core-module/4-dbtr.html | 2 +- docs/core-module/4-dlr.html | 2 +- docs/core-module/4-nar.html | 2 +- docs/core-module/4-nar2.html | 2 +- docs/core-module/4-nlpr.html | 2 +- docs/core-module/4-npr.html | 2 +- docs/core-module/4-nrr.html | 4 +- docs/core-module/4-nuor.html | 2 +- docs/core-module/4-nvr.html | 2 +- docs/core-module/4-pr.html | 2 +- docs/core-module/4-rpr.html | 2 +- docs/core-module/4-tr.html | 2 +- docs/core-module/4-tr2.html | 2 +- docs/core-module/4-uor.html | 2 +- docs/core-module/5-ass.html | 2 +- docs/core-module/5-ass2.html | 2 +- docs/core-module/5-imp.html | 2 +- docs/core-module/5-npa.html | 2 +- docs/core-module/5-pk.html | 2 +- docs/core-module/5-rk.html | 2 +- docs/core-module/5-rpt.html | 2 +- docs/core-module/5-tc.html | 2 +- docs/core-module/6-ins.html | 8 +- docs/core-module/6-ipw.html | 2 +- docs/core-module/6-lp.html | 2 +- docs/core-module/6-nv.html | 10 +- docs/core-module/6-tod.html | 2 +- docs/core-module/6-uem.html | 2 +- docs/core-module/6-ul.html | 2 +- docs/core-module/6-un.html | 2 +- docs/core-module/7-am.html | 28 +- docs/core-module/7-er.html | 79 +- docs/core-module/7-rlt.html | 200 ++--- docs/core-module/7-tur.html | 56 +- docs/core-module/7-vart.html | 2 +- docs/core-module/8-hdn.html | 2 +- docs/core-module/8-ptu.html | 2 +- docs/core-module/8-rs.html | 2 +- docs/core-module/9-ef.html | 2 +- docs/core-module/P-wtmd.html | 2 +- docs/core-module/index.html | 16 +- docs/if-module/3-mcr.html | 4 +- docs/if-module/3-rgn.html | 2 +- docs/if-module/3-sr.html | 24 +- inform7/Downloads/preform-diagnostics.txt | 694 +++++++++--------- inform7/Figures/memory-diagnostics.txt | 44 +- inform7/Figures/preform-summary.txt | 8 +- inform7/Figures/timings-diagnostics.txt | 26 +- inform7/core-module/Chapter 1/Core Module.w | 16 +- .../Chapter 11/Type Check Propositions.w | 11 - .../core-module/Chapter 12/Compile Atoms.w | 22 - .../Chapter 12/Quasinumeric Relations.w | 8 +- ...on.w => The Equality Relation Revisited.w} | 87 +-- .../Chapter 15/Comparative Relations.w | 23 +- .../Chapter 15/Measurement Adjectives.w | 4 +- .../Chapter 15/Property Sentences.w | 3 - .../Chapter 15/Same Property Relation.w | 8 +- .../Chapter 15/Setting Property Relation.w | 2 +- .../Chapter 15/The Provision Relation.w | 2 +- .../Chapter 16/Inference Subjects.w | 21 +- .../Chapter 16/Knowledge about Relations.w | 85 +++ .../Chapter 19/Listed-In Relations.w | 2 +- .../Chapter 4/New Relation Requests.w | 2 +- .../Chapter 7/Explicit Relations.w | 15 +- inform7/core-module/Chapter 7/Relations.w | 19 + .../Chapter 7/The Universal Relation.w | 6 +- inform7/core-module/Contents.w | 4 +- .../Chapter 3/Map Connection Relations.w | 4 +- inform7/if-module/Chapter 3/Regions.w | 2 +- .../if-module/Chapter 3/Spatial Relations.w | 24 +- .../Chapter 1/Calculus Module.w | 13 +- .../Chapter 2/Binary Predicate Families.w | 26 +- .../Chapter 2/Binary Predicates.w | 208 ++---- .../Chapter 2/Compilation Schemas.w | 52 +- .../Chapter 2/The Equality Relation.w | 65 ++ services/calculus-module/Contents.w | 2 + .../How To Include This Module.w | 3 + .../calculus-test/Chapter 1/Program Control.w | 25 + services/calculus-test/Chapter 1/Relating.w | 88 --- services/calculus-test/Contents.w | 2 +- 219 files changed, 2555 insertions(+), 2370 deletions(-) rename docs/{core-module/12-is.html => calculus-module/2-cs.html} (64%) create mode 100644 docs/calculus-module/2-ter.html delete mode 100644 docs/calculus-test/1-rlt.html rename docs/core-module/{12-ter.html => 12-terr.html} (65%) create mode 100644 docs/core-module/16-kar.html rename inform7/core-module/Chapter 12/{The Equality Relation.w => The Equality Relation Revisited.w} (78%) create mode 100644 inform7/core-module/Chapter 16/Knowledge about Relations.w rename inform7/core-module/Chapter 12/I6 Schemas.w => services/calculus-module/Chapter 2/Compilation Schemas.w (93%) create mode 100644 services/calculus-module/Chapter 2/The Equality Relation.w delete mode 100644 services/calculus-test/Chapter 1/Relating.w diff --git a/README.md b/README.md index ad1bfa50f..7d4f3fb0e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Inform 7 -v10.1.0-alpha.1+6Q99 'Krypton' (20 August 2020) +v10.1.0-alpha.1+6R01 'Krypton' (21 August 2020) ## About Inform 7 diff --git a/build.txt b/build.txt index 5d0ebf30f..1003ec1fb 100644 --- a/build.txt +++ b/build.txt @@ -1,3 +1,3 @@ Prerelease: alpha.1 -Build Date: 20 August 2020 -Build Number: 6Q99 +Build Date: 21 August 2020 +Build Number: 6R01 diff --git a/docs/calculus-module/1-cm.html b/docs/calculus-module/1-cm.html index 29fdca504..539a02e95 100644 --- a/docs/calculus-module/1-cm.html +++ b/docs/calculus-module/1-cm.html @@ -69,7 +69,8 @@ which use this module:

§2. This module defines the following classes:

-
enum binary_predicate_CLASS
+
enum i6_schema_CLASS
+enum binary_predicate_CLASS
 enum bp_family_CLASS
 enum pcalc_term_CLASS
 enum pcalc_func_CLASS
@@ -83,6 +84,7 @@ which use this module:
 DECLARE_CLASS_ALLOCATED_IN_ARRAYS(pcalc_term, 1000)
 DECLARE_CLASS_ALLOCATED_IN_ARRAYS(pcalc_prop, 1000)
 DECLARE_CLASS_ALLOCATED_IN_ARRAYS(unary_predicate, 1000)
+DECLARE_CLASS_ALLOCATED_IN_ARRAYS(i6_schema, 100)
 

§3. Like all modules, this one must define a start and end function:

@@ -94,11 +96,23 @@ which use this module: void CalculusModule::start(void) { Log::declare_aspect(PREDICATE_CALCULUS_DA, L"predicate calculus", FALSE, FALSE); Log::declare_aspect(PREDICATE_CALCULUS_WORKINGS_DA, L"predicate calculus workings", FALSE, FALSE); - BinaryPredicates::start_explicit_relation(); + Calculus::Equality::start(); } void CalculusModule::end(void) { }
+

§4. We also have to make annotation functions for one special annotation needed +by linguistics: +

+ +
+DECLARE_ANNOTATION_FUNCTIONS(relationship, binary_predicate)
+
+

§5.

+ +
+MAKE_ANNOTATION_FUNCTIONS(relationship, binary_predicate)
+
diff --git a/docs/calculus-module/2-ap.html b/docs/calculus-module/2-ap.html index f48753d1c..aad534d22 100644 --- a/docs/calculus-module/2-ap.html +++ b/docs/calculus-module/2-ap.html @@ -618,7 +618,7 @@ need \(t=x\), that is, variable 0.
     binary_predicate *bp = RETRIEVE_POINTER_binary_predicate(prop->predicate);
-    if (bp == NULL) WRITE("?bad-bp?"); else WRITE("%S", BinaryPredicates::get_log_name(bp));
+    if (bp == NULL) WRITE("?bad-bp?"); else WRITE("%S", BinaryPredicates::get_log_name(bp));
 

§24.3. Just a diagnostic way of printing the terms in an atomic proposition, by @@ -638,7 +638,7 @@ arity.)

diff --git a/docs/calculus-module/2-bp.html b/docs/calculus-module/2-bp.html index 5d47dafa4..8bb730375 100644 --- a/docs/calculus-module/2-bp.html +++ b/docs/calculus-module/2-bp.html @@ -81,7 +81,7 @@ function togglePopup(material_id) {

To create and manage binary predicates, which are the underlying data structures beneath Inform's relations.

-
+

§1. A "binary predicate" (the term comes from logic) is a property \(B\) such that for any combination \(x\) and \(y\), and at any given moment at @@ -232,12 +232,18 @@ container (if any) is at present directly containing \(y\). together in a sub-structure called bp_term_details.

+

(For Inform, the following will be an inference subject, which is a wider +category than kinds.) +

+ +
default TERM_DOMAIN_CALCULUS_TYPE struct kind
+
 typedef struct bp_term_details {
     struct wording called_name;  "(called...)" name, if any exists
-    struct inference_subject *implies_infs;  the domain of values allowed
+    TERM_DOMAIN_CALCULUS_TYPE *implies_infs;  the domain of values allowed
     struct kind *implies_kind;  the kind of these values
-    struct i6_schema *function_of_other;  the function \(f_0\) or \(f_1\) as above
+    struct i6_schema *function_of_other;  the function \(f_0\) or \(f_1\) as above
     char *index_term_as;  usually null, but if not, used in Phrasebook index
 } bp_term_details;
 
@@ -320,10 +326,15 @@ and "inside" the wrong way round. struct word_assemblage relation_name; (which might have length 0) struct parse_node *bp_created_at; where declared in the source text struct text_stream *debugging_log_name; used when printing propositions to the debug log + + #ifdef CORE_MODULE struct package_request *bp_package; struct inter_name *bp_iname; when referred to as a constant struct inter_name *handler_iname; struct inter_name *v2v_bitmap_iname; only relevant for some relations + struct inter_name *bp_by_routine_iname; for relations by routine + struct inter_name *initialiser_iname; if stored in dynamically allocated memory + #endif struct bp_term_details term_details[2]; term 0 is the left term, 1 is the right @@ -331,23 +342,23 @@ and "inside" the wrong way round. int right_way_round; was this BP created directly? or is it a reversal of another? how to compile code which tests or forces this BP to be true or false: - struct inter_name *bp_by_routine_iname; for relations by routine - struct i6_schema *test_function; I6 schema for (a) testing \(B(x, y)\)... + struct i6_schema *test_function; I6 schema for (a) testing \(B(x, y)\)... struct wording condition_defn_text; ...unless this I7 condition is used instead - struct i6_schema *make_true_function; I6 schema for (b) "now \(B(x, y)\)" - struct i6_schema *make_false_function; I6 schema for (c) "now \({\rm not}(B(x, y))\)" + struct i6_schema *make_true_function; I6 schema for (b) "now \(B(x, y)\)" + struct i6_schema *make_false_function; I6 schema for (c) "now \({\rm not}(B(x, y))\)" for use in the A-parser: int arbitrary; allow source to assert \(B(x, y)\) for any arbitrary pairs \(x, y\) struct property *set_property; asserting \(B(x, v)\) sets this prop. of \(x\) to \(v\) struct wording property_pending_text; temp. version used until props created int relates_values_not_objects; true if either term is necessarily a value... - struct inference_subject *knowledge_about_bp; ...and if so, here's the list of known assertions + TERM_DOMAIN_CALCULUS_TYPE *knowledge_about_bp; ...and if so, here's the list of known assertions for optimisation of run-time code: int dynamic_memory; stored in dynamically allocated memory - struct inter_name *initialiser_iname; and if so, this is the name of its initialiser + #ifdef CORE_MODULE struct property *i6_storage_property; provides run-time storage + #endif struct kind *storage_kind; kind of property owner int allow_function_simplification; allow Inform to make use of any \(f_i\) functions? int fast_route_finding; use fast rather than slow route-finding algorithm? @@ -357,11 +368,10 @@ and "inside" the wrong way round. details, filled in for right-way-round BPs only, for particular kinds of BP: int a_listed_in_predicate; (if right way) was this generated from a table column? - struct property *same_property; (if right way) if a "same property as..." - struct property *comparative_property; (if right way) if a comparative adjective - int comparison_sign; ...and +1 or -1 according to sign of definition int *equivalence_partition; (if right way) partition array of equivalence classes + general_pointer family_specific; + CLASS_DEFINITION } binary_predicate; @@ -431,9 +441,8 @@ one of the tables which has a column of this name.

define VERB_MEANING_LINGUISTICS_TYPE struct binary_predicate
-define VERB_MEANING_REVERSAL_LINGUISTICS_CALLBACK BinaryPredicates::get_reversal
+define VERB_MEANING_REVERSAL_LINGUISTICS_CALLBACK BinaryPredicates::get_reversal
 define VERB_MEANING_EQUALITY R_equality
-define VERB_MEANING_UNIVERSAL R_universal
 define VERB_MEANING_POSSESSION a_has_b_predicate
 

§16. Creating term details. The essential point in defining a term is to describe the domain of values it @@ -444,7 +453,7 @@ numbers", or "all rooms".

-bp_term_details BinaryPredicates::new_term(inference_subject *infs) {
+bp_term_details BinaryPredicates::new_term(TERM_DOMAIN_CALCULUS_TYPE *infs) {
     bp_term_details bptd;
     bptd.called_name = EMPTY_WORDING;
     bptd.function_of_other = NULL;
@@ -458,8 +467,8 @@ numbers", or "all rooms".
 

-bp_term_details BinaryPredicates::full_new_term(inference_subject *infs, kind *K,
-    wording CW, i6_schema *f) {
+bp_term_details BinaryPredicates::full_new_term(TERM_DOMAIN_CALCULUS_TYPE *infs, kind *K,
+    wording CW, i6_schema *f) {
     bp_term_details bptd = BinaryPredicates::new_term(infs);
     bptd.implies_kind = K;
     bptd.called_name = CW;
@@ -475,19 +484,19 @@ so that we must fill them in later, using the following:
 void BinaryPredicates::set_term_domain(bp_term_details *bptd, kind *K) {
     if (bptd == NULL) internal_error("no BPTD");
     bptd->implies_kind = K;
-    bptd->implies_infs = Kinds::Knowledge::as_subject(K);
+    bptd->implies_infs = TERM_DOMAIN_FROM_KIND_FUNCTION(K);
 }
 

§19. Similarly:

-void BinaryPredicates::set_term_function(bp_term_details *bptd, i6_schema *f) {
+void BinaryPredicates::set_term_function(bp_term_details *bptd, i6_schema *f) {
     if (bptd == NULL) internal_error("no BPTD");
     bptd->function_of_other = f;
 }
 
-i6_schema *BinaryPredicates::get_term_function(bp_term_details *bptd) {
+i6_schema *BinaryPredicates::get_term_function(bp_term_details *bptd) {
     if (bptd == NULL) internal_error("no BPTD");
     return bptd->function_of_other;
 }
@@ -509,10 +518,10 @@ so that we must fill them in later, using the following:
 

-kind *BinaryPredicates::kind_of_term(bp_term_details *bptd) {
+kind *BinaryPredicates::kind_of_term(bp_term_details *bptd) {
     if (bptd == NULL) return NULL;
     if (bptd->implies_kind) return bptd->implies_kind;
-    return InferenceSubjects::domain(bptd->implies_infs);
+    return TERM_DOMAIN_TO_KIND_FUNCTION(bptd->implies_infs);
 }
 

§22. The table of relations in the index uses the textual name of an INFS, so: @@ -522,7 +531,7 @@ so that we must fill them in later, using the following: void BinaryPredicates::index_term_details(OUTPUT_STREAM, bp_term_details *bptd) { if (bptd->index_term_as) { WRITE("%s", bptd->index_term_as); return; } wording W = EMPTY_WORDING; - if (bptd->implies_infs) W = InferenceSubjects::get_name_text(bptd->implies_infs); + if (bptd->implies_infs) W = TERM_DOMAIN_WORDING_FUNCTION(bptd->implies_infs); if (Wordings::nonempty(W)) WRITE("%W", W); else WRITE("--"); }

@@ -564,7 +573,7 @@ matches the specific necessary kind of object if there is one.

-void BinaryPredicates::set_index_details(binary_predicate *bp, char *left, char *right) {
+void BinaryPredicates::set_index_details(binary_predicate *bp, char *left, char *right) {
     if (left) {
         bp->term_details[0].index_term_as = left;
         bp->reversal->term_details[1].index_term_as = left;
@@ -593,13 +602,14 @@ this effect. For now, we give \(EQ\) entirely blank term details.
 

-binary_predicate *BinaryPredicates::make_equality(void) {
-    binary_predicate *bp = BinaryPredicates::make_single(equality_bp_family,
+binary_predicate *BinaryPredicates::make_equality(bp_family *family, word_assemblage WA) {
+    binary_predicate *bp = BinaryPredicates::make_single(family,
         BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL),
-        I"is", NULL, NULL, NULL,
-        PreformUtilities::wording(<relation-names>, EQUALITY_RELATION_NAME));
-
+        I"is", NULL, NULL, WA);
     bp->reversal = bp; bp->right_way_round = TRUE;
+    #ifdef REGISTER_RELATIONS_CALCULUS_CALLBACK
+    REGISTER_RELATIONS_CALCULUS_CALLBACK(bp, WA);
+    #endif
     return bp;
 }
 
@@ -615,10 +625,10 @@ how to compile the BP for the one which is the right way round.

-binary_predicate *BinaryPredicates::make_pair(bp_family *family,
+binary_predicate *BinaryPredicates::make_pair(bp_family *family,
     bp_term_details left_term, bp_term_details right_term,
-    text_stream *name, text_stream *namer, property *pn,
-    i6_schema *mtf, i6_schema *tf, word_assemblage source_name) {
+    text_stream *name, text_stream *namer,
+    i6_schema *mtf, i6_schema *tf, word_assemblage source_name) {
     binary_predicate *bp, *bpr;
     TEMPORARY_TEXT(n)
     TEMPORARY_TEXT(nr)
@@ -628,19 +638,17 @@ how to compile the BP for the one which is the right way round.
     if (Str::len(nr) == 0) WRITE_TO(nr, "%S-r", n);
 
     bp  = BinaryPredicates::make_single(family, left_term, right_term, n,
-        pn, mtf, tf, source_name);
+        mtf, tf, source_name);
     bpr = BinaryPredicates::make_single(family, right_term, left_term, nr,
-        NULL, NULL, NULL, WordAssemblages::lit_0());
+        NULL, NULL, WordAssemblages::lit_0());
 
     bp->reversal = bpr; bpr->reversal = bp;
     bp->right_way_round = TRUE; bpr->right_way_round = FALSE;
 
     if (WordAssemblages::nonempty(source_name)) {
-        word_assemblage wa =
-            PreformUtilities::merge(<relation-name-formal>, 0, source_name);
-        wording AW = WordAssemblages::to_wording(&wa);
-        Nouns::new_proper_noun(AW, NEUTER_GENDER, ADD_TO_LEXICON_NTOPT,
-            MISCELLANEOUS_MC, Rvalues::from_binary_predicate(bp), Task::language_of_syntax());
+        #ifdef REGISTER_RELATIONS_CALCULUS_CALLBACK
+        REGISTER_RELATIONS_CALCULUS_CALLBACK(bp, source_name);
+        #endif
     }
 
     return bp;
@@ -654,24 +662,14 @@ made:
 

-bp_family *explicit_bp_family = NULL;
-
-void BinaryPredicates::start_explicit_relation(void) {
-    explicit_bp_family = BinaryPredicateFamilies::new();
-    METHOD_ADD(explicit_bp_family, TYPECHECK_BPF_MTID, Relations::Explicit::REL_typecheck);
-    METHOD_ADD(explicit_bp_family, ASSERT_BPF_MTID, Relations::Explicit::REL_assert);
-    METHOD_ADD(explicit_bp_family, SCHEMA_BPF_MTID, Relations::Explicit::REL_compile);
-    METHOD_ADD(explicit_bp_family, DESCRIBE_FOR_PROBLEMS_BPF_MTID, Relations::Explicit::REL_describe_for_problems);
-    METHOD_ADD(explicit_bp_family, DESCRIBE_FOR_INDEX_BPF_MTID, Relations::Explicit::REL_describe_briefly);
-}
-
-binary_predicate *BinaryPredicates::make_pair_sketchily(word_assemblage wa, int f) {
+binary_predicate *BinaryPredicates::make_pair_sketchily(bp_family *family,
+    word_assemblage wa, int f) {
     TEMPORARY_TEXT(relname)
     WRITE_TO(relname, "%V", WordAssemblages::first_word(&wa));
     binary_predicate *bp =
-        BinaryPredicates::make_pair(explicit_bp_family,
+        BinaryPredicates::make_pair(family,
         BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL),
-        relname, NULL, NULL, NULL, NULL, wa);
+        relname, NULL, NULL, NULL, wa);
     DISCARD_TEXT(relname)
     bp->form_of_relation = f;
     bp->reversal->form_of_relation = f;
@@ -691,27 +689,31 @@ would always be NULL
 
 
-binary_predicate *BinaryPredicates::make_single(bp_family *family,
+binary_predicate *BinaryPredicates::make_single(bp_family *family,
     bp_term_details left_term, bp_term_details right_term,
-    text_stream *name, property *pn,
-    i6_schema *mtf, i6_schema *tf, word_assemblage rn) {
+    text_stream *name,
+    i6_schema *mtf, i6_schema *tf, word_assemblage rn) {
     binary_predicate *bp = CREATE(binary_predicate);
     bp->relation_family = family;
     bp->form_of_relation = Relation_Implicit;
     bp->relation_name = rn;
     bp->bp_created_at = current_sentence;
     bp->debugging_log_name = Str::duplicate(name);
+
+    #ifdef CORE_MODULE
     bp->bp_package = NULL;
     bp->bp_iname = NULL;
     bp->handler_iname = NULL;
     bp->v2v_bitmap_iname = NULL;
+    bp->bp_by_routine_iname = NULL;
+    bp->initialiser_iname = NULL;
+    #endif
 
     bp->term_details[0] = left_term; bp->term_details[1] = right_term;
 
      the reversal and the right_way_round field must be set by the caller
 
      for use in code compilation
-    bp->bp_by_routine_iname = NULL;
     bp->test_function = tf;
     bp->condition_defn_text = EMPTY_WORDING;
     bp->make_true_function = mtf;
@@ -722,14 +724,20 @@ would always be NULL    bp->set_property = NULL;
     bp->property_pending_text = EMPTY_WORDING;
     bp->relates_values_not_objects = FALSE;
+    #ifdef CORE_MODULE
     bp->knowledge_about_bp =
         InferenceSubjects::new(relations,
             RELN_SUB, STORE_POINTER_binary_predicate(bp), CERTAIN_CE);
+    #endif
+    #ifndef CORE_MODULE
+    bp->knowledge_about_bp = NULL;
+    #endif
 
      for optimisation of run-time code
     bp->dynamic_memory = FALSE;
-    bp->initialiser_iname = NULL;
-    bp->i6_storage_property = pn;
+    #ifdef CORE_MODULE
+    bp->i6_storage_property = NULL;
+    #endif
     bp->storage_kind = NULL;
     bp->allow_function_simplification = TRUE;
     bp->fast_route_finding = FALSE;
@@ -739,27 +747,29 @@ would always be NULL     details for particular kinds of relation
     bp->a_listed_in_predicate = FALSE;
-    bp->same_property = NULL;
-    bp->comparative_property = NULL;
-    bp->comparison_sign = 0;
     bp->equivalence_partition = NULL;
 
+    bp->family_specific = NULL_GENERAL_POINTER;
+
     return bp;
 }
 

§29. The package.

-package_request *BinaryPredicates::package(binary_predicate *bp) {
+#ifdef CORE_MODULE
+package_request *BinaryPredicates::package(binary_predicate *bp) {
     if (bp == NULL) internal_error("null bp");
     if (bp->bp_package == NULL)
         bp->bp_package = Hierarchy::package(CompilationUnits::find(bp->bp_created_at), RELATIONS_HAP);
     return bp->bp_package;
 }
+#endif
 

§30. The handler.

+#ifdef CORE_MODULE
 inter_name *BinaryPredicates::handler_iname(binary_predicate *bp) {
     if (bp->handler_iname == NULL) {
         package_request *R = BinaryPredicates::package(bp);
@@ -767,99 +777,16 @@ would always be NULL    }
     return bp->handler_iname;
 }
-
-

§31. As an INFS.

- -
-#ifdef CORE_MODULE
-wording BinaryPredicates::SUBJ_get_name_text(inference_subject *from) {
-    return EMPTY_WORDING;  nameless
-}
-
-general_pointer BinaryPredicates::SUBJ_new_permission_granted(inference_subject *from) {
-    return NULL_GENERAL_POINTER;
-}
-
-void BinaryPredicates::SUBJ_make_adj_const_domain(inference_subject *infs,
-    instance *nc, property *prn) {
-}
-
-void BinaryPredicates::SUBJ_complete_model(inference_subject *infs) {
-    int domain_size = NUMBER_CREATED(inference_subject);
-    binary_predicate *bp = InferenceSubjects::as_bp(infs);
-
-    if (BinaryPredicates::store_dynamically(bp)) return;  handled at run-time instead
-    if ((BinaryPredicates::get_form_of_relation(bp) == Relation_Equiv) && (bp->right_way_round)) {
-        Relations::equivalence_relation_make_singleton_partitions(bp, domain_size);
-        inference *i;
-        POSITIVE_KNOWLEDGE_LOOP(i, BinaryPredicates::as_subject(bp), ARBITRARY_RELATION_INF) {
-            inference_subject *infs0, *infs1;
-            World::Inferences::get_references(i, &infs0, &infs1);
-            Relations::equivalence_relation_merge_classes(bp, domain_size,
-                infs0->allocation_id, infs1->allocation_id);
-        }
-        Relations::equivalence_relation_add_properties(bp);
-    }
-}
-
-void BinaryPredicates::SUBJ_check_model(inference_subject *infs) {
-    binary_predicate *bp = InferenceSubjects::as_bp(infs);
-    if ((bp->right_way_round) &&
-        ((bp->form_of_relation == Relation_OtoO) ||
-            (bp->form_of_relation == Relation_Sym_OtoO)))
-        Relations::check_OtoO_relation(bp);
-    if ((bp->right_way_round) &&
-        ((bp->form_of_relation == Relation_OtoV) ||
-            (bp->form_of_relation == Relation_VtoO)))
-        Relations::check_OtoV_relation(bp);
-}
-
-int BinaryPredicates::SUBJ_emit_element_of_condition(inference_subject *infs, inter_symbol *t0_s) {
-    internal_error("BP in runtime match condition");
-    return FALSE;
-}
-
-int BinaryPredicates::SUBJ_compile_all(void) {
-    return FALSE;
-}
-
-void BinaryPredicates::SUBJ_compile(inference_subject *infs) {
-    binary_predicate *bp = InferenceSubjects::as_bp(infs);
-    if (bp->right_way_round) {
-        if (BinaryPredicates::store_dynamically(bp)) {
-            packaging_state save = Routines::begin(bp->initialiser_iname);
-            inference *i;
-            inter_name *rtiname = Hierarchy::find(RELATIONTEST_HL);
-            POSITIVE_KNOWLEDGE_LOOP(i, BinaryPredicates::as_subject(bp), ARBITRARY_RELATION_INF) {
-                parse_node *spec0, *spec1;
-                World::Inferences::get_references_spec(i, &spec0, &spec1);
-                BinaryPredicates::mark_as_needed(bp);
-                Produce::inv_call_iname(Emit::tree(), rtiname);
-                Produce::down(Emit::tree());
-                    Produce::val_iname(Emit::tree(), K_value, bp->bp_iname);
-                    Produce::val_iname(Emit::tree(), K_value, Hierarchy::find(RELS_ASSERT_TRUE_HL));
-                    Specifications::Compiler::emit_as_val(K_value, spec0);
-                    Specifications::Compiler::emit_as_val(K_value, spec1);
-                Produce::up(Emit::tree());
-            }
-            Routines::end(save);
-        } else {
-            if ((bp->form_of_relation == Relation_VtoV) ||
-                (bp->form_of_relation == Relation_Sym_VtoV))
-                Relations::compile_vtov_storage(bp);
-        }
-    }
-}
 #endif
 
-

§32. BP and term logging.

+

§31. BP and term logging.

 void BinaryPredicates::log_term_details(bp_term_details *bptd, int i) {
     LOG("  function(%d): $i\n", i, bptd->function_of_other);
     if (Wordings::nonempty(bptd->called_name)) LOG("  term %d is '%W'\n", i, bptd->called_name);
     if (bptd->implies_infs) {
-        wording W = InferenceSubjects::get_name_text(bptd->implies_infs);
+        wording W = TERM_DOMAIN_WORDING_FUNCTION(bptd->implies_infs);
         if (Wordings::nonempty(W)) LOG("  term %d has domain %W\n", i, W);
     }
 }
@@ -869,15 +796,17 @@ would always be NULL    if (bp == NULL) { LOG("<null-BP>\n"); return; }
     LOG("BP%d <%S> - %s way round - %s\n",
         bp->allocation_id, bp->debugging_log_name, bp->right_way_round?"right":"wrong",
-        BinaryPredicates::form_to_text(bp));
-    for (i=0; i<2; i++) BinaryPredicates::log_term_details(&bp->term_details[i], i);
+        BinaryPredicates::form_to_text(bp));
+    for (i=0; i<2; i++) BinaryPredicates::log_term_details(&bp->term_details[i], i);
     LOG("  test: $i\n", bp->test_function);
     LOG("  make true: $i\n", bp->make_true_function);
     LOG("  make false: $i\n", bp->make_false_function);
+    #ifdef CORE_MODULE
     LOG("  storage property: $Y\n", bp->i6_storage_property);
+    #endif
 }
 
-

§33. Relation names. A useful little nonterminal to spot the names of relation, such as +

§32. Relation names. A useful little nonterminal to spot the names of relation, such as "adjacency". (Note: not "adjacency relation".) This is only used when there is good reason to suspect that the word in question is the name of a relation, so the fact that it runs relatively slowly does not matter. @@ -893,17 +822,17 @@ so the fact that it runs relatively slowly does not matter. ==> { fail nonterminal }; }

-

§34.

+

§33.

-text_stream *BinaryPredicates::get_log_name(binary_predicate *bp) {
+text_stream *BinaryPredicates::get_log_name(binary_predicate *bp) {
     return bp->debugging_log_name;
 }
 
-

§35. Miscellaneous access routines.

+

§34. Miscellaneous access routines.

-int BinaryPredicates::get_form_of_relation(binary_predicate *bp) {
+int BinaryPredicates::get_form_of_relation(binary_predicate *bp) {
     return bp->form_of_relation;
 }
 int BinaryPredicates::is_explicit_with_runtime_storage(binary_predicate *bp) {
@@ -912,7 +841,7 @@ so the fact that it runs relatively slowly does not matter.
     if (bp->form_of_relation == Relation_ByRoutine) return FALSE;
     return TRUE;
 }
-char *BinaryPredicates::form_to_text(binary_predicate *bp) {
+char *BinaryPredicates::form_to_text(binary_predicate *bp) {
     switch(bp->form_of_relation) {
         case Relation_Implicit: return "Relation_Implicit";
         case Relation_OtoO: return "Relation_OtoO";
@@ -931,24 +860,24 @@ so the fact that it runs relatively slowly does not matter.
     return bp->bp_created_at;
 }
 
-

§36. Details of the terms: +

§35. Details of the terms:

-kind *BinaryPredicates::term_kind(binary_predicate *bp, int t) {
+kind *BinaryPredicates::term_kind(binary_predicate *bp, int t) {
     if (bp == NULL) internal_error("tried to find kind of null relation");
     return BinaryPredicates::kind_of_term(&(bp->term_details[t]));
 }
-i6_schema *BinaryPredicates::get_term_as_function_of_other(binary_predicate *bp, int t) {
+i6_schema *BinaryPredicates::get_term_as_function_of_other(binary_predicate *bp, int t) {
     if (bp == NULL) internal_error("tried to find function of null relation");
     return bp->term_details[t].function_of_other;
 }
 
-

§37. Reversing: +

§36. Reversing:

-binary_predicate *BinaryPredicates::get_reversal(binary_predicate *bp) {
+binary_predicate *BinaryPredicates::get_reversal(binary_predicate *bp) {
     if (bp == NULL) internal_error("tried to find reversal of null relation");
     return bp->reversal;
 }
@@ -957,11 +886,11 @@ so the fact that it runs relatively slowly does not matter.
     return FALSE;
 }
 
-

§38. For compiling code from conditions: +

§37. For compiling code from conditions:

-i6_schema *BinaryPredicates::get_test_function(binary_predicate *bp) {
+i6_schema *BinaryPredicates::get_test_function(binary_predicate *bp) {
     return bp->test_function;
 }
 int BinaryPredicates::can_be_made_true_at_runtime(binary_predicate *bp) {
@@ -970,7 +899,7 @@ so the fact that it runs relatively slowly does not matter.
     return FALSE;
 }
 
-

§39. For the A-parser. The real code is all elsewhere; note that the +

§38. For the A-parser. The real code is all elsewhere; note that the assertions field, which is used only for relations between values rather than objects, is a linked list. (Information about objects is stored in linked lists pointed to from the instance structure in question; that @@ -982,28 +911,31 @@ relation itself.) int BinaryPredicates::allow_arbitrary_assertions(binary_predicate *bp) { return bp->arbitrary; } -int BinaryPredicates::store_dynamically(binary_predicate *bp) { +int BinaryPredicates::store_dynamically(binary_predicate *bp) { return bp->dynamic_memory; } int BinaryPredicates::relates_values_not_objects(binary_predicate *bp) { return bp->relates_values_not_objects; } -inference_subject *BinaryPredicates::as_subject(binary_predicate *bp) { +TERM_DOMAIN_CALCULUS_TYPE *BinaryPredicates::as_subject(binary_predicate *bp) { return bp->knowledge_about_bp; }

-

§40. For use when optimising code. +

§39. For use when optimising code.

+#ifdef CORE_MODULE
 property *BinaryPredicates::get_i6_storage_property(binary_predicate *bp) {
     return bp->i6_storage_property;
 }
+#endif
 int BinaryPredicates::allows_function_simplification(binary_predicate *bp) {
     return bp->allow_function_simplification;
 }
+#ifdef CORE_MODULE
 inter_name *default_rr = NULL;
-void BinaryPredicates::mark_as_needed(binary_predicate *bp) {
+void BinaryPredicates::mark_as_needed(binary_predicate *bp) {
     if (bp->record_needed == FALSE) {
         bp->bp_iname = Hierarchy::make_iname_in(RELATION_RECORD_HL, BinaryPredicates::package(bp));
         if (default_rr == NULL) {
@@ -1015,22 +947,16 @@ relation itself.)
     }
     bp->record_needed = TRUE;
 }
+#endif
 
+#ifdef CORE_MODULE
 inter_name *BinaryPredicates::iname(binary_predicate *bp) {
     if (bp == NULL) return NULL;
     return bp->bp_iname;
 }
+#endif
 
-

§41. For use with comparative relations. -

- -
-void BinaryPredicates::set_comparison_details(binary_predicate *bp,
-    int sign, property *prn) {
-    bp->comparison_sign = sign; bp->comparative_property = prn;
-}
-
-

§42. The predicate-calculus engine compiles much better loops if +

§40. The predicate-calculus engine compiles much better loops if we can help it by providing an I6 schema of a loop header solving the following problem:

@@ -1045,33 +971,33 @@ of looping over all \(x\) in the left domain of \(R\) and testing every possible

-int BinaryPredicates::write_optimised_loop_schema(i6_schema *sch, binary_predicate *bp) {
+int BinaryPredicates::write_optimised_loop_schema(i6_schema *sch, binary_predicate *bp) {
     if (bp == NULL) return FALSE;
-    Try loop ranger optimisation42.1;
-    Try loop parent optimisation subject to a proviso42.2;
+    Try loop ranger optimisation40.1;
+    Try loop parent optimisation subject to a proviso40.2;
     return FALSE;
 }
 
-

§42.1. Some relations \(R\) provide a "ranger" routine, R, which is such that +

§40.1. Some relations \(R\) provide a "ranger" routine, R, which is such that R(t) supplies the first "child" of \(t\) and R(t, n) supplies the next "child" after \(n\). Thus R iterates through some linked list of all the objects \(x\) such that \(R(x, t)\).

-

Try loop ranger optimisation42.1 = +

Try loop ranger optimisation40.1 =

     if (bp->loop_parent_optimisation_ranger) {
-        Calculus::Schemas::modify(sch,
+        Calculus::Schemas::modify(sch,
             "for (*1=%s(*2): *1: *1=%s(*2,*1))",
             bp->loop_parent_optimisation_ranger,
             bp->loop_parent_optimisation_ranger);
         return TRUE;
     }
 
-
  • This code is used in §42.
-

§42.2. Other relations make use of the I6 object tree, in cases where \(R(x, t)\) +

  • This code is used in §40.
+

§40.2. Other relations make use of the I6 object tree, in cases where \(R(x, t)\) is true if and only if \(t\) is an object which is the parent of \(x\) in the I6 object tree and some routine associated with \(R\), called its proviso P, is such that P(x) == t. For example, \({\it worn-by}(x, t)\) @@ -1080,20 +1006,20 @@ ensures that we don't falsely pick up, say, items carried by \(t\) which aren't being worn, or aren't even clothing.

-

Try loop parent optimisation subject to a proviso42.2 = +

Try loop parent optimisation subject to a proviso40.2 =

     if (bp->loop_parent_optimisation_proviso) {
-        Calculus::Schemas::modify(sch,
+        Calculus::Schemas::modify(sch,
             "objectloop (*1 in *2) if (%s(*1)==parent(*1))",
             bp->loop_parent_optimisation_proviso);
         return TRUE;
     }
 
-
  • This code is used in §42.
+
  • This code is used in §40.
diff --git a/docs/calculus-module/2-bpf.html b/docs/calculus-module/2-bpf.html index f2b816e94..0d38b8d48 100644 --- a/docs/calculus-module/2-bpf.html +++ b/docs/calculus-module/2-bpf.html @@ -87,7 +87,7 @@ the predicate's implementation. CLASS_DEFINITION } bp_family; -bp_family *BinaryPredicateFamilies::new(void) { +bp_family *BinaryPredicateFamilies::new(void) { bp_family *f = CREATE(bp_family); f->methods = Methods::new_set(); return f; @@ -126,17 +126,26 @@ such as "if 19 is false", where the terms of the relation do not fit. define NEVER_MATCH_SAYING_WHY_NOT 1001 not one of the three legal *_MATCH values
+typedef struct tc_problem_kit {
+    int issue_error;
+    struct wording ew_text;
+    char *intention;
+    int log_to_I6_text;
+    int flag_problem;
+} tc_problem_kit;
+
 INT_METHOD_TYPE(TYPECHECK_BPF_MTID, bp_family *f, binary_predicate *bp,
-    kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck)
+    kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck)
 
 int BinaryPredicateFamilies::typecheck(binary_predicate *bp,
-    kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
+    kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
     int rv = DECLINE_TO_MATCH;
     INT_METHOD_CALL(rv, bp->relation_family, TYPECHECK_BPF_MTID, bp, kinds_of_terms,
         kinds_required, tck);
     return rv;
 }
 
+

§4. This is for when a relation is asserted to be a true fact about the model world.

@@ -145,10 +154,12 @@ world.
 INT_METHOD_TYPE(ASSERT_BPF_MTID, bp_family *f, binary_predicate *bp,
-    inference_subject *subj0, parse_node *spec0, inference_subject *subj1, parse_node *spec1)
+    TERM_DOMAIN_CALCULUS_TYPE *subj0, parse_node *spec0,
+    TERM_DOMAIN_CALCULUS_TYPE *subj1, parse_node *spec1)
 
 int BinaryPredicateFamilies::assert(binary_predicate *bp,
-    inference_subject *subj0, parse_node *spec0, inference_subject *subj1, parse_node *spec1) {
+    TERM_DOMAIN_CALCULUS_TYPE *subj0, parse_node *spec0,
+    TERM_DOMAIN_CALCULUS_TYPE *subj1, parse_node *spec1) {
     int rv = FALSE;
     INT_METHOD_CALL(rv, bp->relation_family, ASSERT_BPF_MTID, bp, subj0, spec0, subj1, spec1);
     return rv;
@@ -157,24 +168,37 @@ world.
 

§5. This is for compiling run-time code to either test, make true, or make false.

-
enum SCHEMA_BPF_MTID
+

Some constants here enumerate the three cases of what we are to do. This +looks asymmetrical — shouldn't we also test to see whether an atom is false, +a fourth case? +

+ +

The answer is that there's no need, since "test false" can be done by +compiling "test true" and then negating. No similar trick can be used to +combine making something true or false into a single operation. +

+ +
define TEST_ATOM_TASK 1
+define NOW_ATOM_TRUE_TASK 2
+define NOW_ATOM_FALSE_TASK 3
+enum SCHEMA_BPF_MTID
 
 INT_METHOD_TYPE(SCHEMA_BPF_MTID, bp_family *f, int task, binary_predicate *bp,
-    annotated_i6_schema *asch)
+    annotated_i6_schema *asch)
 
-i6_schema *BinaryPredicateFamilies::get_schema(int task, binary_predicate *bp,
-    annotated_i6_schema *asch) {
+i6_schema *BinaryPredicateFamilies::get_schema(int task, binary_predicate *bp,
+    annotated_i6_schema *asch) {
     int rv = FALSE;
     INT_METHOD_CALL(rv, bp->relation_family, SCHEMA_BPF_MTID, task, bp, asch);
     if (rv == FALSE) {
         switch(task) {
-            case TEST_ATOM_TASK: asch->schema = bp->test_function; break;
-            case NOW_ATOM_TRUE_TASK: asch->schema = bp->make_true_function; break;
-            case NOW_ATOM_FALSE_TASK: asch->schema = bp->make_false_function; break;
+            case TEST_ATOM_TASK: asch->schema = bp->test_function; break;
+            case NOW_ATOM_TRUE_TASK: asch->schema = bp->make_true_function; break;
+            case NOW_ATOM_FALSE_TASK: asch->schema = bp->make_false_function; break;
         }
     }
-    return asch->schema;
+    return asch->schema;
 }
 

§6. This allows BPs to print a name for themselves other than their relation_name @@ -196,8 +220,8 @@ fields, when they are mentioned in problem messages. else WRITE("a"); WRITE(" relation"); } - kind *K0 = BinaryPredicates::term_kind(bp, 0); if (K0 == NULL) K0 = K_object; - kind *K1 = BinaryPredicates::term_kind(bp, 1); if (K1 == NULL) K1 = K_object; + kind *K0 = BinaryPredicates::term_kind(bp, 0); if (K0 == NULL) K0 = K_object; + kind *K1 = BinaryPredicates::term_kind(bp, 1); if (K1 == NULL) K1 = K_object; WRITE(" (between "); if (Kinds::eq(K0, K1)) { Kinds::Textual::write_plural(OUT, K0); @@ -224,7 +248,7 @@ something like "one-to-one". }

diff --git a/docs/core-module/12-is.html b/docs/calculus-module/2-cs.html similarity index 64% rename from docs/core-module/12-is.html rename to docs/calculus-module/2-cs.html index 526d149de..5d8512225 100644 --- a/docs/core-module/12-is.html +++ b/docs/calculus-module/2-cs.html @@ -1,7 +1,7 @@ - I6 Schemas + Compilation Schemas @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Inbuild Modules

Inform7 Modules

Services

- + +

To create, and later expand upon, short prototypes of I6 syntax for such run-time tasks as the setting, unsetting or testing of a relation.

-
+

§1. An I6 schema is an intermediate-level code for the final stages of compiling to Inform 6 syntax. Its "prototype" is a C string encoded as @@ -116,13 +116,27 @@ error. typedef struct i6_schema { wchar_t prototype_storage[TYPICAL_I6_SCHEMA_LENGTH]; struct text_stream prototype; - struct inter_schema *compiled; int no_quoted_inames; + #ifdef CORE_MODULE + struct inter_schema *compiled; struct inter_name *quoted_inames[2]; + #endif } i6_schema;

-

§3. Building schemas. The following makes up a new schema from a printf-style formatted string: +

§3.

+ +
+typedef struct annotated_i6_schema {
+    struct i6_schema *schema;
+    int negate_schema;  true if atom is to be tested with the opposite parity
+    struct pcalc_term pt0;  terms on which the I6 schema is to be expanded
+    struct pcalc_term pt1;
+    int involves_action_variables;
+} annotated_i6_schema;
+
+ +

§4. Building schemas. The following makes up a new schema from a printf-style formatted string:

define MAX_I6_SCHEMA_ATTEMPT 1024  plenty of room for conjectural schema overruns
@@ -130,48 +144,54 @@ error.
 
 int unique_qi_counter = 0;
 
-i6_schema *Calculus::Schemas::new(char *fmt, ...) {
+i6_schema *Calculus::Schemas::new(char *fmt, ...) {
     va_list ap;  the variable argument list signified by the dots
     i6_schema *sch = CREATE(i6_schema);
     sch->prototype = Streams::new_buffer(TYPICAL_I6_SCHEMA_LENGTH, sch->prototype_storage);
     sch->no_quoted_inames = 0;
     text_stream *OUT = &(sch->prototype);
-    Process the varargs into schema prototype text3.3;
+    Process the varargs into schema prototype text4.3;
     va_end(ap);  macro to end variable argument processing
+    #ifdef CORE_MODULE
     sch->compiled = InterSchemas::from_i6s(&(sch->prototype), sch->no_quoted_inames, (void **) sch->quoted_inames);
+    #endif
     return sch;
 }
 
-

§3.1. And this is a variation for modifying an existing schema: +

§4.1. And this is a variation for modifying an existing schema:

-void Calculus::Schemas::modify(i6_schema *sch, char *fmt, ...) {
+void Calculus::Schemas::modify(i6_schema *sch, char *fmt, ...) {
     va_list ap;  the variable argument list signified by the dots
     sch->prototype = Streams::new_buffer(TYPICAL_I6_SCHEMA_LENGTH, sch->prototype_storage);
     sch->no_quoted_inames = 0;
     text_stream *OUT = &(sch->prototype);
-    Process the varargs into schema prototype text3.3;
+    Process the varargs into schema prototype text4.3;
     va_end(ap);  macro to end variable argument processing
+    #ifdef CORE_MODULE
     sch->compiled = InterSchemas::from_i6s(&(sch->prototype), sch->no_quoted_inames, (void **) sch->quoted_inames);
+    #endif
 }
 
-

§3.2. And another: +

§4.2. And another:

-void Calculus::Schemas::append(i6_schema *sch, char *fmt, ...) {
+void Calculus::Schemas::append(i6_schema *sch, char *fmt, ...) {
     va_list ap;  the variable argument list signified by the dots
     text_stream *OUT = &(sch->prototype);
-    Process the varargs into schema prototype text3.3;
+    Process the varargs into schema prototype text4.3;
     va_end(ap);  macro to end variable argument processing
+    #ifdef CORE_MODULE
     sch->compiled = InterSchemas::from_i6s(&(sch->prototype), sch->no_quoted_inames, (void **) sch->quoted_inames);
+    #endif
 }
 
-

§3.3. Either way, the schema's prototype is written as follows: +

§4.3. Either way, the schema's prototype is written as follows:

-

Process the varargs into schema prototype text3.3 = +

Process the varargs into schema prototype text4.3 =

@@ -179,30 +199,45 @@ error.
     va_start(ap, fmt);  macro to begin variable argument processing
     for (p = fmt; *p; p++) {
         switch (*p) {
-            case '%': Recognise schema-format escape sequences3.3.1; break;
+            case '%': Recognise schema-format escape sequences4.3.1; break;
             default: PUT(*p); break;
         }
     }
 
- -

§3.3.1. We recognise only a few escapes here: %%, a literal percentage sign; %d, +

+

§4.3.1. We recognise only a few escapes here: %%, a literal percentage sign; %d, an integer; %s, a C string; %S, a text stream; and %k, a kind ID.

-

Recognise schema-format escape sequences3.3.1 = +

Recognise schema-format escape sequences4.3.1 =

     p++;
     switch (*p) {
         case 'd': WRITE("%d", va_arg(ap, int)); break;
-        case 'k': Kinds::RunTime::compile_weak_id(OUT, va_arg(ap, kind *)); break;
-        case 'L': WRITE("%~L", va_arg(ap, local_variable *)); break;
+        case 'k':
+            #ifdef CORE_MODULE
+            Kinds::RunTime::compile_weak_id(OUT, va_arg(ap, kind *));
+            #endif
+            #ifndef CORE_MODULE
+            WRITE("{%u}", va_arg(ap, kind *));
+            #endif
+            break;
+        case 'L':
+            #ifdef CORE_MODULE
+            WRITE("%~L", va_arg(ap, local_variable *)); break;
+            #endif
+            #ifndef CORE_MODULE
+            WRITE("%08x", va_arg(ap, void *)); break;
+            #endif
+            break;
         case 'n': {
-            inter_name *iname = (inter_name *) va_arg(ap, inter_name *);
             int N = sch->no_quoted_inames++;
             if (N >= 2) internal_error("too many inter_name quotes");
-            sch->quoted_inames[N] = iname;
+            #ifdef CORE_MODULE
+            sch->quoted_inames[N] = (inter_name *) va_arg(ap, inter_name *);
+            #endif
             WRITE("QUOTED_INAME_%d_%08x", N, unique_qi_counter++);
             break;
         }
@@ -215,60 +250,62 @@ an integer; %s,
             internal_error("Unknown % string escape in schema format");
     }
 
- -

§4. Emptiness. A schema is empty if its prototype is the null string. +

+

§5. Emptiness. A schema is empty if its prototype is the null string.

-int Calculus::Schemas::empty(i6_schema *sch) {
+int Calculus::Schemas::empty(i6_schema *sch) {
     if (sch == NULL) return TRUE;
     if (Str::len(&(sch->prototype)) == 0) return TRUE;
     return FALSE;
 }
 
-

§5. Expansion. We provide two routines as a sort of API for expanding schemas. The user can +

§6. Expansion. We provide two routines as a sort of API for expanding schemas. The user can either specify two parameters, both of them terms...

-void Calculus::Schemas::emit_expand_from_terms(i6_schema *sch,
-    pcalc_term *pt1, pcalc_term *pt2, int semicolon) {
-    i6s_emission_state ems = Calculus::Schemas::state(pt1, pt2, NULL, NULL);
+#ifdef CORE_MODULE
+void Calculus::Schemas::emit_expand_from_terms(i6_schema *sch,
+    pcalc_term *pt1, pcalc_term *pt2, int semicolon) {
+    i6s_emission_state ems = Calculus::Schemas::state(pt1, pt2, NULL, NULL);
 
-    Calculus::Schemas::sch_emit_inner(sch, &ems, semicolon);
+    Calculus::Schemas::sch_emit_inner(sch, &ems, semicolon);
 }
 
-void Calculus::Schemas::emit_expand_from_locals(i6_schema *sch,
-    local_variable *v1, local_variable *v2, int semicolon) {
-    pcalc_term pt1 = Calculus::Terms::new_constant(
-        Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING, v1));
-    pcalc_term pt2 = Calculus::Terms::new_constant(
-        Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING, v2));
-    Calculus::Schemas::emit_expand_from_terms(sch, &pt1, &pt2, semicolon);
+void Calculus::Schemas::emit_expand_from_locals(i6_schema *sch,
+    local_variable *v1, local_variable *v2, int semicolon) {
+    pcalc_term pt1 = Calculus::Terms::new_constant(
+        Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING, v1));
+    pcalc_term pt2 = Calculus::Terms::new_constant(
+        Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING, v2));
+    Calculus::Schemas::emit_expand_from_terms(sch, &pt1, &pt2, semicolon);
 }
 
-void Calculus::Schemas::emit_val_expand_from_locals(i6_schema *sch,
-    local_variable *v1, local_variable *v2) {
-    pcalc_term pt1 = Calculus::Terms::new_constant(
-        Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING, v1));
-    pcalc_term pt2 = Calculus::Terms::new_constant(
-        Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING, v2));
-    Calculus::Schemas::emit_val_expand_from_terms(sch, &pt1, &pt2);
+void Calculus::Schemas::emit_val_expand_from_locals(i6_schema *sch,
+    local_variable *v1, local_variable *v2) {
+    pcalc_term pt1 = Calculus::Terms::new_constant(
+        Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING, v1));
+    pcalc_term pt2 = Calculus::Terms::new_constant(
+        Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING, v2));
+    Calculus::Schemas::emit_val_expand_from_terms(sch, &pt1, &pt2);
 }
 
 void Calculus::Schemas::emit_val_expand_from_terms(i6_schema *sch,
-    pcalc_term *pt1, pcalc_term *pt2) {
-    i6s_emission_state ems = Calculus::Schemas::state(pt1, pt2, NULL, NULL);
+    pcalc_term *pt1, pcalc_term *pt2) {
+    i6s_emission_state ems = Calculus::Schemas::state(pt1, pt2, NULL, NULL);
 
-    Calculus::Schemas::sch_emit_inner(sch, &ems, FALSE);
+    Calculus::Schemas::sch_emit_inner(sch, &ems, FALSE);
 }
+#endif
 
 typedef struct i6s_emission_state {
     struct text_stream *ops_textual[2];
-    struct pcalc_term *ops_termwise[2];
+    struct pcalc_term *ops_termwise[2];
 } i6s_emission_state;
 
-i6s_emission_state Calculus::Schemas::state(pcalc_term *pt1, pcalc_term *pt2, text_stream *str1, text_stream *str2) {
+i6s_emission_state Calculus::Schemas::state(pcalc_term *pt1, pcalc_term *pt2, text_stream *str1, text_stream *str2) {
     i6s_emission_state ems;
     ems.ops_textual[0] = str1;
     ems.ops_textual[1] = str2;
@@ -278,27 +315,28 @@ either specify two parameters, both of them terms...
 }
 
-

§6.

+

§7.

-void Calculus::Schemas::sch_emit_inner(i6_schema *sch, i6s_emission_state *ems, int code_mode) {
+#ifdef CORE_MODULE
+void Calculus::Schemas::sch_emit_inner(i6_schema *sch, i6s_emission_state *ems, int code_mode) {
 
     if ((ems->ops_textual[0]) || (ems->ops_textual[1])) internal_error("Zap");
 
-    Calculus::Schemas::sch_type_parameter(ems->ops_termwise[0]);
-    Calculus::Schemas::sch_type_parameter(ems->ops_termwise[1]);
+    Calculus::Schemas::sch_type_parameter(ems->ops_termwise[0]);
+    Calculus::Schemas::sch_type_parameter(ems->ops_termwise[1]);
 
-    BEGIN_COMPILATION_MODE;
+    BEGIN_COMPILATION_MODE;
     if (sch->compiled->dereference_mode)
-        COMPILATION_MODE_EXIT(DEREFERENCE_POINTERS_CMODE);
+        COMPILATION_MODE_EXIT(DEREFERENCE_POINTERS_CMODE);
 
     value_holster VH = Holsters::new(INTER_VAL_VHMODE);
     int val_mode = FALSE;
     if (code_mode == FALSE) val_mode = TRUE;
-    EmitInterSchemas::emit(Emit::tree(), &VH, sch->compiled, ems, code_mode, val_mode, NULL, NULL,
-        &Calculus::Schemas::sch_inline, NULL);
+    EmitInterSchemas::emit(Emit::tree(), &VH, sch->compiled, ems, code_mode, val_mode, NULL, NULL,
+        &Calculus::Schemas::sch_inline, NULL);
 
-    END_COMPILATION_MODE;
+    END_COMPILATION_MODE;
 }
 
 void Calculus::Schemas::sch_inline(value_holster *VH,
@@ -306,18 +344,18 @@ either specify two parameters, both of them terms...
 
     i6s_emission_state *ems = (i6s_emission_state *) ems_s;
 
-    BEGIN_COMPILATION_MODE;
+    BEGIN_COMPILATION_MODE;
 
     int give_kind_id = FALSE, give_comparison_routine = FALSE,
         dereference_property = FALSE, adopt_local_stack_frame = FALSE,
         cast_to_kind_of_other_term = FALSE, by_reference = FALSE;
 
     if (t->inline_modifiers & PERMIT_LOCALS_IN_TEXT_CMODE_ISSBM)
-        COMPILATION_MODE_ENTER(PERMIT_LOCALS_IN_TEXT_CMODE);
+        COMPILATION_MODE_ENTER(PERMIT_LOCALS_IN_TEXT_CMODE);
     if (t->inline_modifiers & TREAT_AS_LVALUE_CMODE_ISSBM)
-        COMPILATION_MODE_ENTER(TREAT_AS_LVALUE_CMODE);
+        COMPILATION_MODE_ENTER(TREAT_AS_LVALUE_CMODE);
     if (t->inline_modifiers & JUST_ROUTINE_CMODE_ISSBM)
-        COMPILATION_MODE_ENTER(JUST_ROUTINE_CMODE);
+        COMPILATION_MODE_ENTER(JUST_ROUTINE_CMODE);
     if (t->inline_modifiers & GIVE_KIND_ID_ISSBM) give_kind_id = TRUE;
     if (t->inline_modifiers & GIVE_COMPARISON_ROUTINE_ISSBM) give_comparison_routine = TRUE;
     if (t->inline_modifiers & DEREFERENCE_PROPERTY_ISSBM) dereference_property = TRUE;
@@ -325,39 +363,39 @@ either specify two parameters, both of them terms...
     if (t->inline_modifiers & CAST_TO_KIND_OF_OTHER_TERM_ISSBM) cast_to_kind_of_other_term = TRUE;
     if (t->inline_modifiers & BY_REFERENCE_ISSBM) by_reference = TRUE;
 
-    if (t->inline_command == substitute_ISINC) Perform substitution6.1
-    else if (t->inline_command == current_sentence_ISINC) Perform current sentence6.2
-    else if (t->inline_command == combine_ISINC) Perform combine6.3
+    if (t->inline_command == substitute_ISINC) Perform substitution7.1
+    else if (t->inline_command == current_sentence_ISINC) Perform current sentence7.2
+    else if (t->inline_command == combine_ISINC) Perform combine7.3
     else internal_error("unimplemented command in schema");
 
-    END_COMPILATION_MODE;
+    END_COMPILATION_MODE;
 }
 
-

§6.1. Perform substitution6.1 = +

§7.1. Perform substitution7.1 =

     switch (t->constant_number) {
         case 0: {
             kind *K = NULL;
-            if (cast_to_kind_of_other_term) K = ems->ops_termwise[1]->term_checked_as_kind;
-            Calculus::Schemas::sch_emit_parameter(ems->ops_termwise[0], give_kind_id,
+            if (cast_to_kind_of_other_term) K = ems->ops_termwise[1]->term_checked_as_kind;
+            Calculus::Schemas::sch_emit_parameter(ems->ops_termwise[0], give_kind_id,
                 give_comparison_routine, dereference_property, K, by_reference);
             break;
         }
         case 1: {
-            rule *R = adopted_rule_for_compilation;
+            rule *R = adopted_rule_for_compilation;
             int M = adopted_marker_for_compilation;
             if ((adopt_local_stack_frame) &&
-                (Rvalues::is_CONSTANT_of_kind(ems->ops_termwise[0]->constant, K_response))) {
+                (Rvalues::is_CONSTANT_of_kind(ems->ops_termwise[0]->constant, K_response))) {
                 adopted_rule_for_compilation =
-                    Rvalues::to_rule(ems->ops_termwise[0]->constant);
+                    Rvalues::to_rule(ems->ops_termwise[0]->constant);
                 adopted_marker_for_compilation =
-                    Strings::get_marker_from_response_spec(ems->ops_termwise[0]->constant);
+                    Strings::get_marker_from_response_spec(ems->ops_termwise[0]->constant);
             }
             kind *K = NULL;
-            if (cast_to_kind_of_other_term) K = ems->ops_termwise[0]->term_checked_as_kind;
-            Calculus::Schemas::sch_emit_parameter(ems->ops_termwise[1],
+            if (cast_to_kind_of_other_term) K = ems->ops_termwise[0]->term_checked_as_kind;
+            Calculus::Schemas::sch_emit_parameter(ems->ops_termwise[1],
                 give_kind_id, give_comparison_routine, dereference_property, K, by_reference);
             adopted_rule_for_compilation = R;
             adopted_marker_for_compilation = M;
@@ -367,102 +405,105 @@ either specify two parameters, both of them terms...
             internal_error("schemas are currently limited to *1 and *2");
     }
 
- -

§6.2. Perform current sentence6.2 = +

+

§7.2. Perform current sentence7.2 =

     internal_error("Seems possible after all");
 
- -

§6.3. Perform combine6.3 = +

+

§7.3. Perform combine7.3 =

     int epar = TRUE;
     if ((ems->ops_termwise[0]) && (ems->ops_termwise[1])) {
-        kind *reln_K = ems->ops_termwise[0]->term_checked_as_kind;
-        kind *comb_K = ems->ops_termwise[1]->term_checked_as_kind;
+        kind *reln_K = ems->ops_termwise[0]->term_checked_as_kind;
+        kind *comb_K = ems->ops_termwise[1]->term_checked_as_kind;
         if ((Kinds::get_construct(reln_K) == CON_relation) &&
             (Kinds::get_construct(comb_K) == CON_combination)) {
             kind *req_A = NULL, *req_B = NULL, *found_A = NULL, *found_B = NULL;
             Kinds::binary_construction_material(reln_K, &req_A, &req_B);
             Kinds::binary_construction_material(comb_K, &found_A, &found_B);
             parse_node *spec_A = NULL, *spec_B = NULL;
-            Rvalues::to_pair(ems->ops_termwise[1]->constant, &spec_A, &spec_B);
+            Rvalues::to_pair(ems->ops_termwise[1]->constant, &spec_A, &spec_B);
             if (!((Kinds::Behaviour::uses_pointer_values(req_A)) && (Kinds::Behaviour::definite(req_A))))
                 req_A = NULL;
             if (!((Kinds::Behaviour::uses_pointer_values(req_B)) && (Kinds::Behaviour::definite(req_B))))
                 req_B = NULL;
-            Specifications::Compiler::emit_to_kind(spec_A, req_A);
-            Specifications::Compiler::emit_to_kind(spec_B, req_B);
+            Specifications::Compiler::emit_to_kind(spec_A, req_A);
+            Specifications::Compiler::emit_to_kind(spec_B, req_B);
             epar = FALSE;
         }
     }
     if (epar) {
-        Calculus::Schemas::sch_emit_parameter(ems->ops_termwise[1],
+        Calculus::Schemas::sch_emit_parameter(ems->ops_termwise[1],
             give_kind_id, give_comparison_routine, dereference_property, NULL, FALSE);
-        Produce::val(Emit::tree(), K_number, LITERAL_IVAL, 0);
+        Produce::val(Emit::tree(), K_number, LITERAL_IVAL, 0);
     }
 
- -

§7.

+ +

§8.

-void Calculus::Schemas::sch_emit_parameter(pcalc_term *pt,
+void Calculus::Schemas::sch_emit_parameter(pcalc_term *pt,
     int give_kind_id, int give_comparison_routine,
     int dereference_property, kind *cast_to, int by_reference) {
     if (give_kind_id) {
-        if (pt) Kinds::RunTime::emit_weak_id_as_val(pt->term_checked_as_kind);
+        if (pt) Kinds::RunTime::emit_weak_id_as_val(pt->term_checked_as_kind);
     } else if (give_comparison_routine) {
-        inter_name *cr = Hierarchy::find(SIGNEDCOMPARE_HL);
-        if ((pt) && (pt->term_checked_as_kind)) {
+        inter_name *cr = Hierarchy::find(SIGNEDCOMPARE_HL);
+        if ((pt) && (pt->term_checked_as_kind)) {
             inter_name *specialised_cr =
-                Kinds::Behaviour::get_comparison_routine_as_iname(pt->term_checked_as_kind);
+                Kinds::Behaviour::get_comparison_routine_as_iname(pt->term_checked_as_kind);
             if (specialised_cr) cr = specialised_cr;
         }
-        Produce::val_iname(Emit::tree(), K_value, cr);
+        Produce::val_iname(Emit::tree(), K_value, cr);
     } else {
         if (by_reference) {
-            BEGIN_COMPILATION_MODE;
-            COMPILATION_MODE_EXIT(DEREFERENCE_POINTERS_CMODE);
-            pcalc_term cpt = *pt;
-            Calculus::Terms::emit(cpt);
-            END_COMPILATION_MODE;
+            BEGIN_COMPILATION_MODE;
+            COMPILATION_MODE_EXIT(DEREFERENCE_POINTERS_CMODE);
+            pcalc_term cpt = *pt;
+            Calculus::Terms::emit(cpt);
+            END_COMPILATION_MODE;
         } else {
             int down = FALSE;
-            Kinds::RunTime::emit_cast_call(pt->term_checked_as_kind, cast_to, &down);
-            pcalc_term cpt = *pt;
+            Kinds::RunTime::emit_cast_call(pt->term_checked_as_kind, cast_to, &down);
+            pcalc_term cpt = *pt;
             if ((dereference_property) &&
-                (Node::is(cpt.constant, CONSTANT_NT))) {
-                kind *K = Specifications::to_kind(cpt.constant);
+                (Node::is(cpt.constant, CONSTANT_NT))) {
+                kind *K = Specifications::to_kind(cpt.constant);
                 if (Kinds::get_construct(K) == CON_property)
-                    cpt = Calculus::Terms::new_constant(
-                        Lvalues::new_PROPERTY_VALUE(
-                            Node::duplicate(cpt.constant),
-                            Rvalues::new_self_object_constant()));
+                    cpt = Calculus::Terms::new_constant(
+                        Lvalues::new_PROPERTY_VALUE(
+                            Node::duplicate(cpt.constant),
+                            Rvalues::new_self_object_constant()));
             }
-            Calculus::Terms::emit(cpt);
-            if (down) Produce::up(Emit::tree());
+            Calculus::Terms::emit(cpt);
+            if (down) Produce::up(Emit::tree());
         }
     }
 }
+#endif
 
-

§8. Last and very much least: in case we receive an untypechecked term, we fill +

§9. Last and very much least: in case we receive an untypechecked term, we fill in its kind.

-void Calculus::Schemas::sch_type_parameter(pcalc_term *pt) {
-    if ((pt) && (pt->constant) && (pt->term_checked_as_kind == NULL))
-        pt->term_checked_as_kind = Specifications::to_kind(pt->constant);
+#ifdef CORE_MODULE
+void Calculus::Schemas::sch_type_parameter(pcalc_term *pt) {
+    if ((pt) && (pt->constant) && (pt->term_checked_as_kind == NULL))
+        pt->term_checked_as_kind = Specifications::to_kind(pt->constant);
 }
+#endif
 
-

§9. Logging schemas.

+

§10. Logging schemas.

-void Calculus::Schemas::log(i6_schema *sch) {
-    Calculus::Schemas::write(DL, sch);
+void Calculus::Schemas::log(i6_schema *sch) {
+    Calculus::Schemas::write(DL, sch);
 }
 
 void Calculus::Schemas::write(OUTPUT_STREAM, i6_schema *sch) {
@@ -470,21 +511,21 @@ in its kind.
     else WRITE("<schema: %S>", &(sch->prototype));
 }
 
-void Calculus::Schemas::log_applied(i6_schema *sch, pcalc_term *pt1) {
-    Calculus::Schemas::write_applied(DL, sch, pt1);
+void Calculus::Schemas::log_applied(i6_schema *sch, pcalc_term *pt1) {
+    Calculus::Schemas::write_applied(DL, sch, pt1);
 }
 
-void Calculus::Schemas::write_applied(OUTPUT_STREAM, i6_schema *sch, pcalc_term *pt1) {
+void Calculus::Schemas::write_applied(OUTPUT_STREAM, i6_schema *sch, pcalc_term *pt1) {
     if (sch == NULL) { WRITE("<null schema>"); return; }
     else {
         WRITE("<%S : ", &(sch->prototype));
-        Calculus::Terms::write(OUT, pt1);
+        Calculus::Terms::write(OUT, pt1);
         WRITE(">");
     }
 }
 
diff --git a/docs/calculus-module/2-itpc.html b/docs/calculus-module/2-itpc.html index 6db7eb44e..de9411602 100644 --- a/docs/calculus-module/2-itpc.html +++ b/docs/calculus-module/2-itpc.html @@ -437,7 +437,7 @@ but Inform does not at present make use of this.

diff --git a/docs/calculus-module/2-ter.html b/docs/calculus-module/2-ter.html new file mode 100644 index 000000000..6ab82bf45 --- /dev/null +++ b/docs/calculus-module/2-ter.html @@ -0,0 +1,142 @@ + + + + The Equality Relation + + + + + + + + + + + + + + + + + + +
+ + +

To define that prince among predicates, the equality relation.

+ +
+ +

§1. This predicate plays a very special role in our calculus, and must always +exist. +

+ +
+bp_family *equality_bp_family = NULL;
+bp_family *spatial_bp_family = NULL;
+
+binary_predicate *R_equality = NULL;
+binary_predicate *a_has_b_predicate = NULL;
+
+

§2. Family. This is a minimal representation only: Inform adds other methods to the equality +family to handle its typechecking and so on. +

+ +
+void Calculus::Equality::start(void) {
+    equality_bp_family = BinaryPredicateFamilies::new();
+    METHOD_ADD(equality_bp_family, STOCK_BPF_MTID, Calculus::Equality::stock);
+    METHOD_ADD(equality_bp_family, DESCRIBE_FOR_PROBLEMS_BPF_MTID, Calculus::Equality::REL_describe_for_problems);
+    METHOD_ADD(equality_bp_family, DESCRIBE_FOR_INDEX_BPF_MTID, Calculus::Equality::REL_describe_briefly);
+
+    spatial_bp_family = BinaryPredicateFamilies::new();
+    #ifndef IF_MODULE
+    METHOD_ADD(spatial_bp_family, STOCK_BPF_MTID, Calculus::Equality::stock_spatial);
+    #endif
+}
+
+

§3. Initial stock. This relation is hard-wired in, and it is made in a slightly special way +since (alone among binary predicates) it has no distinct reversal. +

+ +
+void Calculus::Equality::stock(bp_family *self, int n) {
+    if (n == 1) {
+        R_equality = BinaryPredicates::make_equality(equality_bp_family,
+            PreformUtilities::wording(<relation-names>, EQUALITY_RELATION_NAME));
+        BinaryPredicates::set_index_details(R_equality, "value", "value");
+    }
+}
+
+void Calculus::Equality::stock_spatial(bp_family *self, int n) {
+    if (n == 1) {
+        a_has_b_predicate =
+            BinaryPredicates::make_pair(spatial_bp_family,
+                BinaryPredicates::full_new_term(NULL, NULL, EMPTY_WORDING, NULL),
+                BinaryPredicates::new_term(NULL),
+                I"has", I"is-had-by",
+                NULL, NULL,
+                PreformUtilities::wording(<relation-names>, POSSESSION_RELATION_NAME));
+    }
+}
+
+

§4. Problem message text.

+ +
+int Calculus::Equality::REL_describe_for_problems(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
+    return FALSE;
+}
+void Calculus::Equality::REL_describe_briefly(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
+    WRITE("equality");
+}
+
+ + +
+ + + diff --git a/docs/calculus-module/2-trm.html b/docs/calculus-module/2-trm.html index 1e2ee9d04..c9b750a35 100644 --- a/docs/calculus-module/2-trm.html +++ b/docs/calculus-module/2-trm.html @@ -117,7 +117,7 @@ to work it out once. struct kind *term_checked_as_kind; or NULL if unchecked } pcalc_term;
- +

§2. The pcalc_func structure represents a usage of a function inside a term. Terms such as \(f_A(f_B(f_C(x)))\) often occur, so a typical term might be stored as @@ -152,7 +152,7 @@ field is return pt; } -pcalc_term Calculus::Terms::new_constant(parse_node *c) { +pcalc_term Calculus::Terms::new_constant(parse_node *c) { pcalc_term pt; Make new blank term structure pt3.1; pt.constant = c; return pt; @@ -298,7 +298,7 @@ value, because this might not yet have been checked otherwise.

 #ifdef CORE_MODULE
-void Calculus::Terms::emit(pcalc_term pt) {
+void Calculus::Terms::emit(pcalc_term pt) {
     if (pt.variable >= 0) {
         local_variable *lvar = LocalVariables::find_pcalc_var(pt.variable);
         if (lvar == NULL) {
@@ -320,12 +320,12 @@ value, because this might not yet have been checked otherwise.
         return;
     }
     if (pt.function) {
-        i6_schema *fn;
+        i6_schema *fn;
         binary_predicate *bp = (pt.function)->bp;
-        fn = BinaryPredicates::get_term_as_function_of_other(bp, 0);
-        if (fn == NULL) fn = BinaryPredicates::get_term_as_function_of_other(bp, 1);
+        fn = BinaryPredicates::get_term_as_function_of_other(bp, 0);
+        if (fn == NULL) fn = BinaryPredicates::get_term_as_function_of_other(bp, 1);
         if (fn == NULL) internal_error("Function of non-functional predicate");
-        Calculus::Schemas::emit_expand_from_terms(fn, &(pt.function->fn_of), NULL, FALSE);
+        Calculus::Schemas::emit_expand_from_terms(fn, &(pt.function->fn_of), NULL, FALSE);
         return;
     }
     internal_error("Broken pcalc term");
@@ -341,7 +341,7 @@ concisely and without fuss.
 void Calculus::Terms::log(pcalc_term *pt) {
     Calculus::Terms::write(DL, pt);
 }
-void Calculus::Terms::write(text_stream *OUT, pcalc_term *pt) {
+void Calculus::Terms::write(text_stream *OUT, pcalc_term *pt) {
     if (pt == NULL) {
         WRITE("<null-term>");
     } else if (pt->constant) {
@@ -358,10 +358,10 @@ concisely and without fuss.
     } else if (pt->function) {
         #ifdef CORE_MODULE
         binary_predicate *bp = pt->function->bp;
-        i6_schema *fn = BinaryPredicates::get_term_as_function_of_other(bp, 0);
-        if (fn == NULL) fn = BinaryPredicates::get_term_as_function_of_other(bp, 1);
+        i6_schema *fn = BinaryPredicates::get_term_as_function_of_other(bp, 0);
+        if (fn == NULL) fn = BinaryPredicates::get_term_as_function_of_other(bp, 1);
         if (fn == NULL) internal_error("Function of non-functional predicate");
-        Calculus::Schemas::write_applied(OUT, fn, &(pt->function->fn_of));
+        Calculus::Schemas::write_applied(OUT, fn, &(pt->function->fn_of));
         #endif
         #ifndef CORE_MODULE
         WRITE("function");
@@ -375,7 +375,7 @@ concisely and without fuss.
 }
 
diff --git a/docs/calculus-module/2-up.html b/docs/calculus-module/2-up.html index f8d32b14d..a491623e0 100644 --- a/docs/calculus-module/2-up.html +++ b/docs/calculus-module/2-up.html @@ -134,7 +134,7 @@ reverse its sense. } diff --git a/docs/calculus-module/P-htitm.html b/docs/calculus-module/P-htitm.html index 1de798063..aa0f3fbf6 100644 --- a/docs/calculus-module/P-htitm.html +++ b/docs/calculus-module/P-htitm.html @@ -84,6 +84,9 @@ module: CalculusModule::end() just before it shuts down. (But just after, and just before, the corresponding calls to foundation.) +

§3. REGISTER_RELATIONS_CALCULUS_CALLBACK. +

+ diff --git a/docs/calculus-module/index.html b/docs/calculus-module/index.html index 72d3cc9dc..f67617877 100644 --- a/docs/calculus-module/index.html +++ b/docs/calculus-module/index.html @@ -98,6 +98,11 @@ Unary Predicates - A lightweight structure to record uses of an adjective, either positively or negatively.

+
  • +

    + Compilation Schemas - + To create, and later expand upon, short prototypes of I6 syntax for such run-time tasks as the setting, unsetting or testing of a relation.

    +
  • Binary Predicate Families - @@ -108,6 +113,11 @@ Binary Predicates - To create and manage binary predicates, which are the underlying data structures beneath Inform's relations.

  • +
  • +

    + The Equality Relation - + To define that prince among predicates, the equality relation.

    +
  • Terms - diff --git a/docs/calculus-test/1-dcl.html b/docs/calculus-test/1-dcl.html index 3f571e806..5f67f0cbb 100644 --- a/docs/calculus-test/1-dcl.html +++ b/docs/calculus-test/1-dcl.html @@ -517,7 +517,7 @@ sentence. In effect, this is a read-evaluate-print loop. }

    diff --git a/docs/calculus-test/1-pc.html b/docs/calculus-test/1-pc.html index e2ae9667a..de0a0039f 100644 --- a/docs/calculus-test/1-pc.html +++ b/docs/calculus-test/1-pc.html @@ -21,6 +21,7 @@ function togglePopup(material_id) { + @@ -114,8 +115,35 @@ function togglePopup(material_id) { Errors::fatal("only switches may be used at the command line"); } +

    §3.

    + +
    define TERM_DOMAIN_WORDING_FUNCTION Main::get_name_text
    +define TERM_DOMAIN_FROM_KIND_FUNCTION Main::get_kind
    +define TERM_DOMAIN_TO_KIND_FUNCTION Main::get_kind
    +
    +
    +wording Main::get_name_text(kind *K) {
    +    return EMPTY_WORDING;
    +}
    +kind *Main::get_kind(kind *K) {
    +    return K;
    +}
    +
    +

    §4.

    + +
    define EQUALITY_RELATION_NAME 0
    +define UNIVERSAL_RELATION_NAME 1
    +define POSSESSION_RELATION_NAME 2
    +
    +
    +<relation-names> ::=
    +    equality |
    +    universal |
    +    possession
    +
    + diff --git a/docs/calculus-test/1-rlt.html b/docs/calculus-test/1-rlt.html deleted file mode 100644 index 4a7d6b4b9..000000000 --- a/docs/calculus-test/1-rlt.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - Relating - - - - - - - - - - - - - - - -
    - - -

    Providing a sense of meaning for relationships.

    - -

    §1. This test tool uses the linguistics module, and it needs to have some -concept of what relationships are — that is, of what might be meant by -"X sees Y" or "X is on top of Y". -

    - -

    Inform uses a class called binary_predicate for this, but we will use a -class simply called rel. -

    - -
    enum rel_CLASS
    -define VERB_MEANING_LINGUISTICS_TYPE struct rel
    -
    -

    §2. linguistics also needs us to make annotation functions for one special -annotation it uses. (It can't do this itself without knowing the type.) But -we don't need to create the annotation or give it permissions. -

    - -
    -DECLARE_ANNOTATION_FUNCTIONS(relationship, rel)
    -
    -

    §3.

    - -
    -DECLARE_CLASS(rel)
    -MAKE_ANNOTATION_FUNCTIONS(relationship, rel)
    -
    -

    §4. There isn't much to this, since all we want to be able to do is to -print out a name. -

    - -
    -typedef struct rel {
    -    struct text_stream *debugging_log_name;
    -    struct rel *reversed;
    -    CLASS_DEFINITION
    -} rel;
    -
    -
    • The structure rel is accessed in 1/dgr, 3/vm and here.
    -

    §5. linguistics requires that whatever this is, it has to be "reversible". -(This transposes the two terms. The reversal of "X sees Y" is "X is seen by Y".) -

    - -
    define VERB_MEANING_REVERSAL_LINGUISTICS_CALLBACK Relating::reverse_rel
    -
    -
    -rel *Relating::reverse_rel(rel *R) {
    -    return R->reversed;
    -}
    -
    -

    §6. linguistics also wants to know the identities of two special meanings, -roughly those of the verbs "to be" and "to have". So it requires us to define -these two macros: -

    - -
    define VERB_MEANING_EQUALITY R_equality
    -define VERB_MEANING_POSSESSION R_possession
    -
    -
    -rel *R_equality = NULL;
    -rel *R_possession = NULL;
    -
    -

    §7. And so we will create rels in pairs, and the first two (pairs) to be created -must be for equality and possession: -

    - -
    -rel *Relating::new(wording W) {
    -    TEMPORARY_TEXT(name)
    -    WRITE_TO(name, "%W", W);
    -    rel *R = CREATE(rel), *RR = CREATE(rel);
    -    R->debugging_log_name = Str::duplicate(name);
    -    WRITE_TO(name, "-reversed");
    -    RR->debugging_log_name = Str::duplicate(name);
    -    R->reversed = RR; RR->reversed = R;
    -    if (R_equality == NULL) R_equality = R;
    -    else if (R_possession == NULL) R_possession = R;
    -    DISCARD_TEXT(name)
    -    return R;
    -}
    -
    -

    §8. This function finds a rel by name. -

    - -
    -rel *Relating::find(wording W) {
    -    TEMPORARY_TEXT(name)
    -    WRITE_TO(name, "%W", W);
    -    rel *T;
    -    LOOP_OVER(T, rel)
    -        if (Str::eq_insensitive(T->debugging_log_name, name))
    -            break;
    -    DISCARD_TEXT(name)
    -    return T;
    -}
    -
    - - -
    - - - diff --git a/docs/calculus-test/index.html b/docs/calculus-test/index.html index 7f77da0a0..c3f5b6725 100644 --- a/docs/calculus-test/index.html +++ b/docs/calculus-test/index.html @@ -52,11 +52,6 @@ Program Control - What shall we test?

  • -
  • -

    - Relating - - Providing a sense of meaning for relationships.

    -
  • Declarations - @@ -68,6 +63,11 @@


    This program also incorporates the following web(s) as module(s):

    - + -

    To define that prince among predicates, the equality relation.

    + +

    To define how equality behaves in the Inform language.

    -
    +
    -

    §1. This predicate expresses the meaning of \(a=b\), and plays a very special role -in our calculus. -

    +

    §1. Additional details.

    -bp_family *equality_bp_family = NULL;
    -bp_family *spatial_bp_family = NULL;
    -
    -binary_predicate *R_equality = NULL;
    -binary_predicate *a_has_b_predicate = NULL;
    -
    -

    §2. Family.

    - -
    -void Calculus::Equality::start(void) {
    -    equality_bp_family = BinaryPredicateFamilies::new();
    -    METHOD_ADD(equality_bp_family, STOCK_BPF_MTID, Calculus::Equality::stock);
    -    METHOD_ADD(equality_bp_family, TYPECHECK_BPF_MTID, Calculus::Equality::REL_typecheck);
    -    METHOD_ADD(equality_bp_family, ASSERT_BPF_MTID, Calculus::Equality::REL_assert);
    -    METHOD_ADD(equality_bp_family, SCHEMA_BPF_MTID, Calculus::Equality::REL_compile);
    -    METHOD_ADD(equality_bp_family, DESCRIBE_FOR_PROBLEMS_BPF_MTID, Calculus::Equality::REL_describe_for_problems);
    -    METHOD_ADD(equality_bp_family, DESCRIBE_FOR_INDEX_BPF_MTID, Calculus::Equality::REL_describe_briefly);
    -
    -    spatial_bp_family = BinaryPredicateFamilies::new();
    -    #ifndef IF_MODULE
    -    METHOD_ADD(spatial_bp_family, STOCK_BPF_MTID, Calculus::Equality::stock_spatial);
    -    #endif
    +void EqualityDetails::start(void) {
    +    METHOD_ADD(equality_bp_family, TYPECHECK_BPF_MTID, EqualityDetails::REL_typecheck);
    +    METHOD_ADD(equality_bp_family, ASSERT_BPF_MTID, EqualityDetails::REL_assert);
    +    METHOD_ADD(equality_bp_family, SCHEMA_BPF_MTID, EqualityDetails::REL_compile);
     }
     
    -

    §3. Initial stock. This relation is hard-wired in, and it is made in a slightly special way -since (alone among binary predicates) it has no distinct reversal. -

    - -
    -void Calculus::Equality::stock(bp_family *self, int n) {
    -    if (n == 1) {
    -        R_equality = BinaryPredicates::make_equality();
    -        BinaryPredicates::set_index_details(R_equality, "value", "value");
    -
    -        word_assemblage wa = PreformUtilities::merge(<relation-name-formal>, 0,
    -                PreformUtilities::wording(<relation-names>, EQUALITY_RELATION_NAME));
    -        wording AW = WordAssemblages::to_wording(&wa);
    -        Nouns::new_proper_noun(AW, NEUTER_GENDER, ADD_TO_LEXICON_NTOPT,
    -            MISCELLANEOUS_MC, Rvalues::from_binary_predicate(R_equality),
    -            Task::language_of_syntax());
    -    }
    -}
    -void Calculus::Equality::stock_spatial(bp_family *self, int n) {
    -    if (n == 1) {
    -        a_has_b_predicate =
    -            BinaryPredicates::make_pair(spatial_bp_family,
    -                BinaryPredicates::full_new_term(NULL, NULL, EMPTY_WORDING, NULL),
    -                BinaryPredicates::new_term(NULL),
    -                I"has", I"is-had-by",
    -                NULL, NULL, NULL,
    -                PreformUtilities::wording(<relation-names>, POSSESSION_RELATION_NAME));
    -    }
    -}
    -
    -

    §4. Typechecking. This is a very polymorphic relation, in that it can accept terms of almost +

    §2. Typechecking. This is a very polymorphic relation, in that it can accept terms of almost any kind.

    -int Calculus::Equality::REL_typecheck(bp_family *self, binary_predicate *bp,
    -        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
    +int EqualityDetails::REL_typecheck(bp_family *self, binary_predicate *bp,
    +        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
         LOGIF(MATCHING, "Typecheck %u '==' %u\n", kinds_of_terms[0], kinds_of_terms[1]);
         if ((K_understanding) && (Kinds::eq(kinds_of_terms[0], K_understanding)) &&
                 (Kinds::eq(kinds_of_terms[1], K_text))) {
    @@ -165,7 +115,7 @@ any kind.
             return ALWAYS_MATCH;
         if ((Kinds::Behaviour::is_object(kinds_of_terms[0])) &&
             (Properties::Conditions::name_can_coincide_with_property(kinds_of_terms[1])))
    -        Apply rule for "is" applied to an object and a value4.1
    +        Apply rule for "is" applied to an object and a value2.1
         else if ((K_understanding) && (Kinds::eq(kinds_of_terms[1], K_understanding)) &&
                 (Kinds::eq(kinds_of_terms[0], K_snippet)))
             return ALWAYS_MATCH;
    @@ -176,21 +126,21 @@ any kind.
                 (Kinds::eq(kinds_of_terms[0], K_response)))
             return ALWAYS_MATCH;
         else
    -        Allow comparison only where left domain and right domain are not disjoint4.2;
    +        Allow comparison only where left domain and right domain are not disjoint2.2;
         return ALWAYS_MATCH;
     }
     
    -

    §4.1. This case is only separated in order to provide a better problem message +

    §2.1. This case is only separated in order to provide a better problem message for a fairly common mistake:

    -

    Apply rule for "is" applied to an object and a value4.1 = +

    Apply rule for "is" applied to an object and a value2.1 =

         property *prn = Properties::Conditions::get_coinciding_property(kinds_of_terms[1]);
         if (prn == NULL) {
    -        if (tck->log_to_I6_text)
    +        if (tck->log_to_I6_text)
                 LOG("Comparison of object with %u value\n", kinds_of_terms[1]);
             Problems::quote_kind(4, kinds_of_terms[1]);
             StandardProblems::tcp_problem(_p_(PM_NonPropertyCompared), tck,
    @@ -203,46 +153,46 @@ for a fairly common mistake:
             return NEVER_MATCH;
         }
     
    -
    • This code is used in §4.
    -

    §4.2. With comparisons there is no restriction on the two kinds except that they +

    • This code is used in §2.
    +

    §2.2. With comparisons there is no restriction on the two kinds except that they must match each other; \({\it is}(t, s)\) is allowed if \(K(t)\subseteq K(s)\) or vice versa. So rules and rulebooks are comparable, for instance, but numbers and scenes are not.

    -

    Allow comparison only where left domain and right domain are not disjoint4.2 = +

    Allow comparison only where left domain and right domain are not disjoint2.2 =

    -    if (Calculus::Equality::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_rule))
    +    if (EqualityDetails::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_rule))
             return ALWAYS_MATCH;
    -    if (Calculus::Equality::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_rulebook))
    +    if (EqualityDetails::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_rulebook))
             return ALWAYS_MATCH;
    -    if (Calculus::Equality::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_activity))
    +    if (EqualityDetails::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_activity))
             return ALWAYS_MATCH;
         if ((Kinds::compatible(kinds_of_terms[0], kinds_of_terms[1]) == NEVER_MATCH) &&
             (Kinds::compatible(kinds_of_terms[1], kinds_of_terms[0]) == NEVER_MATCH)) {
    -        if (tck->log_to_I6_text)
    +        if (tck->log_to_I6_text)
                 LOG("Unable to compare %u with %u\n", kinds_of_terms[0], kinds_of_terms[1]);
             return NEVER_MATCH_SAYING_WHY_NOT;
         }
     
    -
    • This code is used in §4.
    -

    §5.

    +
    • This code is used in §2.
    +

    §3.

    -int Calculus::Equality::both_terms_of_same_construction(kind *k0, kind *k1, kind_constructor *cons) {
    +int EqualityDetails::both_terms_of_same_construction(kind *k0, kind *k1, kind_constructor *cons) {
         if ((Kinds::get_construct(k0) == cons) && (Kinds::get_construct(k1) == cons))
             return TRUE;
         return FALSE;
     }
     
    -

    §6. Assertion. In general values differ, and cannot be equated by fiat. But an exception is +

    §4. Assertion. In general values differ, and cannot be equated by fiat. But an exception is setting a global variable.

    -int Calculus::Equality::REL_assert(bp_family *self, binary_predicate *bp,
    +int EqualityDetails::REL_assert(bp_family *self, binary_predicate *bp,
             inference_subject *infs0, parse_node *spec0,
             inference_subject *infs1, parse_node *spec1) {
         if (Lvalues::is_actual_NONLOCAL_VARIABLE(spec0)) {
    @@ -264,7 +214,7 @@ setting a global variable.
         return FALSE;
     }
     
    -

    §7. Compilation. Since we are compiling to I6, which is itself a C-level programming +

    §5. Compilation. Since we are compiling to I6, which is itself a C-level programming language, it looks at first as if we can compile is into == when testing equality and = when asserting it: thus

    @@ -304,25 +254,25 @@ of both A and B.

    -int Calculus::Equality::REL_compile(bp_family *self, int task, binary_predicate *bp, annotated_i6_schema *asch) {
    +int EqualityDetails::REL_compile(bp_family *self, int task, binary_predicate *bp, annotated_i6_schema *asch) {
         kind *st[2];
    -    st[0] = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt0);
    -    st[1] = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt1);
    +    st[0] = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt0);
    +    st[1] = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt1);
     
         if ((Kinds::Behaviour::is_object(st[0])) &&
             (Properties::Conditions::name_can_coincide_with_property(st[1])) && (Properties::Conditions::get_coinciding_property(st[1])))
    -        Handle the case of setting a property of A separately7.1;
    +        Handle the case of setting a property of A separately5.1;
     
         if ((Kinds::eq(st[0], K_response)) && (Kinds::eq(st[1], K_text)))
    -        Handle the case of setting a response separately7.2;
    +        Handle the case of setting a response separately5.2;
     
         switch (task) {
             case TEST_ATOM_TASK:
                 if ((st[0]) && (st[1]))
    -                Calculus::Schemas::modify(asch->schema, "%S",
    +                Calculus::Schemas::modify(asch->schema, "%S",
                         Kinds::RunTime::interpret_test_equality(st[0], st[1]));
                 else if (problem_count == 0) {
    -                LOG("$0 and $0; %u and %u\n", &(asch->pt0), &(asch->pt1), st[0], st[1]);
    +                LOG("$0 and $0; %u and %u\n", &(asch->pt0), &(asch->pt1), st[0], st[1]);
                     StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_CantCompareValues),
                         "that would involve comparing things which don't mean "
                         "anything to me",
    @@ -332,23 +282,23 @@ of both A and B.
             case NOW_ATOM_FALSE_TASK:
                 break;
             case NOW_ATOM_TRUE_TASK: {
    -            node_type_t storage_class = Lvalues::get_storage_form(asch->pt0.constant);
    +            node_type_t storage_class = Lvalues::get_storage_form(asch->pt0.constant);
                 if ((storage_class == UNKNOWN_NT) &&
                     (Kinds::get_construct(st[0]) == CON_property))
                     storage_class = PROPERTY_VALUE_NT;
    -            if (Plugins::Call::forbid_setting(asch->pt1.term_checked_as_kind)) {
    -                asch->schema = NULL;
    +            if (Plugins::Call::forbid_setting(asch->pt1.term_checked_as_kind)) {
    +                asch->schema = NULL;
                     return TRUE;
                 }
    -            Make a further check that kinds permit this assignment7.4;
    +            Make a further check that kinds permit this assignment5.4;
                 if (storage_class == UNKNOWN_NT) {
    -                Issue problem message for being unable to set equal7.5
    -                asch->schema = NULL;
    +                Issue problem message for being unable to set equal5.5
    +                asch->schema = NULL;
                 } else {
    -                Exceptional case of setting the "player" global variable7.3;
    -                Calculus::Schemas::modify(asch->schema, "%s",
    +                Exceptional case of setting the "player" global variable5.3;
    +                Calculus::Schemas::modify(asch->schema, "%s",
                         Lvalues::interpret_store(storage_class, st[0], st[1], 0));
    -                Add kind-checking code for run-time checking7.6;
    +                Add kind-checking code for run-time checking5.6;
                 }
                 return TRUE;
             }
    @@ -356,7 +306,7 @@ of both A and B.
         return FALSE;
     }
     
    -

    §7.1. So here is the exceptional case (a) mentioned above. Suppose we have: +

    §5.1. So here is the exceptional case (a) mentioned above. Suppose we have:

    @@ -369,25 +319,25 @@ lantern equals the constant value "bright"; and similarly for "now the lantern is bright".

    -

    Handle the case of setting a property of A separately7.1 = +

    Handle the case of setting a property of A separately5.1 =

         property *prn = Properties::Conditions::get_coinciding_property(st[1]);
         switch (task) {
             case TEST_ATOM_TASK:
    -            Calculus::Schemas::modify(asch->schema, "*1.%n == *2", Properties::iname(prn));
    +            Calculus::Schemas::modify(asch->schema, "*1.%n == *2", Properties::iname(prn));
                 return TRUE;
             case NOW_ATOM_FALSE_TASK:
                 break;
             case NOW_ATOM_TRUE_TASK:
    -            Calculus::Schemas::modify(asch->schema, "*1.%n = *2", Properties::iname(prn));
    +            Calculus::Schemas::modify(asch->schema, "*1.%n = *2", Properties::iname(prn));
                 return TRUE;
         }
         return FALSE;
     
    -
    • This code is used in §7.
    -

    §7.2. Handle the case of setting a response separately7.2 = +

    • This code is used in §5.
    +

    §5.2. Handle the case of setting a response separately5.2 =

    @@ -401,33 +351,33 @@ lantern is bright".
             case NOW_ATOM_FALSE_TASK:
                 break;
             case NOW_ATOM_TRUE_TASK:
    -            Calculus::Schemas::modify(asch->schema, "BlkValueCopy(ResponseTexts-->((*1)-1), *^2)");
    +            Calculus::Schemas::modify(asch->schema, "BlkValueCopy(ResponseTexts-->((*1)-1), *^2)");
                 return TRUE;
         }
         return FALSE;
     
    -
    • This code is used in §7.
    -

    §7.3. A little bit of support within Inform to help the template layer. +

    • This code is used in §5.
    +

    §5.3. A little bit of support within Inform to help the template layer.

    -

    Exceptional case of setting the "player" global variable7.3 = +

    Exceptional case of setting the "player" global variable5.3 =

         nonlocal_variable *nlv =
    -        Lvalues::get_nonlocal_variable_if_any(asch->pt0.constant);
    +        Lvalues::get_nonlocal_variable_if_any(asch->pt0.constant);
         if ((nlv) && (NonlocalVariables::must_be_constant(nlv))) {
    -        asch->schema = NULL;
    +        asch->schema = NULL;
             return TRUE;
         }
         char *exotica = NonlocalVariables::get_write_schema(nlv);
         if (exotica) {
    -        Calculus::Schemas::modify(asch->schema, "%s", exotica);
    +        Calculus::Schemas::modify(asch->schema, "%s", exotica);
             return TRUE;
         }
     
    -
    • This code is used in §7.
    -

    §7.4. Make a further check that kinds permit this assignment7.4 = +

    • This code is used in §5.
    +

    §5.4. Make a further check that kinds permit this assignment5.4 =

    @@ -444,22 +394,22 @@ lantern is bright".
                     "In the line %1, you seem to be asking me to put %2 into %3, "
                     "which can't safely be done.");
                 Problems::issue_problem_end();
    -            asch->schema = NULL;
    +            asch->schema = NULL;
                 return TRUE;
             }
         }
     
    -
    • This code is used in §7.
    -

    §7.5. Rather than just returning FALSE for a generic problem message, we issue +

    • This code is used in §5.
    +

    §5.5. Rather than just returning FALSE for a generic problem message, we issue one that's more helpfully specific and return TRUE.

    -

    Issue problem message for being unable to set equal7.5 = +

    Issue problem message for being unable to set equal5.5 =

    -    if (Rvalues::to_instance(asch->pt0.constant)) {
    -        if (Kinds::Behaviour::is_object(Specifications::to_kind(asch->pt0.constant)))
    +    if (Rvalues::to_instance(asch->pt0.constant)) {
    +        if (Kinds::Behaviour::is_object(Specifications::to_kind(asch->pt0.constant)))
                 StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_CantEquateValues),
                     "equality is not something I can change",
                     "so either those are already the same or are different, and I "
    @@ -475,8 +425,8 @@ one that's more helpfully specific and return                 "just as the number '7' is fixed.");
         }
     
    -
    • This code is used in §7.
    -

    §7.6. Add kind-checking code for run-time checking7.6 = +

    • This code is used in §5.
    +

    §5.6. Add kind-checking code for run-time checking5.6 =

    @@ -488,23 +438,13 @@ one that's more helpfully specific and return             Kinds::RunTime::I6_classname(st[0]));
             Kinds::Textual::write(TEMP, st[0]);
             WRITE_TO(TEMP, "\");");
    -        Calculus::Schemas::append(asch->schema, "%S", TEMP);
    +        Calculus::Schemas::append(asch->schema, "%S", TEMP);
             DISCARD_TEXT(TEMP)
         }
     
    -
    • This code is used in §7.
    -

    §8. Problem message text.

    - -
    -int Calculus::Equality::REL_describe_for_problems(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
    -    return FALSE;
    -}
    -void Calculus::Equality::REL_describe_briefly(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
    -    WRITE("equality");
    -}
    -
    +
    • This code is used in §5.
    diff --git a/docs/core-module/13-ca.html b/docs/core-module/13-ca.html index bf5c99fbb..fab28f7bd 100644 --- a/docs/core-module/13-ca.html +++ b/docs/core-module/13-ca.html @@ -440,7 +440,7 @@ always be small, partly because of the need for scaling to come out right. diff --git a/docs/core-module/13-kak.html b/docs/core-module/13-kak.html index 22676a705..a8c31254d 100644 --- a/docs/core-module/13-kak.html +++ b/docs/core-module/13-kak.html @@ -88,7 +88,7 @@ are drawn about them.

    -inference_subject *Kinds::Knowledge::as_subject(kind *K) {
    +inference_subject *Kinds::Knowledge::as_subject(kind *K) {
         if (K == NULL) return NULL;
         return K->construct->dt_knowledge;
     }
    @@ -325,7 +325,7 @@ kinds:
     }
     
    diff --git a/docs/core-module/13-ki.html b/docs/core-module/13-ki.html index 064ef9a88..cd6dbcca2 100644 --- a/docs/core-module/13-ki.html +++ b/docs/core-module/13-ki.html @@ -566,7 +566,7 @@ as "0 kg", "0 hectares", or whatever is appropriate.
    • This code is used in §6.
    diff --git a/docs/core-module/13-rsfk.html b/docs/core-module/13-rsfk.html index f2ce75ad1..868160158 100644 --- a/docs/core-module/13-rsfk.html +++ b/docs/core-module/13-rsfk.html @@ -120,7 +120,7 @@ kinds being compiled to an I6
    -inter_name *Kinds::RunTime::I6_classname(kind *K) {
    +inter_name *Kinds::RunTime::I6_classname(kind *K) {
         if (Kinds::Behaviour::is_object(K)) return Kinds::RunTime::iname(K);
         internal_error("no I6 classname available");
         return NULL;
    @@ -447,7 +447,7 @@ data, not merely the pointer to them, which is a "deep copy".
     

    -text_stream *Kinds::RunTime::interpret_test_equality(kind *left, kind *right) {
    +text_stream *Kinds::RunTime::interpret_test_equality(kind *left, kind *right) {
         LOGIF(KIND_CHECKING, "Interpreting equality test of kinds %u, %u\n", left, right);
     
         if ((Kinds::eq(left, K_truth_state)) || (Kinds::eq(right, K_truth_state)))
    @@ -522,7 +522,7 @@ data, not merely the pointer to them, which is a "deep copy".
         return FALSE;
     }
     
    -int Kinds::RunTime::emit_cast_call(kind *from, kind *to, int *down) {
    +int Kinds::RunTime::emit_cast_call(kind *from, kind *to, int *down) {
         if (Kinds::RunTime::cast_possible(from, to)) {
             if (Str::len(Kinds::Behaviour::get_name_in_template_code(to)) == 0) {
                 return TRUE;
    @@ -596,14 +596,14 @@ which might occupy up to 31 characters, the maximum length of an I6 identifier:
     

    -void Kinds::RunTime::compile_weak_id(OUTPUT_STREAM, kind *K) {
    +void Kinds::RunTime::compile_weak_id(OUTPUT_STREAM, kind *K) {
         if (K == NULL) { WRITE("UNKNOWN_TY"); return; }
         kind_constructor *con = Kinds::get_construct(K);
         text_stream *sn = Kinds::Constructors::name_in_template_code(con);
         if (Str::len(sn) > 0) WRITE("%S", sn); else WRITE("%d", Kinds::RunTime::weak_id(K));
     }
     
    -void Kinds::RunTime::emit_weak_id(kind *K) {
    +void Kinds::RunTime::emit_weak_id(kind *K) {
         if (K == NULL) { Emit::array_iname_entry(Kinds::Constructors::UNKNOWN_iname()); return; }
         kind_constructor *con = Kinds::get_construct(K);
         inter_name *iname = Kinds::Constructors::iname(con);
    @@ -611,7 +611,7 @@ which might occupy up to 31 characters, the maximum length of an I6 identifier:
         else Emit::array_numeric_entry((inter_ti) (Kinds::RunTime::weak_id(K)));
     }
     
    -void Kinds::RunTime::emit_weak_id_as_val(kind *K) {
    +void Kinds::RunTime::emit_weak_id_as_val(kind *K) {
         if (K == NULL) internal_error("cannot emit null kind as val");
         kind_constructor *con = Kinds::get_construct(K);
         inter_name *iname = Kinds::Constructors::iname(con);
    @@ -668,7 +668,7 @@ turns up. This means remembering everything we've seen, using a new structure:
     

    -void Kinds::RunTime::emit_strong_id(kind *K) {
    +void Kinds::RunTime::emit_strong_id(kind *K) {
         runtime_kind_structure *rks = Kinds::RunTime::get_rks(K);
         if (rks) {
             Emit::array_iname_entry(rks->rks_iname);
    @@ -677,7 +677,7 @@ turns up. This means remembering everything we've seen, using a new structure:
         }
     }
     
    -void Kinds::RunTime::emit_strong_id_as_val(kind *K) {
    +void Kinds::RunTime::emit_strong_id_as_val(kind *K) {
         runtime_kind_structure *rks = Kinds::RunTime::get_rks(K);
         if (rks) {
             Produce::val_iname(Emit::tree(), K_value, rks->rks_iname);
    @@ -700,7 +700,7 @@ here except as a result of recursion.
     

    -runtime_kind_structure *Kinds::RunTime::get_rks(kind *K) {
    +runtime_kind_structure *Kinds::RunTime::get_rks(kind *K) {
         kind *divert = Kinds::Behaviour::stored_as(K);
         if (divert) K = divert;
         runtime_kind_structure *rks = NULL;
    @@ -772,14 +772,14 @@ values for kinds, since both involve tracking constructions uniquely.
     

    -inter_name *Kinds::RunTime::compile_default_value_inner(kind *K) {
    +inter_name *Kinds::RunTime::compile_default_value_inner(kind *K) {
         Kinds::RunTime::precompile_default_value(K);
         runtime_kind_structure *rks = Kinds::RunTime::get_rks(K);
         if (rks == NULL) return NULL;
         return rks->rks_dv_iname;
     }
     
    -int Kinds::RunTime::precompile_default_value(kind *K) {
    +int Kinds::RunTime::precompile_default_value(kind *K) {
         runtime_kind_structure *rks = Kinds::RunTime::get_rks(K);
         if (rks == NULL) return FALSE;
         rks->make_default = TRUE;
    @@ -825,7 +825,7 @@ recursively scanned through for us, so that if we have seen a construction
     

    -void Kinds::RunTime::compile_structures(void) {
    +void Kinds::RunTime::compile_structures(void) {
         runtime_kind_structure *rks;
         LOOP_OVER(rks, runtime_kind_structure) {
             kind *K = rks->kind_described;
    @@ -975,7 +975,7 @@ how the job is done.
     
     int total_heap_allocation = 0;
     
    -void Kinds::RunTime::ensure_basic_heap_present(void) {
    +void Kinds::RunTime::ensure_basic_heap_present(void) {
         total_heap_allocation += 256;  enough for the initial free-space block
     }
     
    @@ -985,7 +985,7 @@ property values, table entries, list items) of pointer-value kinds:

    -void Kinds::RunTime::compile_heap_allocator(void) {
    +void Kinds::RunTime::compile_heap_allocator(void) {
         Compile a constant for the heap size needed20.1;
     }
     
    @@ -1032,7 +1032,7 @@ list of 20 texts. For the cases above, it's always 1. int stack_offset; } heap_allocation; -heap_allocation Kinds::RunTime::make_heap_allocation(kind *K, int multiplier, +heap_allocation Kinds::RunTime::make_heap_allocation(kind *K, int multiplier, int stack_offset) { if (Kinds::Behaviour::uses_pointer_values(K) == FALSE) internal_error("unable to allocate heap storage for this kind of value"); @@ -1050,7 +1050,7 @@ list of 20 texts. For the cases above, it's always 1. return ha; } -void Kinds::RunTime::emit_heap_allocation(heap_allocation ha) { +void Kinds::RunTime::emit_heap_allocation(heap_allocation ha) { if (ha.stack_offset >= 0) { inter_name *iname = Hierarchy::find(BLKVALUECREATEONSTACK_HL); Produce::inv_call_iname(Emit::tree(), iname); @@ -1077,7 +1077,7 @@ list of 20 texts. For the cases above, it's always 1. define BLK_FLAG_TRUNCMULT 0x00000010
    -void Kinds::RunTime::emit_block_value_header(kind *K, int individual, int size) {
    +void Kinds::RunTime::emit_block_value_header(kind *K, int individual, int size) {
         if (individual == FALSE) Emit::array_numeric_entry(0);
         int n = 0, c = 1, w = 4;
         if (TargetVMs::is_16_bit(Task::vm())) w = 2;
    @@ -1099,7 +1099,7 @@ each such kind, and needed at run-time.
     

    -int Kinds::RunTime::base_represented_in_inter(kind *K) {
    +int Kinds::RunTime::base_represented_in_inter(kind *K) {
         if ((Kinds::Behaviour::is_kind_of_kind(K) == FALSE) &&
             (Kinds::is_proper_constructor(K) == FALSE) &&
             (K != K_void) &&
    @@ -1120,7 +1120,7 @@ each such kind, and needed at run-time.
     
    define MAX_KIND_ARITY 32
     
    -inter_name *Kinds::RunTime::iname(kind *K) {
    +inter_name *Kinds::RunTime::iname(kind *K) {
         if (Kinds::RunTime::base_represented_in_inter(K) == FALSE) {
             kind_interaction *KI;
             LOOP_OVER(KI, kind_interaction)
    @@ -1232,7 +1232,7 @@ each such kind, and needed at run-time.
     
     
     int object_kind_count = 1;
    -inter_name *Kinds::RunTime::iname_inner(kind *K) {
    +inter_name *Kinds::RunTime::iname_inner(kind *K) {
         if (Kinds::is_proper_constructor(K)) {
             return Kinds::RunTime::constructed_kind_name(K);
         }
    @@ -1242,7 +1242,7 @@ each such kind, and needed at run-time.
         return NULL;
     }
     
    -inter_name *Kinds::RunTime::assure_iname_exists(kind *K) {
    +inter_name *Kinds::RunTime::assure_iname_exists(kind *K) {
         noun *nt = Kinds::Behaviour::get_noun(K);
         if (nt) {
             if (UseNouns::iname_set(nt) == FALSE) {
    @@ -1289,7 +1289,7 @@ each such kind, and needed at run-time.
         }
     }
     
    -void Kinds::RunTime::kind_declarations(void) {
    +void Kinds::RunTime::kind_declarations(void) {
         kind *K; inter_ti c = 0;
         LOOP_OVER_BASE_KINDS(K)
             if (Kinds::RunTime::base_represented_in_inter(K)) {
    @@ -1300,12 +1300,12 @@ each such kind, and needed at run-time.
             }
     }
     
    -void Kinds::RunTime::compile_nnci(inter_name *name, int val) {
    +void Kinds::RunTime::compile_nnci(inter_name *name, int val) {
         Emit::named_numeric_constant(name, (inter_ti) val);
         Hierarchy::make_available(Emit::tree(), name);
     }
     
    -void Kinds::RunTime::compile_instance_counts(void) {
    +void Kinds::RunTime::compile_instance_counts(void) {
         kind *K;
         LOOP_OVER_BASE_KINDS(K) {
             if ((Kinds::Behaviour::is_an_enumeration(K)) || (Kinds::Behaviour::is_object(K))) {
    @@ -1334,7 +1334,7 @@ each such kind, and needed at run-time.
         Kinds::RunTime::compile_nnci(Hierarchy::find(RNG_SEED_AT_START_OF_PLAY_HL), Task::rng_seed());
     }
     
    -void Kinds::RunTime::compile_data_type_support_routines(void) {
    +void Kinds::RunTime::compile_data_type_support_routines(void) {
         kind *K;
         LOOP_OVER_BASE_KINDS(K) {
             if (Kinds::Behaviour::is_subkind_of_object(K)) continue;
    @@ -2097,7 +2097,7 @@ Z-machine array space.
     

    -void Kinds::RunTime::I7_Kind_Name_routine(void) {
    +void Kinds::RunTime::I7_Kind_Name_routine(void) {
         inter_name *iname = Hierarchy::find(I7_KIND_NAME_HL);
         packaging_state save = Routines::begin(iname);
         inter_symbol *k_s = LocalVariables::add_named_call_as_symbol(I"k");
    @@ -2131,7 +2131,7 @@ Z-machine array space.
     
     
     int VM_non_support_problem_issued = FALSE;
    -void Kinds::RunTime::notify_of_use(kind *K) {
    +void Kinds::RunTime::notify_of_use(kind *K) {
         if (Kinds::RunTime::target_VM_supports(K) == FALSE) {
             if (VM_non_support_problem_issued == FALSE) {
                 VM_non_support_problem_issued = TRUE;
    @@ -2148,7 +2148,7 @@ Z-machine array space.
         }
     }
     
    -int Kinds::RunTime::target_VM_supports(kind *K) {
    +int Kinds::RunTime::target_VM_supports(kind *K) {
         target_vm *VM = Task::vm();
         if (VM == NULL) internal_error("target VM not set yet");
         if ((Kinds::FloatingPoint::uses_floating_point(K)) &&
    @@ -2157,7 +2157,7 @@ Z-machine array space.
     }
     
    diff --git a/docs/core-module/14-cfs.html b/docs/core-module/14-cfs.html index 67428f29f..57ad27965 100644 --- a/docs/core-module/14-cfs.html +++ b/docs/core-module/14-cfs.html @@ -200,7 +200,7 @@ a value in a context where a particular kind of value is expected:

    -void Specifications::Compiler::emit_to_kind(parse_node *value, kind *K_wanted) {
    +void Specifications::Compiler::emit_to_kind(parse_node *value, kind *K_wanted) {
         Kinds::RunTime::notify_of_use(K_wanted);
         kind *K_found = Specifications::to_kind(value);
         Kinds::RunTime::notify_of_use(K_found);
    @@ -278,13 +278,13 @@ a value in a context where a particular kind of value is expected:
         Emit::array_generic_entry(v1, v2);
     }
     
    -void Specifications::Compiler::emit_as_val(kind *K, parse_node *spec) {
    +void Specifications::Compiler::emit_as_val(kind *K, parse_node *spec) {
         value_holster VH = Holsters::new(INTER_VAL_VHMODE);
         Specifications::Compiler::compile_inner(&VH, spec);
     }
     
    diff --git a/docs/core-module/14-cn.html b/docs/core-module/14-cn.html index 342534ac5..8aeb723d3 100644 --- a/docs/core-module/14-cn.html +++ b/docs/core-module/14-cn.html @@ -447,7 +447,7 @@ type-checker won't allow these specifications to be compiled anywhere else.
    • This code is used in §15.
    diff --git a/docs/core-module/14-ds.html b/docs/core-module/14-ds.html index 779831d6e..7711afa7f 100644 --- a/docs/core-module/14-ds.html +++ b/docs/core-module/14-ds.html @@ -127,8 +127,8 @@ which implies a quantifier as well as a kind. prop = Calculus::Atoms::KIND_new_composited(K, Calculus::Terms::new_variable(0)); else prop = Calculus::Atoms::KIND_new(K, Calculus::Terms::new_variable(0)); - Calculus::Propositions::Checker::type_check(prop, - Calculus::Propositions::Checker::tc_no_problem_reporting()); + Calculus::Propositions::Checker::type_check(prop, + Calculus::Propositions::Checker::tc_no_problem_reporting()); Descriptions::set_proposition(spec, prop); } return spec; @@ -164,8 +164,8 @@ a named object or similar, so: if (I == NULL) internal_error("description of null instance"); parse_node *val = Rvalues::from_instance(I); pcalc_prop *prop = Calculus::Atoms::prop_x_is_constant(val); - Calculus::Propositions::Checker::type_check(prop, - Calculus::Propositions::Checker::tc_no_problem_reporting()); + Calculus::Propositions::Checker::type_check(prop, + Calculus::Propositions::Checker::tc_no_problem_reporting()); return Descriptions::from_proposition(prop, W); } @@ -276,8 +276,8 @@ a list. It's sometimes convenient to loop through this list: if (UnaryPredicates::get_parity(au) == FALSE) negated = TRUE; prop = Calculus::Propositions::concatenate(prop, Calculus::Atoms::unary_PREDICATE_from_aph(aph, negated)); - Calculus::Propositions::Checker::type_check(prop, - Calculus::Propositions::Checker::tc_no_problem_reporting()); + Calculus::Propositions::Checker::type_check(prop, + Calculus::Propositions::Checker::tc_no_problem_reporting()); Descriptions::set_proposition(spec, prop); } @@ -290,8 +290,8 @@ a list. It's sometimes convenient to loop through this list: if (UnaryPredicates::get_parity(au) == FALSE) negated = TRUE; prop = Calculus::Propositions::concatenate(prop, Calculus::Atoms::unary_PREDICATE_from_aph(aph, negated)); - Calculus::Propositions::Checker::type_check(prop, - Calculus::Propositions::Checker::tc_no_problem_reporting()); + Calculus::Propositions::Checker::type_check(prop, + Calculus::Propositions::Checker::tc_no_problem_reporting()); Descriptions::set_proposition(spec, prop); if (Q) Descriptions::quantify(spec, Q, N); } @@ -308,7 +308,7 @@ a list. It's sometimes convenient to loop through this list: if (q != exists_quantifier) prop = Calculus::Propositions::concatenate(prop, Calculus::Atoms::new(DOMAIN_CLOSE_ATOM)); Descriptions::set_proposition(spec, prop); - Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_no_problem_reporting()); + Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_no_problem_reporting()); } pcalc_prop *Descriptions::get_inner_prop(parse_node *spec) { @@ -355,7 +355,7 @@ a list. It's sometimes convenient to loop through this list: prop = Calculus::Propositions::concatenate( prop, Calculus::Atoms::CALLED_new(C, Calculus::Terms::new_variable(0), K)); - Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_no_problem_reporting()); + Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_no_problem_reporting()); Descriptions::set_proposition(spec, prop); } @@ -488,7 +488,7 @@ the number of atoms in the proposition. So we simply use it as a sorting key.
    • This code is used in §12.
    diff --git a/docs/core-module/14-ds2.html b/docs/core-module/14-ds2.html index 3966232ea..265c3f40a 100644 --- a/docs/core-module/14-ds2.html +++ b/docs/core-module/14-ds2.html @@ -264,7 +264,7 @@ are used correctly. return Dash::funnel_to_level_2(cn, FALSE); } -int Dash::check_value(parse_node *p, kind *K) { +int Dash::check_value(parse_node *p, kind *K) { parse_node *vn = Node::new(RVALUE_CONTEXT_NT); if (K) Node::set_kind_required_by_context(vn, K); vn->down = p; @@ -273,7 +273,7 @@ are used correctly. return Dash::funnel_to_level_2(vn, FALSE); } -int Dash::check_value_silently(parse_node *p, kind *K) { +int Dash::check_value_silently(parse_node *p, kind *K) { parse_node *vn = Node::new(RVALUE_CONTEXT_NT); if (K) Node::set_kind_required_by_context(vn, K); vn->down = p; @@ -3618,14 +3618,14 @@ delegate that to "Type Check Propositions.w". if (Descriptions::is_complex(p)) desired_to = "be a description"; if (desired_to) { - if (Calculus::Propositions::Checker::type_check(Specifications::to_proposition(p), - Calculus::Propositions::Checker::tc_no_problem_reporting()) + if (Calculus::Propositions::Checker::type_check(Specifications::to_proposition(p), + Calculus::Propositions::Checker::tc_no_problem_reporting()) == NEVER_MATCH) { LOGIF(MATCHING, "(5.c) on $P failed proposition type-checking: $D\n", p, Specifications::to_proposition(p)); THIS_IS_A_GROSS_PROBLEM; - Calculus::Propositions::Checker::type_check(Specifications::to_proposition(p), - Calculus::Propositions::Checker::tc_problem_reporting(Node::get_text(p), desired_to)); + Calculus::Propositions::Checker::type_check(Specifications::to_proposition(p), + Calculus::Propositions::Checker::tc_problem_reporting(Node::get_text(p), desired_to)); return NEVER_MATCH; } else { LOG_DASH("(5.c) Okay!"); } } @@ -4361,7 +4361,7 @@ at run time. }
    diff --git a/docs/core-module/14-lv.html b/docs/core-module/14-lv.html index 8b25a4e56..91039f174 100644 --- a/docs/core-module/14-lv.html +++ b/docs/core-module/14-lv.html @@ -131,7 +131,7 @@ all in the VALUE
    -parse_node *Lvalues::new_LOCAL_VARIABLE(wording W, local_variable *lvar) {
    +parse_node *Lvalues::new_LOCAL_VARIABLE(wording W, local_variable *lvar) {
         parse_node *spec = Node::new(LOCAL_VARIABLE_NT);
         Node::set_text(spec, W);
         Node::set_constant_local_variable(spec, lvar);
    @@ -177,7 +177,7 @@ make problem messages more readable.
     

    -parse_node *Lvalues::new_PROPERTY_VALUE(parse_node *prop, parse_node *owner) {
    +parse_node *Lvalues::new_PROPERTY_VALUE(parse_node *prop, parse_node *owner) {
         parse_node *spec = Node::new(PROPERTY_VALUE_NT);
         spec->down = prop;
         spec->down->next = owner;
    @@ -202,7 +202,7 @@ make problem messages more readable.
     

    §7. Testing.

    -node_type_t Lvalues::get_storage_form(parse_node *spec) {
    +node_type_t Lvalues::get_storage_form(parse_node *spec) {
         if (ParseTreeUsage::is_lvalue(spec)) return Node::get_type(spec);
         return UNKNOWN_NT;
     }
    @@ -211,12 +211,12 @@ make problem messages more readable.
     

    -int Lvalues::is_actual_NONLOCAL_VARIABLE(parse_node *spec) {
    +int Lvalues::is_actual_NONLOCAL_VARIABLE(parse_node *spec) {
         if (Node::is(spec, NONLOCAL_VARIABLE_NT)) return TRUE;
         return FALSE;
     }
     
    -nonlocal_variable *Lvalues::get_nonlocal_variable_if_any(parse_node *spec) {
    +nonlocal_variable *Lvalues::get_nonlocal_variable_if_any(parse_node *spec) {
         if (Node::is(spec, NONLOCAL_VARIABLE_NT))
             return Node::get_constant_nonlocal_variable(spec);
         return NULL;
    @@ -724,7 +724,7 @@ if simply setting.
     

    -char *Lvalues::interpret_store(node_type_t storage_class, kind *left, kind *right, int inc) {
    +char *Lvalues::interpret_store(node_type_t storage_class, kind *left, kind *right, int inc) {
         LOGIF(KIND_CHECKING, "Interpreting assignment of kinds %u, %u\n", left, right);
         kind_constructor *L = NULL, *R = NULL;
         if ((left) && (right)) { L = left->construct; R = right->construct; }
    @@ -757,7 +757,7 @@ if simply setting.
     }
     
    diff --git a/docs/core-module/14-rv.html b/docs/core-module/14-rv.html index 5dc75379b..ecf96fdc9 100644 --- a/docs/core-module/14-rv.html +++ b/docs/core-module/14-rv.html @@ -102,7 +102,7 @@ pointers: parse_node *Rvalues::from_scene(scene *val) { CONV_FROM(scene, K_scene) } #endif parse_node *Rvalues::from_activity(activity *val) { CONV_FROM(activity, Activities::to_kind(val)) } -parse_node *Rvalues::from_binary_predicate(binary_predicate *val) { CONV_FROM(binary_predicate, Kinds::base_construction(CON_relation)) } +parse_node *Rvalues::from_binary_predicate(binary_predicate *val) { CONV_FROM(binary_predicate, Kinds::base_construction(CON_relation)) } parse_node *Rvalues::from_constant_phrase(constant_phrase *val) { CONV_FROM(constant_phrase, Kinds::base_construction(CON_phrase)) } parse_node *Rvalues::from_equation(equation *val) { CONV_FROM(equation, K_equation) } parse_node *Rvalues::from_named_rulebook_outcome(named_rulebook_outcome *val) { CONV_FROM(named_rulebook_outcome, K_rulebook_outcome) } @@ -131,12 +131,12 @@ pointers: scene *Rvalues::to_scene(parse_node *spec) { CONV_TO(scene) } #endif activity *Rvalues::to_activity(parse_node *spec) { CONV_TO(activity) } -binary_predicate *Rvalues::to_binary_predicate(parse_node *spec) { CONV_TO(binary_predicate) } +binary_predicate *Rvalues::to_binary_predicate(parse_node *spec) { CONV_TO(binary_predicate) } constant_phrase *Rvalues::to_constant_phrase(parse_node *spec) { CONV_TO(constant_phrase) } equation *Rvalues::to_equation(parse_node *spec) { CONV_TO(equation) } named_rulebook_outcome *Rvalues::to_named_rulebook_outcome(parse_node *spec) { CONV_TO(named_rulebook_outcome) } property *Rvalues::to_property(parse_node *spec) { CONV_TO(property) } -rule *Rvalues::to_rule(parse_node *spec) { CONV_TO(rule) } +rule *Rvalues::to_rule(parse_node *spec) { CONV_TO(rule) } rulebook *Rvalues::to_rulebook(parse_node *spec) { CONV_TO(rulebook) } table *Rvalues::to_table(parse_node *spec) { CONV_TO(table) } table_column *Rvalues::to_table_column(parse_node *spec) { CONV_TO(table_column) } @@ -157,7 +157,7 @@ objects. return val; } -instance *Rvalues::to_instance(parse_node *spec) { CONV_TO(instance) } +instance *Rvalues::to_instance(parse_node *spec) { CONV_TO(instance) }

    §4. An instance of a subkind of K_object is called an "object":

    @@ -181,7 +181,7 @@ special annotations.

    -parse_node *Rvalues::new_self_object_constant(void) {
    +parse_node *Rvalues::new_self_object_constant(void) {
         parse_node *spec = Node::new(CONSTANT_NT);
         Node::set_kind_of_value(spec, K_object);
         Annotations::write_int(spec, self_object_ANNOT, TRUE);
    @@ -385,7 +385,7 @@ an l-value.
         return spec;
     }
     
    -void Rvalues::to_pair(parse_node *pair, parse_node **X, parse_node **Y) {
    +void Rvalues::to_pair(parse_node *pair, parse_node **X, parse_node **Y) {
         *X = pair->down;
         *Y = pair->down->next;
     }
    @@ -396,7 +396,7 @@ in the proposition.
     

    -parse_node *Rvalues::constant_description(pcalc_prop *prop, wording W) {
    +parse_node *Rvalues::constant_description(pcalc_prop *prop, wording W) {
         parse_node *con = Node::new_with_words(CONSTANT_NT, W);
         Node::set_kind_of_value(con,
             Kinds::unary_con(CON_description, K_object));
    @@ -404,7 +404,7 @@ in the proposition.
         return con;
     }
     
    -void Rvalues::set_constant_description_proposition(parse_node *spec, pcalc_prop *prop) {
    +void Rvalues::set_constant_description_proposition(parse_node *spec, pcalc_prop *prop) {
         if (Rvalues::is_CONSTANT_construction(spec, CON_description)) {
             Node::set_proposition(spec, prop);
             Node::set_kind_of_value(spec,
    @@ -416,14 +416,14 @@ in the proposition.
     

    §19. Testing.

    -int Rvalues::is_CONSTANT_construction(parse_node *spec, kind_constructor *con) {
    +int Rvalues::is_CONSTANT_construction(parse_node *spec, kind_constructor *con) {
         if ((Node::is(spec, CONSTANT_NT)) &&
             (Kinds::get_construct(Node::get_kind_of_value(spec)) == con))
             return TRUE;
         return FALSE;
     }
     
    -int Rvalues::is_CONSTANT_of_kind(parse_node *spec, kind *K) {
    +int Rvalues::is_CONSTANT_of_kind(parse_node *spec, kind *K) {
         if ((Node::is(spec, CONSTANT_NT)) &&
             (Kinds::eq(Node::get_kind_of_value(spec), K)))
             return TRUE;
    @@ -461,7 +461,7 @@ doesn't need to be especially rapid.
         KCOMPARE_CONSTANTS_USING(DATA, STRUCTURE, Rvalues::to_##STRUCTURE)
     
    -int Rvalues::compare_CONSTANT(parse_node *spec1, parse_node *spec2) {
    +int Rvalues::compare_CONSTANT(parse_node *spec1, parse_node *spec2) {
         if (Node::is(spec1, CONSTANT_NT) == FALSE) return FALSE;
         if (Node::is(spec2, CONSTANT_NT) == FALSE) return FALSE;
         kind *K1 = Node::get_kind_of_value(spec1);
    @@ -509,7 +509,7 @@ doesn't need to be especially rapid.
     

    §21. Pretty-printing.

    -void Rvalues::write_out_in_English(OUTPUT_STREAM, parse_node *spec) {
    +void Rvalues::write_out_in_English(OUTPUT_STREAM, parse_node *spec) {
         switch (Node::get_type(spec)) {
             case PHRASE_TO_DECIDE_VALUE_NT: {
                 kind *dtr = Specifications::to_kind(spec);
    @@ -543,7 +543,7 @@ result have?
     

    -kind *Rvalues::to_kind(parse_node *spec) {
    +kind *Rvalues::to_kind(parse_node *spec) {
         if (spec == NULL) internal_error("Rvalues::to_kind on NULL");
         switch (Node::get_type(spec)) {
             case CONSTANT_NT:
    @@ -684,7 +684,7 @@ some problem message.
     

    -void Rvalues::compile(value_holster *VH, parse_node *spec_found) {
    +void Rvalues::compile(value_holster *VH, parse_node *spec_found) {
         switch(Node::get_type(spec_found)) {
             case PHRASE_TO_DECIDE_VALUE_NT:
                 Invocations::Compiler::compile_invocation_list(VH,
    @@ -942,7 +942,7 @@ in several contexts by using a tilde: 
  • This code is used in §23.3.
  • diff --git a/docs/core-module/14-sp.html b/docs/core-module/14-sp.html index 6e62aa282..31ae768f2 100644 --- a/docs/core-module/14-sp.html +++ b/docs/core-module/14-sp.html @@ -96,7 +96,7 @@ for creating and using them. return Descriptions::from_kind(K, FALSE); } -kind *Specifications::to_kind(parse_node *spec) { +kind *Specifications::to_kind(parse_node *spec) { if (Node::is(spec, AMBIGUITY_NT)) spec = spec->down; if (Specifications::is_description(spec)) return Descriptions::to_kind(spec); @@ -413,7 +413,7 @@ meaning could be found. }
    diff --git a/docs/core-module/15-cp.html b/docs/core-module/15-cp.html index d61e9238d..b48b50809 100644 --- a/docs/core-module/15-cp.html +++ b/docs/core-module/15-cp.html @@ -232,12 +232,12 @@ becomes the name of a property.

    -int Properties::Conditions::name_can_coincide_with_property(kind *K) {
    +int Properties::Conditions::name_can_coincide_with_property(kind *K) {
         if (K == NULL) return FALSE;
         return K->construct->can_coincide_with_property;
     }
     
    -property *Properties::Conditions::get_coinciding_property(kind *K) {
    +property *Properties::Conditions::get_coinciding_property(kind *K) {
         if (K == NULL) return NULL;
         return K->construct->coinciding_property;
     }
    @@ -248,7 +248,7 @@ becomes the name of a property.
     }
     
    diff --git a/docs/core-module/15-cr.html b/docs/core-module/15-cr.html index c4844b5a3..33d3d7378 100644 --- a/docs/core-module/15-cr.html +++ b/docs/core-module/15-cr.html @@ -106,29 +106,44 @@ the previous section. Properties::Measurement::create_comparatives(); } } + +typedef struct comparative_bp_data { + struct property *comparative_property; (if right way) if a comparative adjective + int comparison_sign; ...and +1 or -1 according to sign of definition + CLASS_DEFINITION +} comparative_bp_data; + +void Properties::ComparativeRelations::initialise(binary_predicate *bp, + int sign, property *prn) { + comparative_bp_data *D = CREATE(comparative_bp_data); + D->comparison_sign = sign; D->comparative_property = prn; + bp->family_specific = STORE_POINTER_comparative_bp_data(D); +}
    +
    • The structure comparative_bp_data is private to this section.

    §3. Typechecking. Because of the ambiguity between absolute and relative comparisons (see below), we'll typecheck this asymmetrically; the left term is typechecked as usual, but the right is more leniently handled.

    -int Properties::ComparativeRelations::REL_typecheck(bp_family *self, binary_predicate *bp,
    -    kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
    +int Properties::ComparativeRelations::REL_typecheck(bp_family *self, binary_predicate *bp,
    +    kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
     
         if ((kinds_required[0]) &&
             (Kinds::compatible(kinds_of_terms[0], kinds_required[0]) == NEVER_MATCH)) {
             LOG("Term 0 is %u not %u\n", kinds_of_terms[0], kinds_required[0]);
    -        Calculus::Propositions::Checker::issue_bp_typecheck_error(bp,
    +        Calculus::Propositions::Checker::issue_bp_typecheck_error(bp,
                 kinds_of_terms[0], kinds_of_terms[1], tck);
             return NEVER_MATCH;
         }
     
         property *prn = Properties::Conditions::get_coinciding_property(kinds_of_terms[1]);
    -    if ((prn) && (prn != bp->comparative_property)) {
    -        if (tck->log_to_I6_text)
    -            LOG("Comparative misapplied to $Y not $Y\n", prn, bp->comparative_property);
    -        Problems::quote_property(4, bp->comparative_property);
    +    comparative_bp_data *D = RETRIEVE_POINTER_comparative_bp_data(bp->family_specific);
    +    if ((prn) && (prn != D->comparative_property)) {
    +        if (tck->log_to_I6_text)
    +            LOG("Comparative misapplied to $Y not $Y\n", prn, D->comparative_property);
    +        Problems::quote_property(4, D->comparative_property);
             Problems::quote_property(5, prn);
             StandardProblems::tcp_problem(_p_(PM_ComparativeMisapplied), tck,
                 "that ought to make a comparison of %4 not %5.");
    @@ -140,7 +155,7 @@ as usual, but the right is more leniently handled.
     

    §4. Assertion.

    -int Properties::ComparativeRelations::REL_assert(bp_family *self, binary_predicate *bp,
    +int Properties::ComparativeRelations::REL_assert(bp_family *self, binary_predicate *bp,
             inference_subject *infs0, parse_node *spec0,
             inference_subject *infs1, parse_node *spec1) {
         return FALSE;
    @@ -150,9 +165,9 @@ as usual, but the right is more leniently handled.
     

    -int Properties::ComparativeRelations::REL_compile(bp_family *self, int task, binary_predicate *bp,
    -    annotated_i6_schema *asch) {
    -    if (task == TEST_ATOM_TASK)
    +int Properties::ComparativeRelations::REL_compile(bp_family *self, int task, binary_predicate *bp,
    +    annotated_i6_schema *asch) {
    +    if (task == TEST_ATOM_TASK)
             Rewrite the annotated schema if it turns out to be an absolute comparison5.1;
         return FALSE;
     }
    @@ -174,15 +189,16 @@ so symmetrically; we rewrite the annotated schema on the fly.
     
     
         kind *st[2];
    -    st[0] = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt0);
    -    st[1] = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt1);
    +    st[0] = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt0);
    +    st[1] = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt1);
         if ((Kinds::eq(st[0], st[1]) == FALSE) &&
             (Properties::Conditions::name_can_coincide_with_property(st[1]))) {
             property *prn = Properties::Conditions::get_coinciding_property(st[1]);
             if (prn) {
    -            Calculus::Schemas::modify(asch->schema,
    +            comparative_bp_data *D = RETRIEVE_POINTER_comparative_bp_data(bp->family_specific);
    +            Calculus::Schemas::modify(asch->schema,
                     "*1.%n %s *2", Properties::iname(prn),
    -                Properties::Measurement::strict_comparison(bp->comparison_sign));
    +                Properties::Measurement::strict_comparison(D->comparison_sign));
                 return TRUE;
             }
         }
    @@ -191,12 +207,12 @@ so symmetrically; we rewrite the annotated schema on the fly.
     

    §6. Problem message text.

    -int Properties::ComparativeRelations::REL_describe_for_problems(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
    +int Properties::ComparativeRelations::REL_describe_for_problems(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
         return FALSE;
     }
     
    diff --git a/docs/core-module/15-ep.html b/docs/core-module/15-ep.html index 43bc706bf..e07ee9397 100644 --- a/docs/core-module/15-ep.html +++ b/docs/core-module/15-ep.html @@ -393,25 +393,25 @@ which would work just as well, but more slowly. property *neg = Properties::EitherOr::get_negation(prn); inter_name *identifier = Properties::iname(neg); - i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE); - Calculus::Schemas::modify(sch, "GetEitherOrProperty(*1, %n) == false", identifier); + i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE); + Calculus::Schemas::modify(sch, "GetEitherOrProperty(*1, %n) == false", identifier); sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_TRUE_TASK, FALSE); - Calculus::Schemas::modify(sch, "SetEitherOrProperty(*1, %n, true)", identifier); + Calculus::Schemas::modify(sch, "SetEitherOrProperty(*1, %n, true)", identifier); sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_FALSE_TASK, FALSE); - Calculus::Schemas::modify(sch, "SetEitherOrProperty(*1, %n, false)", identifier); + Calculus::Schemas::modify(sch, "SetEitherOrProperty(*1, %n, false)", identifier); } else { inter_name *identifier = Properties::iname(prn); - i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE); - Calculus::Schemas::modify(sch, "GetEitherOrProperty(*1, %n)", identifier); + i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE); + Calculus::Schemas::modify(sch, "GetEitherOrProperty(*1, %n)", identifier); sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_TRUE_TASK, FALSE); - Calculus::Schemas::modify(sch, "SetEitherOrProperty(*1, %n, false)", identifier); + Calculus::Schemas::modify(sch, "SetEitherOrProperty(*1, %n, false)", identifier); sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_FALSE_TASK, FALSE); - Calculus::Schemas::modify(sch, "SetEitherOrProperty(*1, %n, true)", identifier); + Calculus::Schemas::modify(sch, "SetEitherOrProperty(*1, %n, true)", identifier); }
    • This code is used in §15.
    @@ -422,28 +422,28 @@ which would work just as well, but more slowly. if (Properties::EitherOr::stored_in_negation(prn)) { property *neg = Properties::EitherOr::get_negation(prn); - i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE); - Calculus::Schemas::modify(sch, "GProperty(%k, *1, %n) == false", K, + i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE); + Calculus::Schemas::modify(sch, "GProperty(%k, *1, %n) == false", K, Properties::iname(neg)); sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_TRUE_TASK, FALSE); - Calculus::Schemas::modify(sch, "WriteGProperty(%k, *1, %n)", K, + Calculus::Schemas::modify(sch, "WriteGProperty(%k, *1, %n)", K, Properties::iname(neg)); sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_FALSE_TASK, FALSE); - Calculus::Schemas::modify(sch, "WriteGProperty(%k, *1, %n, true)", K, + Calculus::Schemas::modify(sch, "WriteGProperty(%k, *1, %n, true)", K, Properties::iname(neg)); } else { - i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE); - Calculus::Schemas::modify(sch, "GProperty(%k, *1, %n)", K, + i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE); + Calculus::Schemas::modify(sch, "GProperty(%k, *1, %n)", K, Properties::iname(prn)); sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_TRUE_TASK, FALSE); - Calculus::Schemas::modify(sch, "WriteGProperty(%k, *1, %n, true)", K, + Calculus::Schemas::modify(sch, "WriteGProperty(%k, *1, %n, true)", K, Properties::iname(prn)); sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_FALSE_TASK, FALSE); - Calculus::Schemas::modify(sch, "WriteGProperty(%k, *1, %n)", K, + Calculus::Schemas::modify(sch, "WriteGProperty(%k, *1, %n)", K, Properties::iname(prn)); }
    @@ -477,7 +477,7 @@ property. }
    diff --git a/docs/core-module/15-epv.html b/docs/core-module/15-epv.html index eab7cd949..00a22fd80 100644 --- a/docs/core-module/15-epv.html +++ b/docs/core-module/15-epv.html @@ -349,7 +349,7 @@ the following. }
    diff --git a/docs/core-module/15-ia.html b/docs/core-module/15-ia.html index 4c16b19d8..d73b0ea34 100644 --- a/docs/core-module/15-ia.html +++ b/docs/core-module/15-ia.html @@ -154,7 +154,7 @@ available; }
    diff --git a/docs/core-module/15-ma.html b/docs/core-module/15-ma.html index b11dba7fe..b20d01a52 100644 --- a/docs/core-module/15-ma.html +++ b/docs/core-module/15-ma.html @@ -526,9 +526,9 @@ can't normally be unravelled at compile time. measurement_definition *mdef, int T) { if ((mdef->prop) && (mdef->region_threshold_evaluated) && (mdef->property_schema_written == FALSE)) { - i6_schema *sch = Adjectives::Meanings::set_i6_schema( + i6_schema *sch = Adjectives::Meanings::set_i6_schema( mdef->headword_as_adjective, TEST_ADJECTIVE_TASK, FALSE); - Calculus::Schemas::modify(sch, "%n(*1)", mdef->mdef_iname); + Calculus::Schemas::modify(sch, "%n(*1)", mdef->mdef_iname); mdef->property_schema_written = TRUE; } } @@ -577,8 +577,8 @@ can't normally be unravelled at compile time. Properties::Measurement::weak_comparison_bp(mdef->region_shape), Calculus::Terms::new_constant(evaluated_prop), Calculus::Terms::new_constant(val)); - if (Calculus::Propositions::Checker::type_check(prop, - Calculus::Propositions::Checker::tc_problem_reporting( + if (Calculus::Propositions::Checker::type_check(prop, + Calculus::Propositions::Checker::tc_problem_reporting( mdef->region_threshold_text, "be giving the boundary of the definition")) == ALWAYS_MATCH) { Produce::inv_primitive(Emit::tree(), IF_BIP); @@ -611,7 +611,7 @@ adjectives and superlatives are made. vocabulary_entry *quiddity = Lexer::word(Wordings::first_wn( Grading::make_quiddity(H, Task::language_of_syntax()))); "tallness" - i6_schema *schema_to_compare_property_values; + i6_schema *schema_to_compare_property_values; Work out property comparison schema13.1; Construct a BP named for the quiddity and tested using the comparative schema13.2; @@ -629,7 +629,7 @@ adjectives and superlatives are made. inter_name *identifier = Properties::iname(mdef->prop); char *operation = Properties::Measurement::strict_comparison(mdef->region_shape); schema_to_compare_property_values = - Calculus::Schemas::new("(*1.%n %s *2.%n)", identifier, operation, identifier); + Calculus::Schemas::new("(*1.%n %s *2.%n)", identifier, operation, identifier);
    • This code is used in §13.

    §13.2. The relation arising from "tall" would be called the "tallness relation", for @@ -651,10 +651,10 @@ behaviour despite being of mutually incompatible kinds.) WRITE_TO(relname, "%V", quiddity); bp = BinaryPredicates::make_pair(property_comparison_bp_family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL), - relname, NULL, NULL, NULL, + relname, NULL, NULL, schema_to_compare_property_values, WordAssemblages::lit_1(quiddity)); DISCARD_TEXT(relname) - BinaryPredicates::set_comparison_details(bp, mdef->region_shape, mdef->prop); + Properties::ComparativeRelations::initialise(bp, mdef->region_shape, mdef->prop); Properties::Measurement::register_comparative(comparative_form, bp);

    • This code is used in §13.
    @@ -696,7 +696,7 @@ prepositional usages to test property-equality ("the same height as").
    diff --git a/docs/core-module/15-pov.html b/docs/core-module/15-pov.html index dd899b646..d838ee9aa 100644 --- a/docs/core-module/15-pov.html +++ b/docs/core-module/15-pov.html @@ -177,7 +177,7 @@ and it seems best to reject the extra complexity needed.
    • This code is used in §4.
    diff --git a/docs/core-module/15-pr.html b/docs/core-module/15-pr.html index e884023da..b17dadf07 100644 --- a/docs/core-module/15-pr.html +++ b/docs/core-module/15-pr.html @@ -813,7 +813,7 @@ we find it, we compile it and return §26. Emitting to Inter.

    -inter_name *Properties::iname(property *prn) {
    +inter_name *Properties::iname(property *prn) {
         if (prn == NULL) internal_error("tried to find iname for null property");
         if ((Properties::is_either_or(prn)) && (prn->stored_in_negation))
             return Properties::iname(Properties::EitherOr::get_negation(prn));
    @@ -916,7 +916,7 @@ we find it, we compile it and return }
     
    diff --git a/docs/core-module/15-ps.html b/docs/core-module/15-ps.html index ef39096a1..a112eda35 100644 --- a/docs/core-module/15-ps.html +++ b/docs/core-module/15-ps.html @@ -159,9 +159,6 @@ a noun, we write it in the formal way "taking action". <activity-name-formal> ::= ... activity -<relation-name-formal> ::= - ... relation - <rule-name-formal> ::= ... rule @@ -229,7 +226,7 @@ production of <has-property-name>.
    • This code is used in §5 (twice).
    diff --git a/docs/core-module/15-spr.html b/docs/core-module/15-spr.html index 6fed6ebcf..0e4ae9024 100644 --- a/docs/core-module/15-spr.html +++ b/docs/core-module/15-spr.html @@ -119,12 +119,12 @@ to make C. J.) WRITE_TO(relname, "%V", rel_name); binary_predicate *bp = BinaryPredicates::make_pair(same_property_bp_family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL), - relname, NULL, NULL, - Calculus::Schemas::new("*1.%n = *2.%n", i6_pname, i6_pname), - Calculus::Schemas::new("*1.%n == *2.%n", i6_pname, i6_pname), + relname, NULL, + Calculus::Schemas::new("*1.%n = *2.%n", i6_pname, i6_pname), + Calculus::Schemas::new("*1.%n == *2.%n", i6_pname, i6_pname), WordAssemblages::lit_1(rel_name)); DISCARD_TEXT(relname) - bp->same_property = prn; + bp->family_specific = STORE_POINTER_property(prn); Properties::SameRelations::register_same_property_as(bp, Properties::get_name(prn)); } } @@ -186,7 +186,7 @@ truncate to a reasonable length, ensuring that the result doesn't exceed
     int Properties::SameRelations::REL_typecheck(bp_family *self, binary_predicate *bp,
    -        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
    +        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
         return DECLINE_TO_MATCH;
     }
     
    @@ -204,7 +204,7 @@ truncate to a reasonable length, ensuring that the result doesn't exceed
     int Properties::SameRelations::REL_compile(bp_family *self, int task,
    -    binary_predicate *bp, annotated_i6_schema *asch) {
    +    binary_predicate *bp, annotated_i6_schema *asch) {
         return FALSE;
     }
     
    @@ -212,7 +212,9 @@ truncate to a reasonable length, ensuring that the result doesn't exceed
     property *Properties::SameRelations::bp_get_same_as_property(binary_predicate *bp) {
    -    return bp->same_property;
    +    if (bp->relation_family != same_property_bp_family) return NULL;
    +    if (bp->right_way_round == FALSE) return NULL;
    +    return RETRIEVE_POINTER_property(bp->family_specific);
     }
     

    §7. Problem message text.

    @@ -223,7 +225,7 @@ truncate to a reasonable length, ensuring that the result doesn't exceed }
    diff --git a/docs/core-module/15-spr2.html b/docs/core-module/15-spr2.html index 47d8e79cd..3125b14a1 100644 --- a/docs/core-module/15-spr2.html +++ b/docs/core-module/15-spr2.html @@ -124,7 +124,7 @@ therefore store the text of the property name (say, "weight") in binary_predicate *bp = BinaryPredicates::make_pair(property_setting_bp_family, BinaryPredicates::new_term(Kinds::Knowledge::as_subject(K_object)), BinaryPredicates::new_term(NULL), - I"set-property", NULL, NULL, NULL, NULL, WordAssemblages::lit_0()); + I"set-property", NULL, NULL, NULL, WordAssemblages::lit_0()); bp->property_pending_text = W; bp->reversal->property_pending_text = W; return bp; @@ -226,9 +226,9 @@ and simplicity.
     void Properties::SettingRelations::set_property_BP_schemas(binary_predicate *bp, property *prn) {
         bp->test_function =
    -        Calculus::Schemas::new("*1.%n == *2", Properties::iname(prn));
    +        Calculus::Schemas::new("*1.%n == *2", Properties::iname(prn));
         bp->make_true_function =
    -        Calculus::Schemas::new("*1.%n = *2", Properties::iname(prn));
    +        Calculus::Schemas::new("*1.%n = *2", Properties::iname(prn));
         BinaryPredicates::set_term_domain(&(bp->term_details[1]),
             Properties::Valued::kind(prn));
     }
    @@ -248,7 +248,7 @@ instance, but hasn't been yet.
     
     
     int Properties::SettingRelations::REL_typecheck(bp_family *self, binary_predicate *bp,
    -        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
    +        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
         property *prn = bp->set_property;
         kind *val_kind = Properties::Valued::kind(prn);
         Require the value to be type-safe for storage in the property9.1;
    @@ -341,21 +341,21 @@ be caught later on Inform's run.
     
     
     int Properties::SettingRelations::REL_compile(bp_family *self, int task,
    -    binary_predicate *bp, annotated_i6_schema *asch) {
    -    kind *K = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt0);
    +    binary_predicate *bp, annotated_i6_schema *asch) {
    +    kind *K = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt0);
     
         if (Kinds::Behaviour::is_object(K)) return FALSE;
     
         property *prn = bp->set_property;
         switch (task) {
             case TEST_ATOM_TASK:
    -            Calculus::Schemas::modify(asch->schema,
    +            Calculus::Schemas::modify(asch->schema,
                     "GProperty(%k, *1, %n) == *2", K, Properties::iname(prn));
                 break;
             case NOW_ATOM_FALSE_TASK:
                 break;
             case NOW_ATOM_TRUE_TASK:
    -            Calculus::Schemas::modify(asch->schema,
    +            Calculus::Schemas::modify(asch->schema,
                     "WriteGProperty(%k, *1, %n, *2)", K, Properties::iname(prn));
                 break;
         }
    @@ -378,7 +378,7 @@ be caught later on Inform's run.
     }
     
    diff --git a/docs/core-module/15-tpr.html b/docs/core-module/15-tpr.html index 5e1d163ae..80401234a 100644 --- a/docs/core-module/15-tpr.html +++ b/docs/core-module/15-tpr.html @@ -106,7 +106,7 @@ grant permission to hold a property within the world model. R_provision = BinaryPredicates::make_pair(provision_bp_family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL), - I"provides", NULL, NULL, NULL, NULL, + I"provides", NULL, NULL, NULL, PreformUtilities::wording(<relation-names>, PROVISION_RELATION_NAME)); BinaryPredicates::set_index_details(R_provision, "value", "property"); } @@ -119,7 +119,7 @@ The right term, of course, has to be a property.
     int Properties::ProvisionRelation::REL_typecheck(bp_family *self, binary_predicate *bp,
    -        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
    +        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
         if (Kinds::get_construct(kinds_of_terms[1]) == CON_property) return ALWAYS_MATCH;
         Problems::quote_kind(4, kinds_of_terms[1]);
         StandardProblems::tcp_problem(_p_(PM_BadProvides), tck,
    @@ -154,10 +154,10 @@ can't be changed at compile time.
     
     
     int Properties::ProvisionRelation::REL_compile(bp_family *self, int task, binary_predicate *bp,
    -    annotated_i6_schema *asch) {
    -    if (task == TEST_ATOM_TASK) {
    -        kind *K = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt0);
    -        property *prn = Rvalues::to_property(asch->pt1.constant);
    +    annotated_i6_schema *asch) {
    +    if (task == TEST_ATOM_TASK) {
    +        kind *K = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt0);
    +        property *prn = Rvalues::to_property(asch->pt1.constant);
             if (K) {
                 if (prn) {
                     if (Kinds::Behaviour::is_object(K))
    @@ -166,12 +166,12 @@ can't be changed at compile time.
                         Determine the result now, since we know already, and compile only the outcome6.2;
                     return TRUE;
                 } else if (Kinds::Behaviour::is_object(K)) {
    -                kind *PK = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt1);
    +                kind *PK = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt1);
                     if (Kinds::get_construct(PK) == CON_property) {
                         if (Kinds::eq(K_truth_state, Kinds::unary_construction_material(PK)))
    -                        Calculus::Schemas::modify(asch->schema, "WhetherProvides(*1, true, *2)");
    +                        Calculus::Schemas::modify(asch->schema, "WhetherProvides(*1, true, *2)");
                         else
    -                        Calculus::Schemas::modify(asch->schema, "WhetherProvides(*1, false, *2)");
    +                        Calculus::Schemas::modify(asch->schema, "WhetherProvides(*1, false, *2)");
                         return TRUE;
                     }
                 }
    @@ -189,9 +189,9 @@ of object the left operand is, we can only test property provision at run-time:
     
     
         if (Properties::is_value_property(prn))
    -        Calculus::Schemas::modify(asch->schema, "WhetherProvides(*1, false, *2)");
    +        Calculus::Schemas::modify(asch->schema, "WhetherProvides(*1, false, *2)");
         else
    -        Calculus::Schemas::modify(asch->schema, "WhetherProvides(*1, true, *2)");
    +        Calculus::Schemas::modify(asch->schema, "WhetherProvides(*1, true, *2)");
     
    • This code is used in §6.

    §6.2. For all other kinds, type-checking is strong enough that we can prove the @@ -203,9 +203,9 @@ answer now.

         if (World::Permissions::find(Kinds::Knowledge::as_subject(K), prn, TRUE))
    -        Calculus::Schemas::modify(asch->schema, "true");
    +        Calculus::Schemas::modify(asch->schema, "true");
         else
    -        Calculus::Schemas::modify(asch->schema, "false");
    +        Calculus::Schemas::modify(asch->schema, "false");
     
    • This code is used in §6.

    §7. Problem message text. Nothing special is needed here. @@ -220,7 +220,7 @@ answer now. }

    diff --git a/docs/core-module/15-vp.html b/docs/core-module/15-vp.html index 8c4b83aa2..dc61fd3aa 100644 --- a/docs/core-module/15-vp.html +++ b/docs/core-module/15-vp.html @@ -326,7 +326,7 @@ storage methods at run-time if we wanted.) }
    diff --git a/docs/core-module/16-cmw.html b/docs/core-module/16-cmw.html index 8ed0ee4bb..3e5243303 100644 --- a/docs/core-module/16-cmw.html +++ b/docs/core-module/16-cmw.html @@ -296,7 +296,7 @@ about the Portal, to stand. }
    diff --git a/docs/core-module/16-cmw2.html b/docs/core-module/16-cmw2.html index 4f42383ad..2d159b972 100644 --- a/docs/core-module/16-cmw2.html +++ b/docs/core-module/16-cmw2.html @@ -105,7 +105,7 @@ to write anything, then put the same question to the subjects. }
    diff --git a/docs/core-module/16-ic.html b/docs/core-module/16-ic.html index b56c63d48..deb509351 100644 --- a/docs/core-module/16-ic.html +++ b/docs/core-module/16-ic.html @@ -491,22 +491,22 @@ constants, and use the Link constants to progress; we stop at -int PL::Counting::optimise_loop(i6_schema *sch, kind *K) { +int PL::Counting::optimise_loop(i6_schema *sch, kind *K) { if (Plugins::Manage::plugged_in(counting_plugin) == FALSE) return FALSE; inference_subject *subj = Kinds::Knowledge::as_subject(K); if (PF_S(counting, subj)->has_instances == FALSE) (to avoid writing misleading code) - Calculus::Schemas::modify(sch, + Calculus::Schemas::modify(sch, "for (*1=nothing: false: )"); else { inter_name *first_iname = PL::Counting::first_instance(K); inter_name *next_iname = PL::Counting::next_instance(K); - Calculus::Schemas::modify(sch, "for (*1=%n: *1: *1=*1.%n)", first_iname, next_iname); + Calculus::Schemas::modify(sch, "for (*1=%n: *1: *1=*1.%n)", first_iname, next_iname); } return TRUE; }
    diff --git a/docs/core-module/16-in.html b/docs/core-module/16-in.html index a0c4b4cbb..3d179a9b0 100644 --- a/docs/core-module/16-in.html +++ b/docs/core-module/16-in.html @@ -229,7 +229,7 @@ might not actually accept it; it might be redundant, or contradictory.)

    -void World::Inferences::draw_property(inference_subject *infs,
    +void World::Inferences::draw_property(inference_subject *infs,
         property *prn, parse_node *val) {
         inference *i = World::Inferences::create_property_inference(infs, prn, val);
         World::Inferences::join_inference(i, infs);
    @@ -242,13 +242,13 @@ might not actually accept it; it might be redundant, or contradictory.)
         World::Inferences::join_inference(i, infs);
     }
     
    -void World::Inferences::draw_relation(binary_predicate *bp,
    +void World::Inferences::draw_relation(binary_predicate *bp,
         inference_subject *infs0, inference_subject *infs1) {
         inference *i = World::Inferences::create_relation_inference(infs0, infs1);
         World::Inferences::join_inference(i, BinaryPredicates::as_subject(bp));
     }
     
    -void World::Inferences::draw_relation_spec(binary_predicate *bp,
    +void World::Inferences::draw_relation_spec(binary_predicate *bp,
         parse_node *spec0, parse_node *spec1) {
         inference *i = World::Inferences::create_relation_inference_spec(spec0, spec1);
         World::Inferences::join_inference(i, BinaryPredicates::as_subject(bp));
    @@ -314,12 +314,12 @@ way to extract just reference 1 in object form.
     

    -void World::Inferences::get_references(inference *i,
    +void World::Inferences::get_references(inference *i,
         inference_subject **infs1, inference_subject **infs2) {
         if (infs1) *infs1 = i->infs_ref1; if (infs2) *infs2 = i->infs_ref2;
     }
     
    -void World::Inferences::get_references_spec(inference *i,
    +void World::Inferences::get_references_spec(inference *i,
         parse_node **spec1, parse_node **spec2) {
         *spec1 = i->spec_ref1; *spec2 = i->spec_ref2;
     }
    @@ -1012,7 +1012,7 @@ bugs if inferences are incorrectly ignored.
     }
     
    diff --git a/docs/core-module/16-is.html b/docs/core-module/16-is.html index fce13376f..b2d94ea30 100644 --- a/docs/core-module/16-is.html +++ b/docs/core-module/16-is.html @@ -135,6 +135,11 @@ words, we often want to know what a given subject S inherits from, but we never ask what other subjects inherit from S.

    +
    define TERM_DOMAIN_CALCULUS_TYPE struct inference_subject
    +define TERM_DOMAIN_WORDING_FUNCTION InferenceSubjects::get_name_text
    +define TERM_DOMAIN_TO_KIND_FUNCTION InferenceSubjects::domain
    +define TERM_DOMAIN_FROM_KIND_FUNCTION Kinds::Knowledge::as_subject
    +
     typedef struct inference_subject {
         int kind_of_infs;  one of the *_SUB constants above
    @@ -422,7 +427,7 @@ arise.
     

    -parse_node *InferenceSubjects::as_constant(inference_subject *infs) {
    +parse_node *InferenceSubjects::as_constant(inference_subject *infs) {
         kind *K = InferenceSubjects::domain(infs);
         if (K) return Specifications::from_kind(K);
     
    @@ -481,7 +486,7 @@ arise.
         return NULL;
     }
     
    -binary_predicate *InferenceSubjects::as_bp(inference_subject *infs) {
    +binary_predicate *InferenceSubjects::as_bp(inference_subject *infs) {
         if ((infs) && (infs->kind_of_infs == RELN_SUB))
             return RETRIEVE_POINTER_binary_predicate(infs->represents);
         return NULL;
    @@ -516,7 +521,7 @@ from kinds actually do.)
     

    -kind *InferenceSubjects::domain(inference_subject *infs) {
    +kind *InferenceSubjects::domain(inference_subject *infs) {
         return InferenceSubjects::as_kind(infs);
     }
     
    @@ -575,7 +580,7 @@ word range into the variables pointed to by -wording InferenceSubjects::get_name_text(inference_subject *infs) { +wording InferenceSubjects::get_name_text(inference_subject *infs) { if (infs == NULL) internal_error("null INFS"); wording W = EMPTY_WORDING; switch (infs->kind_of_infs) { @@ -583,7 +588,7 @@ word range into the variables pointed to by case KIND_SUB: W = Kinds::Knowledge::get_name_text(infs); break; case INST_SUB: W = Instances::SUBJ_get_name_text(infs); break; case VARI_SUB: W = NonlocalVariables::SUBJ_get_name_text(infs); break; - case RELN_SUB: W = BinaryPredicates::SUBJ_get_name_text(infs); break; + case RELN_SUB: W = KnowledgeAboutRelations::SUBJ_get_name_text(infs); break; } LOOP_THROUGH_WORDING(i, W) if (Lexer::word(i) == STROKE_V) { @@ -607,7 +612,7 @@ to the permission, or NULL_GE case KIND_SUB: return Kinds::Knowledge::new_permission_granted(infs); case INST_SUB: return Instances::SUBJ_new_permission_granted(infs); case VARI_SUB: return NonlocalVariables::SUBJ_new_permission_granted(infs); - case RELN_SUB: return BinaryPredicates::SUBJ_new_permission_granted(infs); + case RELN_SUB: return KnowledgeAboutRelations::SUBJ_new_permission_granted(infs); } return NULL_GENERAL_POINTER; } @@ -627,7 +632,7 @@ of "green" as an adjective. case KIND_SUB: Kinds::Knowledge::make_adj_const_domain(infs, nc, prn); break; case INST_SUB: Instances::SUBJ_make_adj_const_domain(infs, nc, prn); break; case VARI_SUB: NonlocalVariables::SUBJ_make_adj_const_domain(infs, nc, prn); break; - case RELN_SUB: BinaryPredicates::SUBJ_make_adj_const_domain(infs, nc, prn); break; + case RELN_SUB: KnowledgeAboutRelations::SUBJ_make_adj_const_domain(infs, nc, prn); break; } }
    @@ -644,7 +649,7 @@ to fill in anything missing about itself: case KIND_SUB: Kinds::Knowledge::complete_model(infs); break; case INST_SUB: Instances::SUBJ_complete_model(infs); break; case VARI_SUB: NonlocalVariables::SUBJ_complete_model(infs); break; - case RELN_SUB: BinaryPredicates::SUBJ_complete_model(infs); break; + case RELN_SUB: KnowledgeAboutRelations::SUBJ_complete_model(infs); break; } }
    @@ -660,7 +665,7 @@ consistency, and to issue problem messages if something is wrong: case KIND_SUB: Kinds::Knowledge::check_model(infs); break; case INST_SUB: Instances::SUBJ_check_model(infs); break; case VARI_SUB: NonlocalVariables::SUBJ_check_model(infs); break; - case RELN_SUB: BinaryPredicates::SUBJ_check_model(infs); break; + case RELN_SUB: KnowledgeAboutRelations::SUBJ_check_model(infs); break; } }
    @@ -683,7 +688,7 @@ condition blank.) case KIND_SUB: written = Kinds::Knowledge::emit_element_of_condition(infs, t0_s); break; case INST_SUB: written = Instances::SUBJ_emit_element_of_condition(infs, t0_s); break; case VARI_SUB: written = NonlocalVariables::SUBJ_emit_element_of_condition(infs, t0_s); break; - case RELN_SUB: written = BinaryPredicates::SUBJ_emit_element_of_condition(infs, t0_s); break; + case RELN_SUB: written = KnowledgeAboutRelations::SUBJ_emit_element_of_condition(infs, t0_s); break; } if (written == FALSE) { Produce::val(Emit::tree(), K_truth_state, LITERAL_IVAL, 1); @@ -716,7 +721,7 @@ creation. compile_all< case KIND_SUB: done = Kinds::Knowledge::emit_all(); break; case INST_SUB: done = Instances::SUBJ_compile_all(); break; case VARI_SUB: done = NonlocalVariables::SUBJ_compile_all(); break; - case RELN_SUB: done = BinaryPredicates::SUBJ_compile_all(); break; + case RELN_SUB: done = KnowledgeAboutRelations::SUBJ_compile_all(); break; } if (done) continue; inference_subject *infs; @@ -727,14 +732,14 @@ creation. compile_all< case KIND_SUB: Kinds::Knowledge::emit(infs); break; case INST_SUB: Instances::SUBJ_compile(infs); break; case VARI_SUB: NonlocalVariables::SUBJ_compile(infs); break; - case RELN_SUB: BinaryPredicates::SUBJ_compile(infs); break; + case RELN_SUB: KnowledgeAboutRelations::SUBJ_compile(infs); break; } } } }
    diff --git a/docs/core-module/16-kar.html b/docs/core-module/16-kar.html new file mode 100644 index 000000000..0611b31db --- /dev/null +++ b/docs/core-module/16-kar.html @@ -0,0 +1,159 @@ + + + + Knowledge about Relations + + + + + + + + + + + + + + + + + + +
    + + +

    To store inferences about the state of relationships.

    + +

    §1.

    + +
    +wording KnowledgeAboutRelations::SUBJ_get_name_text(inference_subject *from) {
    +    return EMPTY_WORDING;  nameless
    +}
    +
    +general_pointer KnowledgeAboutRelations::SUBJ_new_permission_granted(inference_subject *from) {
    +    return NULL_GENERAL_POINTER;
    +}
    +
    +void KnowledgeAboutRelations::SUBJ_make_adj_const_domain(inference_subject *infs,
    +    instance *nc, property *prn) {
    +}
    +
    +void KnowledgeAboutRelations::SUBJ_complete_model(inference_subject *infs) {
    +    int domain_size = NUMBER_CREATED(inference_subject);
    +    binary_predicate *bp = InferenceSubjects::as_bp(infs);
    +
    +    if (BinaryPredicates::store_dynamically(bp)) return;  handled at run-time instead
    +    if ((BinaryPredicates::get_form_of_relation(bp) == Relation_Equiv) && (bp->right_way_round)) {
    +        Relations::equivalence_relation_make_singleton_partitions(bp, domain_size);
    +        inference *i;
    +        POSITIVE_KNOWLEDGE_LOOP(i, BinaryPredicates::as_subject(bp), ARBITRARY_RELATION_INF) {
    +            inference_subject *infs0, *infs1;
    +            World::Inferences::get_references(i, &infs0, &infs1);
    +            Relations::equivalence_relation_merge_classes(bp, domain_size,
    +                infs0->allocation_id, infs1->allocation_id);
    +        }
    +        Relations::equivalence_relation_add_properties(bp);
    +    }
    +}
    +
    +void KnowledgeAboutRelations::SUBJ_check_model(inference_subject *infs) {
    +    binary_predicate *bp = InferenceSubjects::as_bp(infs);
    +    if ((bp->right_way_round) &&
    +        ((bp->form_of_relation == Relation_OtoO) ||
    +            (bp->form_of_relation == Relation_Sym_OtoO)))
    +        Relations::check_OtoO_relation(bp);
    +    if ((bp->right_way_round) &&
    +        ((bp->form_of_relation == Relation_OtoV) ||
    +            (bp->form_of_relation == Relation_VtoO)))
    +        Relations::check_OtoV_relation(bp);
    +}
    +
    +int KnowledgeAboutRelations::SUBJ_emit_element_of_condition(inference_subject *infs, inter_symbol *t0_s) {
    +    internal_error("BP in runtime match condition");
    +    return FALSE;
    +}
    +
    +int KnowledgeAboutRelations::SUBJ_compile_all(void) {
    +    return FALSE;
    +}
    +
    +void KnowledgeAboutRelations::SUBJ_compile(inference_subject *infs) {
    +    binary_predicate *bp = InferenceSubjects::as_bp(infs);
    +    if (bp->right_way_round) {
    +        if (BinaryPredicates::store_dynamically(bp)) {
    +            packaging_state save = Routines::begin(bp->initialiser_iname);
    +            inference *i;
    +            inter_name *rtiname = Hierarchy::find(RELATIONTEST_HL);
    +            POSITIVE_KNOWLEDGE_LOOP(i, BinaryPredicates::as_subject(bp), ARBITRARY_RELATION_INF) {
    +                parse_node *spec0, *spec1;
    +                World::Inferences::get_references_spec(i, &spec0, &spec1);
    +                BinaryPredicates::mark_as_needed(bp);
    +                Produce::inv_call_iname(Emit::tree(), rtiname);
    +                Produce::down(Emit::tree());
    +                    Produce::val_iname(Emit::tree(), K_value, bp->bp_iname);
    +                    Produce::val_iname(Emit::tree(), K_value, Hierarchy::find(RELS_ASSERT_TRUE_HL));
    +                    Specifications::Compiler::emit_as_val(K_value, spec0);
    +                    Specifications::Compiler::emit_as_val(K_value, spec1);
    +                Produce::up(Emit::tree());
    +            }
    +            Routines::end(save);
    +        } else {
    +            if ((bp->form_of_relation == Relation_VtoV) ||
    +                (bp->form_of_relation == Relation_Sym_VtoV))
    +                Relations::compile_vtov_storage(bp);
    +        }
    +    }
    +}
    +
    + + +
    + + + diff --git a/docs/core-module/16-pp.html b/docs/core-module/16-pp.html index 5670f88eb..530c50db7 100644 --- a/docs/core-module/16-pp.html +++ b/docs/core-module/16-pp.html @@ -329,7 +329,7 @@ property — when indexing who can own it. }
    diff --git a/docs/core-module/17-rs.html b/docs/core-module/17-rs.html index e10ffa380..bd0618270 100644 --- a/docs/core-module/17-rs.html +++ b/docs/core-module/17-rs.html @@ -585,7 +585,7 @@ text to assert a change:

    §10.

    -int Strings::get_marker_from_response_spec(parse_node *rs) {
    +int Strings::get_marker_from_response_spec(parse_node *rs) {
         if (Rvalues::is_CONSTANT_of_kind(rs, K_response)) {
             wording SW = Node::get_text(rs);
             if ((Wordings::length(SW) >= 2) && (<response-letter>(Wordings::one_word(Wordings::last_wn(SW)-1))))
    @@ -609,7 +609,7 @@ but to something like an XML description of its metadata, where again the
     text needs to be printed in a particular way.
     
  • -void Strings::compile_general(value_holster *VH, parse_node *str) {
    +void Strings::compile_general(value_holster *VH, parse_node *str) {
         wording SW = Node::get_text(str);
         if (Annotations::read_int(str, explicit_literal_ANNOT)) {
             if (Node::get_explicit_iname(str)) {
    @@ -692,7 +692,7 @@ text needs to be printed in a particular way.
     
    diff --git a/docs/core-module/17-tl.html b/docs/core-module/17-tl.html index da0c31483..2c3985c41 100644 --- a/docs/core-module/17-tl.html +++ b/docs/core-module/17-tl.html @@ -466,7 +466,7 @@ number -1). } diff --git a/docs/core-module/17-ts.html b/docs/core-module/17-ts.html index 79ecc3348..fa9bf713a 100644 --- a/docs/core-module/17-ts.html +++ b/docs/core-module/17-ts.html @@ -453,7 +453,7 @@ we aren't doing very much; most TSs will be passed quickly over. } diff --git a/docs/core-module/18-lc.html b/docs/core-module/18-lc.html index 9e2df2002..1197e0546 100644 --- a/docs/core-module/18-lc.html +++ b/docs/core-module/18-lc.html @@ -439,7 +439,7 @@ the list!); } diff --git a/docs/core-module/19-lr.html b/docs/core-module/19-lr.html index 2da3f8fc3..4aa086f50 100644 --- a/docs/core-module/19-lr.html +++ b/docs/core-module/19-lr.html @@ -99,8 +99,8 @@ predicates instead. binary_predicate *bp = BinaryPredicates::make_pair(listed_in_bp_family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(Kinds::Knowledge::as_subject(K_table)), - I"listed_in", I"lists-in", NULL, NULL, - Calculus::Schemas::new("(ct_1=ExistsTableRowCorr(ct_0=*2,%d,*1))", + I"listed_in", I"lists-in", NULL, + Calculus::Schemas::new("(ct_1=ExistsTableRowCorr(ct_0=*2,%d,*1))", Tables::Columns::get_id(tc)), WordAssemblages::lit_0()); bp->a_listed_in_predicate = TRUE; @@ -125,7 +125,7 @@ in later, instead:
     int Tables::Relations::REL_typecheck(bp_family *self, binary_predicate *bp,
    -        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
    +        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
         return DECLINE_TO_MATCH;
     }
     
    @@ -145,8 +145,8 @@ the table reference for any successful lookup.

    -int Tables::Relations::REL_compile(bp_family *self, int task, binary_predicate *bp, annotated_i6_schema *asch) {
    -    if (task == TEST_ATOM_TASK) LocalVariables::add_table_lookup();
    +int Tables::Relations::REL_compile(bp_family *self, int task, binary_predicate *bp, annotated_i6_schema *asch) {
    +    if (task == TEST_ATOM_TASK) LocalVariables::add_table_lookup();
         return FALSE;
     }
     
    @@ -159,7 +159,7 @@ the table reference for any successful lookup. } diff --git a/docs/core-module/19-rsft.html b/docs/core-module/19-rsft.html index 1443f2e20..be0ec8e4e 100644 --- a/docs/core-module/19-rsft.html +++ b/docs/core-module/19-rsft.html @@ -463,7 +463,7 @@ should return FALSE} diff --git a/docs/core-module/19-tb.html b/docs/core-module/19-tb.html index d763d2c7b..cd689947d 100644 --- a/docs/core-module/19-tb.html +++ b/docs/core-module/19-tb.html @@ -1732,7 +1732,7 @@ given extension: } diff --git a/docs/core-module/19-tc.html b/docs/core-module/19-tc.html index 3ed1d6d01..28d01769f 100644 --- a/docs/core-module/19-tc.html +++ b/docs/core-module/19-tc.html @@ -689,7 +689,7 @@ happens: } diff --git a/docs/core-module/2-pwst.html b/docs/core-module/2-pwst.html index ee70f6ae7..e5b15d8e9 100644 --- a/docs/core-module/2-pwst.html +++ b/docs/core-module/2-pwst.html @@ -485,7 +485,7 @@ group. } diff --git a/docs/core-module/2-si.html b/docs/core-module/2-si.html index ae75b7669..eb297c93d 100644 --- a/docs/core-module/2-si.html +++ b/docs/core-module/2-si.html @@ -208,19 +208,19 @@ table we are in, yet still only cite a small part of it —

    -void StandardProblems::tcp_problem(SIGIL_ARGUMENTS, tc_problem_kit *tck, char *prototype) {
    -    if (tck->issue_error) {
    +void StandardProblems::tcp_problem(SIGIL_ARGUMENTS, tc_problem_kit *tck, char *prototype) {
    +    if (tck->issue_error) {
             ACT_ON_SIGIL
             Problems::quote_source(1, current_sentence);
    -        Problems::quote_wording(2, tck->ew_text);
    -        Problems::quote_text(3, tck->intention);
    +        Problems::quote_wording(2, tck->ew_text);
    +        Problems::quote_text(3, tck->intention);
             Problems::issue_problem_begin(Task::syntax_tree(), "");
             Problems::issue_problem_segment(
                 "In the sentence %1, it looks as if you intend '%2' to %3, but ");
             Problems::issue_problem_segment(prototype);
             Problems::issue_problem_end();
         }
    -    tck->flag_problem = TRUE;
    +    tck->flag_problem = TRUE;
     }
     

    §7. Instance problems. Instances can be created rather indirectly (for instance, in the course of @@ -417,7 +417,7 @@ own quaint syntax, and where there is syntax, there are error messages: }

    diff --git a/docs/core-module/2-sq.html b/docs/core-module/2-sq.html index 6b87e8f56..10ea8e144 100644 --- a/docs/core-module/2-sq.html +++ b/docs/core-module/2-sq.html @@ -80,7 +80,7 @@ wouldn't auto-predeclare them; and there aren't so very many of them.) void Problems::expand_spec(OUTPUT_STREAM, void *p) { Specifications::write_out_in_English(OUT, (parse_node *) p); } -void Problems::quote_relation(int t, binary_predicate *p) { +void Problems::quote_relation(int t, binary_predicate *p) { Problems::problem_quote(t, (void *) p, Problems::expand_relation); } void Problems::expand_relation(OUTPUT_STREAM, void *p) { @@ -176,7 +176,7 @@ this as some kind of marginal will-never-happen case.

    -void Problems::quote_kind(int t, kind *K) {
    +void Problems::quote_kind(int t, kind *K) {
         if ((K == NULL) || (Kinds::eq(K, K_nil))) Problems::quote_text(t, "nothing");
         else if ((K == NULL) || (Kinds::eq(K, K_void))) Problems::quote_text(t, "nothing");
         else Problems::problem_quote(t, (void *) K, Problems::expand_kind);
    @@ -212,7 +212,7 @@ actual constant 15 to the generic constant "number":
     }
     
    diff --git a/docs/core-module/2-up.html b/docs/core-module/2-up.html index 9465dbfa7..21cbc8dcf 100644 --- a/docs/core-module/2-up.html +++ b/docs/core-module/2-up.html @@ -373,7 +373,7 @@ a message which diagnoses the problem rather better. } diff --git a/docs/core-module/20-eq.html b/docs/core-module/20-eq.html index 9bd8ebba4..c41bf6c77 100644 --- a/docs/core-module/20-eq.html +++ b/docs/core-module/20-eq.html @@ -2521,7 +2521,7 @@ parse the equation, then rearrange to solve it for each variable in turn. } diff --git a/docs/core-module/21-ac.html b/docs/core-module/21-ac.html index 8a38a9180..3d45a8ab8 100644 --- a/docs/core-module/21-ac.html +++ b/docs/core-module/21-ac.html @@ -783,7 +783,7 @@ values, of the kind to which the activity applies. } diff --git a/docs/core-module/21-fao.html b/docs/core-module/21-fao.html index 42cb8f21a..e68a9bd64 100644 --- a/docs/core-module/21-fao.html +++ b/docs/core-module/21-fao.html @@ -621,7 +621,7 @@ can be used in a void context as a sort of return-from-rule phrase. } diff --git a/docs/core-module/21-rb.html b/docs/core-module/21-rb.html index 88dbc3cc8..3807e129a 100644 --- a/docs/core-module/21-rb.html +++ b/docs/core-module/21-rb.html @@ -1184,7 +1184,7 @@ its rule requires: #endif diff --git a/docs/core-module/21-rl.html b/docs/core-module/21-rl.html index c0cc6f4f0..a4c4cd75c 100644 --- a/docs/core-module/21-rl.html +++ b/docs/core-module/21-rl.html @@ -1181,7 +1181,7 @@ optionally be used.) diff --git a/docs/core-module/21-rl2.html b/docs/core-module/21-rl2.html index 8422f78bb..6e34e2980 100644 --- a/docs/core-module/21-rl2.html +++ b/docs/core-module/21-rl2.html @@ -1459,7 +1459,7 @@ popular rulebooks, showing their contents in logical order. diff --git a/docs/core-module/21-sv.html b/docs/core-module/21-sv.html index 63ace35e6..4f8e86882 100644 --- a/docs/core-module/21-sv.html +++ b/docs/core-module/21-sv.html @@ -369,7 +369,7 @@ function togglePopup(material_id) { } diff --git a/docs/core-module/22-cs.html b/docs/core-module/22-cs.html index 5d850c693..b93118d11 100644 --- a/docs/core-module/22-cs.html +++ b/docs/core-module/22-cs.html @@ -593,7 +593,7 @@ can be called multiple times in the course of the evening.) } diff --git a/docs/core-module/22-dptd.html b/docs/core-module/22-dptd.html index 3bfef051b..190f00428 100644 --- a/docs/core-module/22-dptd.html +++ b/docs/core-module/22-dptd.html @@ -1226,7 +1226,7 @@ in exactly one place: for example, diff --git a/docs/core-module/22-itp.html b/docs/core-module/22-itp.html index 8e18d1d7d..191036838 100644 --- a/docs/core-module/22-itp.html +++ b/docs/core-module/22-itp.html @@ -223,7 +223,7 @@ significant timing difficulties.

    diff --git a/docs/core-module/22-pav.html b/docs/core-module/22-pav.html index 71da465d2..b34ff0240 100644 --- a/docs/core-module/22-pav.html +++ b/docs/core-module/22-pav.html @@ -309,7 +309,7 @@ made above. diff --git a/docs/core-module/22-ph.html b/docs/core-module/22-ph.html index 71bf95298..7830b23ed 100644 --- a/docs/core-module/22-ph.html +++ b/docs/core-module/22-ph.html @@ -588,7 +588,7 @@ response to "requests". All other phrases are compiled just once. } diff --git a/docs/core-module/22-pi.html b/docs/core-module/22-pi.html index 421b00ab1..a72899fd5 100644 --- a/docs/core-module/22-pi.html +++ b/docs/core-module/22-pi.html @@ -338,7 +338,7 @@ above, it may as well go here. } diff --git a/docs/core-module/22-po.html b/docs/core-module/22-po.html index f6178de89..40ee296e2 100644 --- a/docs/core-module/22-po.html +++ b/docs/core-module/22-po.html @@ -402,7 +402,7 @@ by "and": diff --git a/docs/core-module/22-prcd.html b/docs/core-module/22-prcd.html index 956fbb6a8..b97154386 100644 --- a/docs/core-module/22-prcd.html +++ b/docs/core-module/22-prcd.html @@ -635,7 +635,7 @@ with the default outcome return (see above). diff --git a/docs/core-module/22-ptd.html b/docs/core-module/22-ptd.html index eb62e28a3..cca0220b3 100644 --- a/docs/core-module/22-ptd.html +++ b/docs/core-module/22-ptd.html @@ -986,7 +986,7 @@ source text. } diff --git a/docs/core-module/22-pu.html b/docs/core-module/22-pu.html index 98a854744..bd803f274 100644 --- a/docs/core-module/22-pu.html +++ b/docs/core-module/22-pu.html @@ -1300,7 +1300,7 @@ might have gone wrong. diff --git a/docs/core-module/22-tp.html b/docs/core-module/22-tp.html index c234fa950..b57985f64 100644 --- a/docs/core-module/22-tp.html +++ b/docs/core-module/22-tp.html @@ -398,7 +398,7 @@ is confined to the current Chapter. } diff --git a/docs/core-module/22-tp2.html b/docs/core-module/22-tp2.html index 3143ab57f..08ba1a255 100644 --- a/docs/core-module/22-tp2.html +++ b/docs/core-module/22-tp2.html @@ -238,7 +238,7 @@ arguably shouldn't block compilation. Then again... diff --git a/docs/core-module/23-abc.html b/docs/core-module/23-abc.html index eeadf7a05..e671d1e2b 100644 --- a/docs/core-module/23-abc.html +++ b/docs/core-module/23-abc.html @@ -139,7 +139,7 @@ function togglePopup(material_id) { } diff --git a/docs/core-module/23-abp.html b/docs/core-module/23-abp.html index e13060d9a..8a93c0217 100644 --- a/docs/core-module/23-abp.html +++ b/docs/core-module/23-abp.html @@ -80,8 +80,8 @@ And here's another one. LOOP_OVER(def, definition) if ((def->definition_node == p) && (Adjectives::Meanings::get_form(def->am_of_def) == PHRASE_KADJ)) { - i6_schema *sch = Adjectives::Meanings::set_i6_schema(def->am_of_def, TEST_ADJECTIVE_TASK, FALSE); - Calculus::Schemas::modify(sch, "(%n(*1))", Phrases::iname(ph)); + i6_schema *sch = Adjectives::Meanings::set_i6_schema(def->am_of_def, TEST_ADJECTIVE_TASK, FALSE); + Calculus::Schemas::modify(sch, "(%n(*1))", Phrases::iname(ph)); *CW = def->domain_calling; *K = Adjectives::Meanings::get_domain_forcing(def->am_of_def); if ((*K == NULL) || (Kinds::Behaviour::is_object(*K))) @@ -121,7 +121,7 @@ And here's another one. } diff --git a/docs/core-module/23-abrc.html b/docs/core-module/23-abrc.html index 04ae39eb9..1537bfa79 100644 --- a/docs/core-module/23-abrc.html +++ b/docs/core-module/23-abrc.html @@ -96,9 +96,9 @@ function togglePopup(material_id) { Adjectives::Meanings::declare(am, AW, 8); Adjectives::Meanings::pass_task_to_support_routine(am, TEST_ADJECTIVE_TASK); Adjectives::Meanings::set_domain_text(am, DNW); - i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE); + i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE); Word::dequote(text_wn); - Calculus::Schemas::modify(sch, "(%N)", text_wn); + Calculus::Schemas::modify(sch, "(%N)", text_wn); return am; } @@ -119,7 +119,7 @@ function togglePopup(material_id) { } diff --git a/docs/core-module/23-abrp.html b/docs/core-module/23-abrp.html index 8ae348386..d23bb69d6 100644 --- a/docs/core-module/23-abrp.html +++ b/docs/core-module/23-abrp.html @@ -105,16 +105,16 @@ This little grammar catches definitions delegated to Inform 6 routines. Adjectives::Meanings::declare(am, AW, 9); Adjectives::Meanings::set_domain_text(am, DNW); if (setting) { - i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, TRUE); - Calculus::Schemas::modify(sch, "*=-(%N(*1, -1))", rname_wn); + i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, TRUE); + Calculus::Schemas::modify(sch, "*=-(%N(*1, -1))", rname_wn); sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_TRUE_TASK, TRUE); - Calculus::Schemas::modify(sch, "*=-(%N(*1, true))", rname_wn); + Calculus::Schemas::modify(sch, "*=-(%N(*1, true))", rname_wn); sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_FALSE_TASK, TRUE); - Calculus::Schemas::modify(sch, "*=-(%N(*1, false))", rname_wn); + Calculus::Schemas::modify(sch, "*=-(%N(*1, false))", rname_wn); } else { Adjectives::Meanings::pass_task_to_support_routine(am, TEST_ADJECTIVE_TASK); - i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, TRUE); - Calculus::Schemas::modify(sch, "*=-(%N(*1))", rname_wn); + i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, TRUE); + Calculus::Schemas::modify(sch, "*=-(%N(*1))", rname_wn); } return am; } @@ -136,7 +136,7 @@ This little grammar catches definitions delegated to Inform 6 routines. } diff --git a/docs/core-module/23-ad.html b/docs/core-module/23-ad.html index a100b62a1..6f285e4aa 100644 --- a/docs/core-module/23-ad.html +++ b/docs/core-module/23-ad.html @@ -329,7 +329,7 @@ offer the new adjective around and see if anybody claims it. } diff --git a/docs/core-module/24-ch.html b/docs/core-module/24-ch.html index f1140038d..4e3cf57e2 100644 --- a/docs/core-module/24-ch.html +++ b/docs/core-module/24-ch.html @@ -905,7 +905,7 @@ times". } diff --git a/docs/core-module/24-lv.html b/docs/core-module/24-lv.html index 50622dd8f..455f2621e 100644 --- a/docs/core-module/24-lv.html +++ b/docs/core-module/24-lv.html @@ -836,7 +836,7 @@ the text "X":

    -local_variable *LocalVariables::ensure_called_local(wording W, kind *K) {
    +local_variable *LocalVariables::ensure_called_local(wording W, kind *K) {
         ph_stack_frame *phsf = Frames::current_stack_frame();
         if (phsf == NULL) return NULL;  in case callings are made from parsing alone
         <new-called-name>(W);
    @@ -1363,7 +1363,7 @@ need in the compilation of any given routine:
     }
     
    diff --git a/docs/core-module/24-pb.html b/docs/core-module/24-pb.html index 16551ba44..6f7951bdb 100644 --- a/docs/core-module/24-pb.html +++ b/docs/core-module/24-pb.html @@ -372,7 +372,7 @@ phrase: } diff --git a/docs/core-module/24-sf.html b/docs/core-module/24-sf.html index bfc673b59..d202917da 100644 --- a/docs/core-module/24-sf.html +++ b/docs/core-module/24-sf.html @@ -260,7 +260,7 @@ reference to the past. LOGIF(LOCAL_VARIABLES, "Stack frame determines past\n"); } -int Frames::used_for_past_tense(void) { +int Frames::used_for_past_tense(void) { ph_stack_frame *phsf = Frames::current_stack_frame(); if (phsf == NULL) return FALSE; if (phsf->determines_past_conditions) return TRUE; @@ -338,8 +338,8 @@ The following is the routine called to make this note. void Frames::emit_allocation(kind *K) { pointer_allocation *pall = Frames::add_allocation(K, NULL); - i6_schema *all_sch = Calculus::Schemas::new("%S", pall->escaped_local_reference_code); - Calculus::Schemas::emit_expand_from_terms(all_sch, NULL, NULL, FALSE); + i6_schema *all_sch = Calculus::Schemas::new("%S", pall->escaped_local_reference_code); + Calculus::Schemas::emit_expand_from_terms(all_sch, NULL, NULL, FALSE); }

    §14.1. The following works out a call to BlkValueCreate which will return a @@ -404,7 +404,7 @@ a subarray of short blocks, indexed by the offset. }

    diff --git a/docs/core-module/25-ci.html b/docs/core-module/25-ci.html index b733abe6b..163b72095 100644 --- a/docs/core-module/25-ci.html +++ b/docs/core-module/25-ci.html @@ -826,7 +826,7 @@ stop automatically generates a newline: diff --git a/docs/core-module/25-ciac.html b/docs/core-module/25-ciac.html index afcd248c5..5da7c0a7c 100644 --- a/docs/core-module/25-ciac.html +++ b/docs/core-module/25-ciac.html @@ -165,7 +165,7 @@ then follow, and finally the optional bitmap of phrase options. diff --git a/docs/core-module/25-cii.html b/docs/core-module/25-cii.html index 709fb8c4c..346dbeeae 100644 --- a/docs/core-module/25-cii.html +++ b/docs/core-module/25-cii.html @@ -1586,11 +1586,11 @@ dynamic lists, since Y is a block value not a word value. The point of the node_type_t storage_class = Lvalues::get_storage_form(to); if (copy_form != 0) Check that increment or decrement make sense3.5.4.3; char *prototype = Lvalues::interpret_store(storage_class, K1, K2, copy_form); - i6_schema *sch = Calculus::Schemas::new("%s;", prototype); + i6_schema *sch = Calculus::Schemas::new("%s;", prototype); LOGIF(KIND_CHECKING, "Inline copy: %s\n", prototype); BEGIN_COMPILATION_MODE; COMPILATION_MODE_ENTER(PERMIT_LOCALS_IN_TEXT_CMODE); - Calculus::Schemas::emit_expand_from_terms(sch, &pt1, &pt2, FALSE); + Calculus::Schemas::emit_expand_from_terms(sch, &pt1, &pt2, FALSE); END_COMPILATION_MODE; return; @@ -2319,7 +2319,7 @@ of defined adjectives. So: } diff --git a/docs/core-module/25-cp.html b/docs/core-module/25-cp.html index 4d301a4ad..434d1af2a 100644 --- a/docs/core-module/25-cp.html +++ b/docs/core-module/25-cp.html @@ -635,7 +635,7 @@ henceforth to be true, so we simply compile empty code in that case. parse_node *sw_v = Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING, lvar); pcalc_prop *prop = Calculus::Propositions::Abstract::to_set_relation( R_equality, NULL, sw_v, NULL, case_spec); - Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_no_problem_reporting()); + Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_no_problem_reporting()); Calculus::Deferrals::emit_test_of_proposition(NULL, prop); Produce::code(Emit::tree()); Produce::down(Emit::tree()); @@ -1184,7 +1184,7 @@ the "[if...]". } diff --git a/docs/core-module/25-in.html b/docs/core-module/25-in.html index 1aed421ca..cedaa8a9a 100644 --- a/docs/core-module/25-in.html +++ b/docs/core-module/25-in.html @@ -714,7 +714,7 @@ invocations listed: } diff --git a/docs/core-module/25-pi.html b/docs/core-module/25-pi.html index 42098d606..9d8186536 100644 --- a/docs/core-module/25-pi.html +++ b/docs/core-module/25-pi.html @@ -549,7 +549,7 @@ parser needs our help in the first place.) diff --git a/docs/core-module/26-ct.html b/docs/core-module/26-ct.html index 2b8ff2be1..93513b020 100644 --- a/docs/core-module/26-ct.html +++ b/docs/core-module/26-ct.html @@ -465,7 +465,7 @@ exceptional case. } diff --git a/docs/core-module/26-fc.html b/docs/core-module/26-fc.html index 9b6175a49..2e9ebcab8 100644 --- a/docs/core-module/26-fc.html +++ b/docs/core-module/26-fc.html @@ -211,7 +211,7 @@ Inform's own version number), but it belongs nowhere else either, so: } diff --git a/docs/core-module/26-i6i.html b/docs/core-module/26-i6i.html index 42b9952b1..4824d80da 100644 --- a/docs/core-module/26-i6i.html +++ b/docs/core-module/26-i6i.html @@ -310,7 +310,7 @@ requests, which, again, we do by instructing the Template code. } diff --git a/docs/core-module/26-itc.html b/docs/core-module/26-itc.html index 1c46114e6..ea64b3c76 100644 --- a/docs/core-module/26-itc.html +++ b/docs/core-module/26-itc.html @@ -296,14 +296,14 @@ only and may change at any time without notice. } if (p) { prop = Specifications::to_proposition(p); - tc = Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_no_problem_reporting()); + tc = Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_no_problem_reporting()); } Begin reporting on the internal test case4.3; Streams::enable_I6_escapes(DL); if (p == NULL) LOG("Failed: not a condition"); else { LOG("$D\n", prop); if (tc == FALSE) LOG("Failed: proposition would not type-check\n"); - Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_problem_logging()); + Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_problem_logging()); } Streams::disable_I6_escapes(DL); End reporting on the internal test case4.4; @@ -399,14 +399,14 @@ only and may change at any time without notice. } if (p) { prop = Specifications::to_proposition(p); - tc = Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_no_problem_reporting()); + tc = Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_no_problem_reporting()); } Begin reporting on the internal test case4.3; Streams::enable_I6_escapes(DL); if (p == NULL) LOG("Failed: not a condition"); else { LOG("$D\n", prop); if (tc == FALSE) LOG("Failed: proposition would not type-check\n"); - Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_problem_logging()); + Calculus::Propositions::Checker::type_check(prop, Calculus::Propositions::Checker::tc_problem_logging()); } Streams::disable_I6_escapes(DL); End reporting on the internal test case4.4; @@ -558,7 +558,7 @@ only and may change at any time without notice. diff --git a/docs/core-module/26-iti.html b/docs/core-module/26-iti.html index 784c3ca86..84671fd06 100644 --- a/docs/core-module/26-iti.html +++ b/docs/core-module/26-iti.html @@ -415,7 +415,7 @@ time.) {-index:name}} diff --git a/docs/core-module/26-jl.html b/docs/core-module/26-jl.html index 8fd274c49..a354f2b6f 100644 --- a/docs/core-module/26-jl.html +++ b/docs/core-module/26-jl.html @@ -197,7 +197,7 @@ specification --> 0 } diff --git a/docs/core-module/26-lt.html b/docs/core-module/26-lt.html index bec51a384..08762c5ba 100644 --- a/docs/core-module/26-lt.html +++ b/docs/core-module/26-lt.html @@ -185,7 +185,7 @@ is significant to the run-time list-printing code.
    • This code is used in §3.
    diff --git a/docs/core-module/26-pc.html b/docs/core-module/26-pc.html index caf081321..ff184eb76 100644 --- a/docs/core-module/26-pc.html +++ b/docs/core-module/26-pc.html @@ -316,11 +316,11 @@ matched up with the inference subject already existing. PLUGINS_CALL(PLUGIN_OFFERED_SPECIFICATION, owner, W); } -int Plugins::Call::typecheck_equality(kind *K1, kind *K2) { +int Plugins::Call::typecheck_equality(kind *K1, kind *K2) { PLUGINS_CALL(PLUGIN_TYPECHECK_EQUALITY, K1, K2); } -int Plugins::Call::forbid_setting(kind *K) { +int Plugins::Call::forbid_setting(kind *K) { PLUGINS_CALL(PLUGIN_FORBID_SETTING, K); } @@ -346,7 +346,7 @@ matched up with the inference subject already existing. } diff --git a/docs/core-module/26-pl.html b/docs/core-module/26-pl.html index 999dddbfa..038810912 100644 --- a/docs/core-module/26-pl.html +++ b/docs/core-module/26-pl.html @@ -462,7 +462,7 @@ with the following. } diff --git a/docs/core-module/26-rt.html b/docs/core-module/26-rt.html index 073c611f1..5f3a5f7fe 100644 --- a/docs/core-module/26-rt.html +++ b/docs/core-module/26-rt.html @@ -76,7 +76,7 @@ already been set up, or not. Here's not:

    -packaging_state Routines::begin(inter_name *name) {
    +packaging_state Routines::begin(inter_name *name) {
         return Routines::begin_framed(name, NULL);
     }
     
    @@ -135,7 +135,7 @@ did not.

    -void Routines::end(packaging_state save) {
    +void Routines::end(packaging_state save) {
         kind *R_kind = LocalVariables::deduced_function_kind(currently_compiling_in_frame);
     
         inter_name *kernel_name = NULL, *public_name = currently_compiling_iname;
    @@ -302,7 +302,7 @@ after the call parameters, and is used only as a scratch variable.
     
    • This code is used in §4.
    diff --git a/docs/core-module/26-ts.html b/docs/core-module/26-ts.html index f5490e72f..565c75078 100644 --- a/docs/core-module/26-ts.html +++ b/docs/core-module/26-ts.html @@ -292,7 +292,7 @@ stipulations on place and possessions attached. } diff --git a/docs/core-module/26-uoart.html b/docs/core-module/26-uoart.html index 85f704597..17ad03108 100644 --- a/docs/core-module/26-uoart.html +++ b/docs/core-module/26-uoart.html @@ -208,7 +208,7 @@ source code: see the DM4 for details. } diff --git a/docs/core-module/27-cm.html b/docs/core-module/27-cm.html index 698abcf2d..d8cdafede 100644 --- a/docs/core-module/27-cm.html +++ b/docs/core-module/27-cm.html @@ -213,7 +213,7 @@ Packaging code. } diff --git a/docs/core-module/27-em.html b/docs/core-module/27-em.html index e3dfca324..f0fc4ba68 100644 --- a/docs/core-module/27-em.html +++ b/docs/core-module/27-em.html @@ -79,7 +79,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; } @@ -803,7 +803,7 @@ insert them into the Inter stream close to the top.
    • The structure ival_emission is private to this section.
    diff --git a/docs/core-module/27-hr.html b/docs/core-module/27-hr.html index d9370994d..8f74e40c6 100644 --- a/docs/core-module/27-hr.html +++ b/docs/core-module/27-hr.html @@ -1717,7 +1717,7 @@ function togglePopup(material_id) {

    §4.

    -inter_name *Hierarchy::find(int id) {
    +inter_name *Hierarchy::find(int id) {
         return HierarchyLocations::find(Emit::tree(), id);
     }
     
    @@ -1798,7 +1798,7 @@ function togglePopup(material_id) {
     }
     
    diff --git a/docs/core-module/3-ar.html b/docs/core-module/3-ar.html index d8849be74..02ac8bb51 100644 --- a/docs/core-module/3-ar.html +++ b/docs/core-module/3-ar.html @@ -229,7 +229,7 @@ conclusion we would have reached. } diff --git a/docs/core-module/3-bv.html b/docs/core-module/3-bv.html index 83d0508ed..ddfe1010a 100644 --- a/docs/core-module/3-bv.html +++ b/docs/core-module/3-bv.html @@ -240,7 +240,7 @@ anything. We need to give the build-in "verb-means" meaning to "to mean":
    • This code is used in §1.
    diff --git a/docs/core-module/3-cs.html b/docs/core-module/3-cs.html index d10c5eda1..9c9d2a904 100644 --- a/docs/core-module/3-cs.html +++ b/docs/core-module/3-cs.html @@ -436,7 +436,7 @@ property of something. } diff --git a/docs/core-module/3-ptmn.html b/docs/core-module/3-ptmn.html index 598a28950..c78b498e6 100644 --- a/docs/core-module/3-ptmn.html +++ b/docs/core-module/3-ptmn.html @@ -384,7 +384,7 @@ followed by double-quoted text is a note for the telemetry file. } diff --git a/docs/core-module/4-dbtr.html b/docs/core-module/4-dbtr.html index f13d262ea..50f5a9251 100644 --- a/docs/core-module/4-dbtr.html +++ b/docs/core-module/4-dbtr.html @@ -612,7 +612,7 @@ also ordinary sentences about the property value, and the former won't. diff --git a/docs/core-module/4-dlr.html b/docs/core-module/4-dlr.html index 3959786b0..99ea0fbdc 100644 --- a/docs/core-module/4-dlr.html +++ b/docs/core-module/4-dlr.html @@ -179,7 +179,7 @@ modifiers and a pointer to a Preform nonterminal if one has been named. } diff --git a/docs/core-module/4-nar.html b/docs/core-module/4-nar.html index fdbb493ab..7af50c4c4 100644 --- a/docs/core-module/4-nar.html +++ b/docs/core-module/4-nar.html @@ -120,7 +120,7 @@ matches: } diff --git a/docs/core-module/4-nar2.html b/docs/core-module/4-nar2.html index 343b8c28f..82f27f3a2 100644 --- a/docs/core-module/4-nar2.html +++ b/docs/core-module/4-nar2.html @@ -116,7 +116,7 @@ function togglePopup(material_id) { } diff --git a/docs/core-module/4-nlpr.html b/docs/core-module/4-nlpr.html index 2ee714c71..b3175354a 100644 --- a/docs/core-module/4-nlpr.html +++ b/docs/core-module/4-nlpr.html @@ -464,7 +464,7 @@ by a bracketed list of up to three options in any order. } diff --git a/docs/core-module/4-npr.html b/docs/core-module/4-npr.html index 77d38a8b6..a3b695ae2 100644 --- a/docs/core-module/4-npr.html +++ b/docs/core-module/4-npr.html @@ -652,7 +652,7 @@ there would be horrible ambiguities in parsing. diff --git a/docs/core-module/4-nrr.html b/docs/core-module/4-nrr.html index bf725e16d..2c63abc52 100644 --- a/docs/core-module/4-nrr.html +++ b/docs/core-module/4-nrr.html @@ -127,7 +127,7 @@ of subsequent sentences, which also happens in the pre-pass. "this is too long a name for a single relation to have", "and would become unwieldy."); else Node::set_new_relation_here(V->next, - BinaryPredicates::make_pair_sketchily( + BinaryPredicates::make_pair_sketchily(explicit_bp_family, WordAssemblages::from_wording(RW), Relation_OtoO)); return TRUE; } @@ -450,7 +450,7 @@ at this moment, and have no currency beyond that context. } diff --git a/docs/core-module/4-nuor.html b/docs/core-module/4-nuor.html index 065483bc4..c7960b0e9 100644 --- a/docs/core-module/4-nuor.html +++ b/docs/core-module/4-nuor.html @@ -383,7 +383,7 @@ by hand with a sentence in the source text.
    • This code is used in §10 (twice).
    diff --git a/docs/core-module/4-nvr.html b/docs/core-module/4-nvr.html index a0c270452..05d436a3a 100644 --- a/docs/core-module/4-nvr.html +++ b/docs/core-module/4-nvr.html @@ -677,7 +677,7 @@ in the case of ambiguity, with lower numbers preferred. See
  • This code is used in §5.2.2.
  • diff --git a/docs/core-module/4-pr.html b/docs/core-module/4-pr.html index 917d1d17a..439df1bbc 100644 --- a/docs/core-module/4-pr.html +++ b/docs/core-module/4-pr.html @@ -144,7 +144,7 @@ text anyway, so the following problem messages are not too gratuitous.
    • This code is used in §2.
    diff --git a/docs/core-module/4-rpr.html b/docs/core-module/4-rpr.html index 567dabc04..990eb82f5 100644 --- a/docs/core-module/4-rpr.html +++ b/docs/core-module/4-rpr.html @@ -554,7 +554,7 @@ a given rule appears in, and (within limits) where. A simple example: diff --git a/docs/core-module/4-tr.html b/docs/core-module/4-tr.html index 2fb2b9cb6..c29d712d1 100644 --- a/docs/core-module/4-tr.html +++ b/docs/core-module/4-tr.html @@ -508,7 +508,7 @@ will be required to pass <
    • This code is used in §7.
    diff --git a/docs/core-module/4-tr2.html b/docs/core-module/4-tr2.html index 7822d34d5..166d5e35b 100644 --- a/docs/core-module/4-tr2.html +++ b/docs/core-module/4-tr2.html @@ -240,7 +240,7 @@ more elaborate:
    • This code is used in §3 (three times).
    diff --git a/docs/core-module/4-uor.html b/docs/core-module/4-uor.html index 8454d11e1..7e2c63029 100644 --- a/docs/core-module/4-uor.html +++ b/docs/core-module/4-uor.html @@ -206,7 +206,7 @@ since the compiler next down the chain may no longer be I6.
    • This code is used in §2.2.
    diff --git a/docs/core-module/5-ass.html b/docs/core-module/5-ass.html index f9935c18c..5d28f682c 100644 --- a/docs/core-module/5-ass.html +++ b/docs/core-module/5-ass.html @@ -2549,7 +2549,7 @@ can also be used adjectivally. } diff --git a/docs/core-module/5-ass2.html b/docs/core-module/5-ass2.html index bbc52480e..45e1aeb5d 100644 --- a/docs/core-module/5-ass2.html +++ b/docs/core-module/5-ass2.html @@ -506,7 +506,7 @@ machinery is in infinite regress, e.g., because each \(K\) must contain an
    • This code is used in §13.
    diff --git a/docs/core-module/5-imp.html b/docs/core-module/5-imp.html index 961dfab74..6373bba69 100644 --- a/docs/core-module/5-imp.html +++ b/docs/core-module/5-imp.html @@ -395,7 +395,7 @@ no better a certainty level.
    • This code is used in §6.1.
    diff --git a/docs/core-module/5-npa.html b/docs/core-module/5-npa.html index 8d1493d8f..b6a087cf5 100644 --- a/docs/core-module/5-npa.html +++ b/docs/core-module/5-npa.html @@ -289,7 +289,7 @@ several property names, e.g., in
    • This code is used in §2.1.
    diff --git a/docs/core-module/5-pk.html b/docs/core-module/5-pk.html index f73530727..f9727a571 100644 --- a/docs/core-module/5-pk.html +++ b/docs/core-module/5-pk.html @@ -401,7 +401,7 @@ the proposition machinery.
    • This code is used in §4.
    diff --git a/docs/core-module/5-rk.html b/docs/core-module/5-rk.html index 7ab0b999a..7951b3e70 100644 --- a/docs/core-module/5-rk.html +++ b/docs/core-module/5-rk.html @@ -301,7 +301,7 @@ that subtrees \(T_X\) and \(T_Y\), where \(T_X\) is a single value or object and
    • This code is used in §3.
    diff --git a/docs/core-module/5-rpt.html b/docs/core-module/5-rpt.html index 8e6b923ed..579fd4eb9 100644 --- a/docs/core-module/5-rpt.html +++ b/docs/core-module/5-rpt.html @@ -1012,7 +1012,7 @@ issue for sentences like: } diff --git a/docs/core-module/5-tc.html b/docs/core-module/5-tc.html index 65b036956..a6eb33ccd 100644 --- a/docs/core-module/5-tc.html +++ b/docs/core-module/5-tc.html @@ -1431,7 +1431,7 @@ proposition claiming its existence, then assert it to be true. } diff --git a/docs/core-module/6-ins.html b/docs/core-module/6-ins.html index ace017cb3..8a1a8f3ba 100644 --- a/docs/core-module/6-ins.html +++ b/docs/core-module/6-ins.html @@ -1010,18 +1010,18 @@ scene), once with set<

    -    i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE);
    -    Calculus::Schemas::modify(sch,
    +    i6_schema *sch = Adjectives::Meanings::set_i6_schema(am, TEST_ADJECTIVE_TASK, FALSE);
    +    Calculus::Schemas::modify(sch,
             "GProperty(%k, *1, %n) == %d",
                 D, Properties::iname(P), I->enumeration_index);
         sch = Adjectives::Meanings::set_i6_schema(am, NOW_ADJECTIVE_TRUE_TASK, FALSE);
    -    Calculus::Schemas::modify(sch,
    +    Calculus::Schemas::modify(sch,
             "WriteGProperty(%k, *1, %n, %d)",
                 D, Properties::iname(P), I->enumeration_index);
     
    • This code is used in §37.
    diff --git a/docs/core-module/6-ipw.html b/docs/core-module/6-ipw.html index 5597107cb..bd912d292 100644 --- a/docs/core-module/6-ipw.html +++ b/docs/core-module/6-ipw.html @@ -500,7 +500,7 @@ table of Kinds. } diff --git a/docs/core-module/6-lp.html b/docs/core-module/6-lp.html index 87dc6f636..db40b6311 100644 --- a/docs/core-module/6-lp.html +++ b/docs/core-module/6-lp.html @@ -3278,7 +3278,7 @@ attached to the same kind, and they become alternative syntaxes.) } diff --git a/docs/core-module/6-nv.html b/docs/core-module/6-nv.html index 38607914c..77c7a5a06 100644 --- a/docs/core-module/6-nv.html +++ b/docs/core-module/6-nv.html @@ -454,7 +454,7 @@ I6 schema for how to change a variable: nlv->nlv_write_schema = sch; } -char *NonlocalVariables::get_write_schema(nonlocal_variable *nlv) { +char *NonlocalVariables::get_write_schema(nonlocal_variable *nlv) { NonlocalVariables::warn_about_change(nlv); if (nlv == NULL) return NULL; return nlv->nlv_write_schema; @@ -508,7 +508,7 @@ there's very little to say. void NonlocalVariables::SUBJ_compile(inference_subject *infs) { } -inference_subject *NonlocalVariables::get_knowledge(nonlocal_variable *nlv) { +inference_subject *NonlocalVariables::get_knowledge(nonlocal_variable *nlv) { return nlv->nlv_knowledge; } @@ -742,12 +742,12 @@ means that a value can be set by an assertion in the source text. nlv->var_is_initialisable_anyway = TRUE; } -int NonlocalVariables::is_constant(nonlocal_variable *nlv) { +int NonlocalVariables::is_constant(nonlocal_variable *nlv) { if (nlv == NULL) internal_error("no such var"); return nlv->constant_at_run_time; } -int NonlocalVariables::must_be_constant(nonlocal_variable *nlv) { +int NonlocalVariables::must_be_constant(nonlocal_variable *nlv) { if (nlv->constant_at_run_time) { StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_CantChangeConstants), "this is a name for a value which never changes during the story", @@ -998,7 +998,7 @@ the following: } diff --git a/docs/core-module/6-tod.html b/docs/core-module/6-tod.html index d6f3df26a..421d414e2 100644 --- a/docs/core-module/6-tod.html +++ b/docs/core-module/6-tod.html @@ -273,7 +273,7 @@ a specific time of day, or when a named event occurs.
    • This code is used in §8.
    diff --git a/docs/core-module/6-uem.html b/docs/core-module/6-uem.html index 00bd2fb10..e7a213e0c 100644 --- a/docs/core-module/6-uem.html +++ b/docs/core-module/6-uem.html @@ -193,7 +193,7 @@ following. (The six highest bits are defined in the } diff --git a/docs/core-module/6-ul.html b/docs/core-module/6-ul.html index da9d6adf0..5f6a212e4 100644 --- a/docs/core-module/6-ul.html +++ b/docs/core-module/6-ul.html @@ -116,7 +116,7 @@ the player types either of these: } diff --git a/docs/core-module/6-un.html b/docs/core-module/6-un.html index 1d107b9a4..7174b217f 100644 --- a/docs/core-module/6-un.html +++ b/docs/core-module/6-un.html @@ -154,7 +154,7 @@ instance, the Standard Rules want the player-character object to be called } diff --git a/docs/core-module/7-am.html b/docs/core-module/7-am.html index 4080e58da..6dbccddbb 100644 --- a/docs/core-module/7-am.html +++ b/docs/core-module/7-am.html @@ -167,8 +167,8 @@ rather than TRUE int adjective_form; one of the *_KADJ constants: see below general_pointer detailed_meaning; to the relevant structure int task_via_support_routine[NO_ADJECTIVE_TASKS + 1]; - struct i6_schema i6s_to_transfer_to_SR[NO_ADJECTIVE_TASKS + 1]; where TRUE - struct i6_schema i6s_for_runtime_task[NO_ADJECTIVE_TASKS + 1]; where TRUE + struct i6_schema i6s_to_transfer_to_SR[NO_ADJECTIVE_TASKS + 1]; where TRUE + struct i6_schema i6s_for_runtime_task[NO_ADJECTIVE_TASKS + 1]; where TRUE int am_ready_flag; optional flag to mark whether schemas prepared yet int defined_already; temporary workspace used when compiling support routines @@ -386,7 +386,7 @@ early in the run when sorting cannot yet be done.

    -int Adjectives::Meanings::applicable_to(adjective *aph,
    +int Adjectives::Meanings::applicable_to(adjective *aph,
         kind *K) {
         if (aph) {
             adjective_meaning *am;
    @@ -593,8 +593,8 @@ below) — this makes coding what the adjective compiles to much easier.
         am->am_ready_flag = FALSE;
         for (int i=1; i<=NO_ADJECTIVE_TASKS; i++) {
             am->task_via_support_routine[i] = NOT_APPLICABLE;
    -        Calculus::Schemas::modify(&(am->i6s_for_runtime_task[i]), "");
    -        Calculus::Schemas::modify(&(am->i6s_to_transfer_to_SR[i]), "");
    +        Calculus::Schemas::modify(&(am->i6s_for_runtime_task[i]), "");
    +        Calculus::Schemas::modify(&(am->i6s_to_transfer_to_SR[i]), "");
         }
         am->am_negated_from = NULL;
         return am;
    @@ -631,7 +631,7 @@ those are inherited.
             if (i == NOW_ADJECTIVE_FALSE_TASK) j = NOW_ADJECTIVE_TRUE_TASK;
             neg->task_via_support_routine[j] = am->task_via_support_routine[i];
             neg->i6s_for_runtime_task[j] = am->i6s_for_runtime_task[i];
    -        Calculus::Schemas::modify(&(neg->i6s_to_transfer_to_SR[j]), "");
    +        Calculus::Schemas::modify(&(neg->i6s_to_transfer_to_SR[j]), "");
         }
         neg->am_negated_from = am;
         return neg;
    @@ -1036,7 +1036,7 @@ can choose to go via a support routine or not.
     

    -i6_schema *Adjectives::Meanings::set_i6_schema(adjective_meaning *am,
    +i6_schema *Adjectives::Meanings::set_i6_schema(adjective_meaning *am,
         int T, int via_support) {
         kind *K = Adjectives::Meanings::get_domain(am);
         if (K == NULL) K = K_object;
    @@ -1058,7 +1058,7 @@ that to issue a suitable problem message.
     

    -i6_schema *Adjectives::Meanings::get_i6_schema(adjective *aph,
    +i6_schema *Adjectives::Meanings::get_i6_schema(adjective *aph,
         kind *kind_domain, int T) {
         adjective_meaning *am;
         if (kind_domain == NULL) kind_domain = K_object;
    @@ -1071,7 +1071,7 @@ that to issue a suitable problem message.
             switch (am->task_via_support_routine[T]) {
                 case FALSE: return &(am->i6s_for_runtime_task[T]);
                 case TRUE:
    -                if (Calculus::Schemas::empty(&(am->i6s_to_transfer_to_SR[T])))
    +                if (Calculus::Schemas::empty(&(am->i6s_to_transfer_to_SR[T])))
                         Construct a schema for this adjective, using the standard routine naming30.1;
                     return &(am->i6s_to_transfer_to_SR[T]);
             }
    @@ -1099,7 +1099,7 @@ negation does not, and so must use those of the original.
             }
         }
         inter_name *iname = Adjectives::Meanings::iname(use_aph, task, Kinds::RunTime::weak_id(am_kind));
    -    Calculus::Schemas::modify(&(am->i6s_to_transfer_to_SR[T]), "*=-(%s%n(*1))",
    +    Calculus::Schemas::modify(&(am->i6s_to_transfer_to_SR[T]), "*=-(%s%n(*1))",
             negation_operator, iname);
     
    • This code is used in §30.
    @@ -1113,7 +1113,7 @@ objects, if there is one; otherwise the first-declared meaning.
     int Adjectives::Meanings::write_adjective_test_routine(value_holster *VH,
         adjective *aph) {
    -    i6_schema *sch;
    +    i6_schema *sch;
         int weak_id = Kinds::RunTime::weak_id(K_object);
         sch = Adjectives::Meanings::get_i6_schema(aph, NULL,
             TEST_ADJECTIVE_TASK);
    @@ -1454,12 +1454,12 @@ into *1.
     

    -    if (Calculus::Schemas::empty(&(am->i6s_for_runtime_task[T])) == FALSE) {
    +    if (Calculus::Schemas::empty(&(am->i6s_for_runtime_task[T])) == FALSE) {
             if (emit_flag) {
                 parse_node *it_var = Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING,
                     LocalVariables::it_variable());
                 pcalc_term it_term = Calculus::Terms::new_constant(it_var);
    -            Calculus::Schemas::emit_expand_from_terms(&(am->i6s_for_runtime_task[T]), &it_term, NULL, FALSE);
    +            Calculus::Schemas::emit_expand_from_terms(&(am->i6s_for_runtime_task[T]), &it_term, NULL, FALSE);
             }
             return TRUE;
         }
    @@ -1720,7 +1720,7 @@ prefaced "(of a rulebook)", "(of an activity)", and so on.
     }
     
    diff --git a/docs/core-module/7-er.html b/docs/core-module/7-er.html index 3e4cedd72..927b093a0 100644 --- a/docs/core-module/7-er.html +++ b/docs/core-module/7-er.html @@ -13,6 +13,14 @@ + + + - - - @@ -83,36 +83,51 @@ function togglePopup(material_id) {
    -

    §1. Managing the BPs generated. The relations created in this section belong to the family, -named so because their definitions are explicit in the source text. Initially, +

    §1. Managing the BPs generated. The relations created in this section belong to the "explicit" family, +named so because their definitions are explicit in the source text. Initially, there are none.

    -

    §2. They typecheck by the default rule only: +

    +bp_family *explicit_bp_family = NULL;
    +
    +

    §2.

    + +
    +void Relations::Explicit::start(void) {
    +    explicit_bp_family = BinaryPredicateFamilies::new();
    +    METHOD_ADD(explicit_bp_family, TYPECHECK_BPF_MTID, Relations::Explicit::REL_typecheck);
    +    METHOD_ADD(explicit_bp_family, ASSERT_BPF_MTID, Relations::Explicit::REL_assert);
    +    METHOD_ADD(explicit_bp_family, SCHEMA_BPF_MTID, Relations::Explicit::REL_compile);
    +    METHOD_ADD(explicit_bp_family, DESCRIBE_FOR_PROBLEMS_BPF_MTID, Relations::Explicit::REL_describe_for_problems);
    +    METHOD_ADD(explicit_bp_family, DESCRIBE_FOR_INDEX_BPF_MTID, Relations::Explicit::REL_describe_briefly);
    +}
    +
    +

    §3. They typecheck by the default rule only:

    -int Relations::Explicit::REL_typecheck(bp_family *self, binary_predicate *bp,
    -        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
    +int Relations::Explicit::REL_typecheck(bp_family *self, binary_predicate *bp,
    +        kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
         return DECLINE_TO_MATCH;
     }
     
    -

    §3. They are asserted thus. Note that if we have a symmetric relation then we need +

    §4. They are asserted thus. Note that if we have a symmetric relation then we need to behave as if \(B(y, x)\) had also been asserted whenever \(B(x, y)\) has, if \(x\neq y\).

    -int Relations::Explicit::REL_assert(bp_family *self, binary_predicate *bp,
    +int Relations::Explicit::REL_assert(bp_family *self, binary_predicate *bp,
             inference_subject *infs0, parse_node *spec0,
             inference_subject *infs1, parse_node *spec1) {
     
    -    Reject non-assertable relations3.1;
    +    Reject non-assertable relations4.1;
         if (BinaryPredicates::store_dynamically(bp)) {
             World::Inferences::draw_relation_spec(bp, spec0, spec1);
             return TRUE;
         } else {
    -        if ((infs0 == NULL) || (infs1 == NULL)) Reject relationship with nothing3.2;
    +        if ((infs0 == NULL) || (infs1 == NULL)) Reject relationship with nothing4.2;
             if (BinaryPredicates::allow_arbitrary_assertions(bp)) {
                 World::Inferences::draw_relation(bp, infs0, infs1);
                 if ((BinaryPredicates::get_form_of_relation(bp) == Relation_Sym_VtoV) && (infs0 != infs1))
    @@ -120,19 +135,19 @@ to behave as if \(B(y, x)\) had also been asserted whenever \(B(x, y)\) has, if
                 return TRUE;
             }
             if (BinaryPredicates::is_explicit_with_runtime_storage(bp)) {
    -            Relations::Explicit::infer_property_based_relation(bp, infs1, infs0);
    +            Relations::Explicit::infer_property_based_relation(bp, infs1, infs0);
                 if ((BinaryPredicates::get_form_of_relation(bp) == Relation_Sym_OtoO) && (infs0 != infs1))
    -                Relations::Explicit::infer_property_based_relation(bp, infs0, infs1);
    +                Relations::Explicit::infer_property_based_relation(bp, infs0, infs1);
                 return TRUE;
             }
         }
         return FALSE;
     }
     
    -

    §3.1. This is the point at which non-assertable relations are thrown out. +

    §4.1. This is the point at which non-assertable relations are thrown out.

    -

    Reject non-assertable relations3.1 = +

    Reject non-assertable relations4.1 =

    @@ -146,8 +161,8 @@ to behave as if \(B(y, x)\) had also been asserted whenever \(B(x, y)\) has, if
             return TRUE;
         }
     
    -
    • This code is used in §3.
    -

    §3.2. Reject relationship with nothing3.2 = +

    • This code is used in §4.
    +

    §4.2. Reject relationship with nothing4.2 =

    @@ -159,8 +174,8 @@ to behave as if \(B(y, x)\) had also been asserted whenever \(B(x, y)\) has, if
             "to try to put 'Mr Cogito' and 'nothing' into a relationship.");
         return TRUE;
     
    -
    • This code is used in §3.
    -

    §4. This routine converts the knowledge that \(R(ox, oy)\) into a single +

    • This code is used in §4.
    +

    §5. This routine converts the knowledge that \(R(ox, oy)\) into a single inference. It can only be used for a simple subclass of the relations: those which store oy, the only thing related to ox, in a given property of ox. The beauty of this is that the "only thing related to" business @@ -170,7 +185,7 @@ inferences for \(y\) and \(z\).

    -void Relations::Explicit::infer_property_based_relation(binary_predicate *relation,
    +void Relations::Explicit::infer_property_based_relation(binary_predicate *relation,
         inference_subject *infs0, inference_subject *infs1) {
         if (BinaryPredicates::get_form_of_relation(relation) == Relation_VtoO) {
             inference_subject *swap=infs0; infs0=infs1; infs1=swap;
    @@ -179,22 +194,22 @@ inferences for \(y\) and \(z\).
         World::Inferences::draw_property(infs0, prn, InferenceSubjects::as_constant(infs1));
     }
     
    -

    §5. We need do nothing special: these relations can be compiled from their schemas. +

    §6. We need do nothing special: these relations can be compiled from their schemas.

    -int Relations::Explicit::REL_compile(bp_family *self, int task, binary_predicate *bp, annotated_i6_schema *asch) {
    +int Relations::Explicit::REL_compile(bp_family *self, int task, binary_predicate *bp, annotated_i6_schema *asch) {
         return FALSE;
     }
     
    -

    §6. Problem message text: +

    §7. Problem message text:

    -int Relations::Explicit::REL_describe_for_problems(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
    +int Relations::Explicit::REL_describe_for_problems(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
         return FALSE;
     }
    -void Relations::Explicit::REL_describe_briefly(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
    +void Relations::Explicit::REL_describe_briefly(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
         switch (bp->form_of_relation) {
             case Relation_OtoO: WRITE("one-to-one"); break;
             case Relation_OtoV: WRITE("one-to-various"); break;
    @@ -208,7 +223,7 @@ inferences for \(y\) and \(z\).
     }
     
    diff --git a/docs/core-module/7-rlt.html b/docs/core-module/7-rlt.html index 61fb1c7a7..d5ab6ea43 100644 --- a/docs/core-module/7-rlt.html +++ b/docs/core-module/7-rlt.html @@ -82,7 +82,7 @@ MathJax = {

    What Inform internally calls "binary predicates", the user calls "relations". In this section, we parse definitions of new relations and create the resulting |binary_predicate| objects.

    -
    +

    §1. The following provides for run-time checking to make sure relations are not used with the wrong kinds of object. (Compile-time checking excludes @@ -94,11 +94,11 @@ other cases.) struct binary_predicate *guarding; which one is being defended struct kind *check_L; or null if no check needed struct kind *check_R; or null if no check needed - struct i6_schema *inner_test; schemas for the relation if check passes - struct i6_schema *inner_make_true; - struct i6_schema *inner_make_false; - struct i6_schema *f0; schemas for the relation's function - struct i6_schema *f1; + struct i6_schema *inner_test; schemas for the relation if check passes + struct i6_schema *inner_make_true; + struct i6_schema *inner_make_false; + struct i6_schema *f0; schemas for the relation's function + struct i6_schema *f1; struct inter_name *guard_f0_iname; struct inter_name *guard_f1_iname; struct inter_name *guard_test_iname; @@ -254,28 +254,28 @@ splitting into cases. package_request *R = BinaryPredicates::package(bp); rg->guard_f0_iname = Hierarchy::make_iname_in(GUARD_F0_FN_HL, R); BinaryPredicates::set_term_function(&(bp->term_details[0]), - Calculus::Schemas::new("(%n(*1))", rg->guard_f0_iname)); + Calculus::Schemas::new("(%n(*1))", rg->guard_f0_iname)); } if (rg->f1) { package_request *R = BinaryPredicates::package(bp); rg->guard_f1_iname = Hierarchy::make_iname_in(GUARD_F1_FN_HL, R); BinaryPredicates::set_term_function(&(bp->term_details[1]), - Calculus::Schemas::new("(%n(*1))", rg->guard_f1_iname)); + Calculus::Schemas::new("(%n(*1))", rg->guard_f1_iname)); } if (bp->test_function) { package_request *R = BinaryPredicates::package(bp); rg->guard_test_iname = Hierarchy::make_iname_in(GUARD_TEST_FN_HL, R); - bp->test_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_test_iname); + bp->test_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_test_iname); } if (bp->make_true_function) { package_request *R = BinaryPredicates::package(bp); rg->guard_make_true_iname = Hierarchy::make_iname_in(GUARD_MAKE_TRUE_FN_HL, R); - bp->make_true_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_make_true_iname); + bp->make_true_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_make_true_iname); } if (bp->make_false_function) { package_request *R = BinaryPredicates::package(bp); rg->guard_make_false_iname = Hierarchy::make_iname_in(GUARD_MAKE_FALSE_INAME_HL, R); - bp->make_false_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_make_false_iname); + bp->make_false_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_make_false_iname); } } @@ -432,12 +432,12 @@ and \(14D\) bytes on Glulx, where \(D\) is the size of the domain... bp->form_of_relation = Relation_OtoO; provide_prn = TRUE; if (Kinds::Behaviour::is_object(storage_kind)) { - bp->make_true_function = Calculus::Schemas::new("Relation_Now1to1(*2,%n,*1)", i6_prn_name); - bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toV(*2,%n,*1)", i6_prn_name); + bp->make_true_function = Calculus::Schemas::new("Relation_Now1to1(*2,%n,*1)", i6_prn_name); + bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toV(*2,%n,*1)", i6_prn_name); } else { - bp->make_true_function = Calculus::Schemas::new("Relation_Now1to1V(*2,*1,%k,%n)", + bp->make_true_function = Calculus::Schemas::new("Relation_Now1to1V(*2,*1,%k,%n)", storage_kind, i6_prn_name); - bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toVV(*2,*1,%k,%n)", + bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toVV(*2,*1,%k,%n)", storage_kind, i6_prn_name); }

    @@ -452,12 +452,12 @@ and \(14D\) bytes on Glulx, where \(D\) is the size of the domain... bp->form_of_relation = Relation_OtoV; provide_prn = TRUE; if (Kinds::Behaviour::is_object(storage_kind)) { - bp->make_true_function = Calculus::Schemas::new("*2.%n = *1", i6_prn_name); - bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toV(*2,%n,*1)", i6_prn_name); + bp->make_true_function = Calculus::Schemas::new("*2.%n = *1", i6_prn_name); + bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toV(*2,%n,*1)", i6_prn_name); } else { - bp->make_true_function = Calculus::Schemas::new("WriteGProperty(%k, *2, %n, *1)", + bp->make_true_function = Calculus::Schemas::new("WriteGProperty(%k, *2, %n, *1)", storage_kind, i6_prn_name); - bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toVV(*2,*1,%k,%n)", + bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toVV(*2,*1,%k,%n)", storage_kind, i6_prn_name); }
    @@ -472,12 +472,12 @@ and \(14D\) bytes on Glulx, where \(D\) is the size of the domain... bp->form_of_relation = Relation_VtoO; provide_prn = TRUE; if (Kinds::Behaviour::is_object(storage_kind)) { - bp->make_true_function = Calculus::Schemas::new("*1.%n = *2", i6_prn_name); - bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toV(*1,%n,*2)", i6_prn_name); + bp->make_true_function = Calculus::Schemas::new("*1.%n = *2", i6_prn_name); + bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toV(*1,%n,*2)", i6_prn_name); } else { - bp->make_true_function = Calculus::Schemas::new("WriteGProperty(%k, *1, %n, *2)", + bp->make_true_function = Calculus::Schemas::new("WriteGProperty(%k, *1, %n, *2)", storage_kind, i6_prn_name); - bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toVV(*1,*2,%k,%n)", + bp->make_false_function = Calculus::Schemas::new("Relation_NowN1toVV(*1,*2,%k,%n)", storage_kind, i6_prn_name); }
    @@ -493,11 +493,11 @@ various K". bp->form_of_relation = Relation_VtoV; bp->arbitrary = TRUE; BinaryPredicates::mark_as_needed(bp); - bp->test_function = Calculus::Schemas::new("(Relation_TestVtoV(*1,%n,*2,false))", + bp->test_function = Calculus::Schemas::new("(Relation_TestVtoV(*1,%n,*2,false))", BinaryPredicates::iname(bp)); - bp->make_true_function = Calculus::Schemas::new("(Relation_NowVtoV(*1,%n,*2,false))", + bp->make_true_function = Calculus::Schemas::new("(Relation_NowVtoV(*1,%n,*2,false))", BinaryPredicates::iname(bp)); - bp->make_false_function = Calculus::Schemas::new("(Relation_NowNVtoV(*1,%n,*2,false))", + bp->make_false_function = Calculus::Schemas::new("(Relation_NowNVtoV(*1,%n,*2,false))", BinaryPredicates::iname(bp));
    • This code is used in §4.
    @@ -512,12 +512,12 @@ another". bp->form_of_relation = Relation_Sym_OtoO; provide_prn = TRUE; if (Kinds::Behaviour::is_object(storage_kind)) { - bp->make_true_function = Calculus::Schemas::new("Relation_NowS1to1(*2,%n,*1)", i6_prn_name); - bp->make_false_function = Calculus::Schemas::new("Relation_NowSN1to1(*2,%n,*1)", i6_prn_name); + bp->make_true_function = Calculus::Schemas::new("Relation_NowS1to1(*2,%n,*1)", i6_prn_name); + bp->make_false_function = Calculus::Schemas::new("Relation_NowSN1to1(*2,%n,*1)", i6_prn_name); } else { - bp->make_true_function = Calculus::Schemas::new("Relation_NowS1to1V(*2,*1,%k,%n)", + bp->make_true_function = Calculus::Schemas::new("Relation_NowS1to1V(*2,*1,%k,%n)", storage_kind, i6_prn_name); - bp->make_false_function = Calculus::Schemas::new("Relation_NowSN1to1V(*2,*1,%k,%n)", + bp->make_false_function = Calculus::Schemas::new("Relation_NowSN1to1V(*2,*1,%k,%n)", storage_kind, i6_prn_name); } @@ -533,11 +533,11 @@ to each other". bp->form_of_relation = Relation_Sym_VtoV; bp->arbitrary = TRUE; BinaryPredicates::mark_as_needed(bp); - bp->test_function = Calculus::Schemas::new("(Relation_TestVtoV(*1,%n,*2,true))", + bp->test_function = Calculus::Schemas::new("(Relation_TestVtoV(*1,%n,*2,true))", BinaryPredicates::iname(bp)); - bp->make_true_function = Calculus::Schemas::new("(Relation_NowVtoV(*1,%n,*2,true))", + bp->make_true_function = Calculus::Schemas::new("(Relation_NowVtoV(*1,%n,*2,true))", BinaryPredicates::iname(bp)); - bp->make_false_function = Calculus::Schemas::new("(Relation_NowNVtoV(*1,%n,*2,true))", + bp->make_false_function = Calculus::Schemas::new("(Relation_NowNVtoV(*1,%n,*2,true))", BinaryPredicates::iname(bp));
    • This code is used in §4.
    @@ -553,17 +553,17 @@ other in groups". bp->arbitrary = TRUE; provide_prn = TRUE; if (Kinds::Behaviour::is_object(storage_kind)) { - bp->test_function = Calculus::Schemas::new("(*1.%n == *2.%n)", i6_prn_name, i6_prn_name); - bp->make_true_function = Calculus::Schemas::new("Relation_NowEquiv(*1,%n,*2)", i6_prn_name); - bp->make_false_function = Calculus::Schemas::new("Relation_NowNEquiv(*1,%n,*2)", i6_prn_name); + bp->test_function = Calculus::Schemas::new("(*1.%n == *2.%n)", i6_prn_name, i6_prn_name); + bp->make_true_function = Calculus::Schemas::new("Relation_NowEquiv(*1,%n,*2)", i6_prn_name); + bp->make_false_function = Calculus::Schemas::new("Relation_NowNEquiv(*1,%n,*2)", i6_prn_name); } else { bp->test_function = - Calculus::Schemas::new("(GProperty(%k, *1, %n) == GProperty(%k, *2, %n))", + Calculus::Schemas::new("(GProperty(%k, *1, %n) == GProperty(%k, *2, %n))", storage_kind, i6_prn_name, storage_kind, i6_prn_name); bp->make_true_function = - Calculus::Schemas::new("Relation_NowEquivV(*1,*2,%k,%n)", storage_kind, i6_prn_name); + Calculus::Schemas::new("Relation_NowEquivV(*1,*2,%k,%n)", storage_kind, i6_prn_name); bp->make_false_function = - Calculus::Schemas::new("Relation_NowNEquivV(*1,*2,%k,%n)", storage_kind, i6_prn_name); + Calculus::Schemas::new("Relation_NowNEquivV(*1,*2,%k,%n)", storage_kind, i6_prn_name); } Properties::Valued::set_kind(prn, K_number); @@ -579,7 +579,7 @@ K to L when (some condition)". bp->form_of_relation = Relation_ByRoutine; package_request *P = BinaryPredicates::package(bp); bp->bp_by_routine_iname = Hierarchy::make_iname_in(RELATION_FN_HL, P); - bp->test_function = Calculus::Schemas::new("(%n(*1,*2))", bp->bp_by_routine_iname); + bp->test_function = Calculus::Schemas::new("(%n(*1,*2))", bp->bp_by_routine_iname); bp->condition_defn_text = RR->CONW;
    • This code is used in §4.
    @@ -604,21 +604,21 @@ have the form \(B(x, f_1(x))\).
         if (i6_prn_name) {
    -        i6_schema *f0 = NULL, *f1 = NULL;
    +        i6_schema *f0 = NULL, *f1 = NULL;
             if (RR->terms[0].unique) {
                 if (RR->terms[1].domain) {
                     if (Kinds::Behaviour::is_object(RR->terms[1].domain))
    -                    f0 = Calculus::Schemas::new("(*1.%n)", i6_prn_name);
    +                    f0 = Calculus::Schemas::new("(*1.%n)", i6_prn_name);
                     else
    -                    f0 = Calculus::Schemas::new("(GProperty(%k, *1, %n))",
    +                    f0 = Calculus::Schemas::new("(GProperty(%k, *1, %n))",
                             RR->terms[1].domain, i6_prn_name);
                 }
             } else if (RR->terms[1].unique) {
                 if (RR->terms[0].domain) {
                     if (Kinds::Behaviour::is_object(RR->terms[0].domain))
    -                    f1 = Calculus::Schemas::new("(*1.%n)", i6_prn_name);
    +                    f1 = Calculus::Schemas::new("(*1.%n)", i6_prn_name);
                     else
    -                    f1 = Calculus::Schemas::new("(GProperty(%k, *1, %n))",
    +                    f1 = Calculus::Schemas::new("(GProperty(%k, *1, %n))",
                             RR->terms[0].domain, i6_prn_name);
                 }
             }
    @@ -631,11 +631,11 @@ have the form \(B(x, f_1(x))\).
     

    -    bp->test_function = Calculus::Schemas::new("(RelationTest(%n,RELS_TEST,*1,*2))",
    +    bp->test_function = Calculus::Schemas::new("(RelationTest(%n,RELS_TEST,*1,*2))",
             BinaryPredicates::iname(bp));
    -    bp->make_true_function = Calculus::Schemas::new("(RelationTest(%n,RELS_ASSERT_TRUE,*1,*2))",
    +    bp->make_true_function = Calculus::Schemas::new("(RelationTest(%n,RELS_ASSERT_TRUE,*1,*2))",
             BinaryPredicates::iname(bp));
    -    bp->make_false_function = Calculus::Schemas::new("(RelationTest(%n,RELS_ASSERT_FALSE,*1,*2))",
    +    bp->make_false_function = Calculus::Schemas::new("(RelationTest(%n,RELS_ASSERT_FALSE,*1,*2))",
             BinaryPredicates::iname(bp));
     
    • This code is used in §4.
    @@ -992,7 +992,7 @@ combinations. inter_symbol *Z3_s = LocalVariables::add_internal_local_c_as_symbol_noting(I"Z3", "loop counter", &Z3_lv); LocalVariables::add_internal_local_c_as_symbol_noting(I"Z4", "loop counter", &Z4_lv); - annotated_i6_schema asch; i6_schema *i6s = NULL; + annotated_i6_schema asch; i6_schema *i6s = NULL; Produce::inv_primitive(Emit::tree(), SWITCH_BIP); Produce::down(Emit::tree()); @@ -1164,11 +1164,11 @@ combinations.

    -    asch = Calculus::Atoms::Compile::blank_asch();
    -    i6s = BinaryPredicateFamilies::get_schema(NOW_ATOM_TRUE_TASK, dbp, &asch);
    +    asch = Calculus::Atoms::Compile::blank_asch();
    +    i6s = BinaryPredicateFamilies::get_schema(NOW_ATOM_TRUE_TASK, dbp, &asch);
         if (i6s == NULL) Produce::rfalse(Emit::tree());
         else {
    -        Calculus::Schemas::emit_expand_from_locals(i6s, X_lv, Y_lv, TRUE);
    +        Calculus::Schemas::emit_expand_from_locals(i6s, X_lv, Y_lv, TRUE);
             Produce::rtrue(Emit::tree());
         }
     
    @@ -1177,11 +1177,11 @@ combinations.

    -    asch = Calculus::Atoms::Compile::blank_asch();
    -    i6s = BinaryPredicateFamilies::get_schema(NOW_ATOM_FALSE_TASK, dbp, &asch);
    +    asch = Calculus::Atoms::Compile::blank_asch();
    +    i6s = BinaryPredicateFamilies::get_schema(NOW_ATOM_FALSE_TASK, dbp, &asch);
         if (i6s == NULL) Produce::rfalse(Emit::tree());
         else {
    -        Calculus::Schemas::emit_expand_from_locals(i6s, X_lv, Y_lv, TRUE);
    +        Calculus::Schemas::emit_expand_from_locals(i6s, X_lv, Y_lv, TRUE);
             Produce::rtrue(Emit::tree());
         }
     
    @@ -1192,24 +1192,24 @@ combinations.
         Produce::inv_primitive(Emit::tree(), IF_BIP);
         Produce::down(Emit::tree());
    -        asch = Calculus::Atoms::Compile::blank_asch();
    -        i6s = BinaryPredicateFamilies::get_schema(TEST_ATOM_TASK, dbp, &asch);
    +        asch = Calculus::Atoms::Compile::blank_asch();
    +        i6s = BinaryPredicateFamilies::get_schema(TEST_ATOM_TASK, dbp, &asch);
             int adapted = FALSE;
             for (int j=0; j<2; j++) {
    -            i6_schema *fnsc = BinaryPredicates::get_term_as_function_of_other(bp, j);
    +            i6_schema *fnsc = BinaryPredicates::get_term_as_function_of_other(bp, j);
                 if (fnsc) {
                     if (j == 0) {
                         Produce::inv_primitive(Emit::tree(), EQ_BIP);
                         Produce::down(Emit::tree());
                             Produce::val_symbol(Emit::tree(), K_value, X_s);
    -                        Calculus::Schemas::emit_val_expand_from_locals(fnsc, Y_lv, Y_lv);
    +                        Calculus::Schemas::emit_val_expand_from_locals(fnsc, Y_lv, Y_lv);
                         Produce::up(Emit::tree());
                         adapted = TRUE;
                     } else {
                         Produce::inv_primitive(Emit::tree(), EQ_BIP);
                         Produce::down(Emit::tree());
                             Produce::val_symbol(Emit::tree(), K_value, Y_s);
    -                        Calculus::Schemas::emit_val_expand_from_locals(fnsc, X_lv, X_lv);
    +                        Calculus::Schemas::emit_val_expand_from_locals(fnsc, X_lv, X_lv);
                         Produce::up(Emit::tree());
                         adapted = TRUE;
                     }
    @@ -1217,7 +1217,7 @@ combinations.
             }
             if (adapted == FALSE) {
                 if (i6s == NULL) Produce::val(Emit::tree(), K_truth_state, LITERAL_IVAL, 0);
    -            else Calculus::Schemas::emit_val_expand_from_locals(i6s, X_lv, Y_lv);
    +            else Calculus::Schemas::emit_val_expand_from_locals(i6s, X_lv, Y_lv);
             }
             Produce::code(Emit::tree());
             Produce::down(Emit::tree());
    @@ -1448,9 +1448,9 @@ combinations.
         if ((dbp == R_containment) && (K == NULL)) K = K_object;
         #endif
         if (Calculus::Deferrals::has_finite_domain(K)) {
    -        i6_schema loop_schema;
    +        i6_schema loop_schema;
             if (Calculus::Deferrals::write_loop_schema(&loop_schema, K)) {
    -            Calculus::Schemas::emit_expand_from_locals(&loop_schema, Z1_lv, Z2_lv, TRUE);
    +            Calculus::Schemas::emit_expand_from_locals(&loop_schema, Z1_lv, Z2_lv, TRUE);
                         Produce::inv_primitive(Emit::tree(), IF_BIP);
                         Produce::down(Emit::tree());
                             Produce::inv_primitive(Emit::tree(), INDIRECT4_BIP);
    @@ -1552,9 +1552,9 @@ combinations.
         if ((dbp == R_containment) && (K == NULL)) K = K_object;
         #endif
         if (Calculus::Deferrals::has_finite_domain(K)) {
    -        i6_schema loop_schema;
    +        i6_schema loop_schema;
             if (Calculus::Deferrals::write_loop_schema(&loop_schema, K)) {
    -            Calculus::Schemas::emit_expand_from_locals(&loop_schema, Z1_lv, Z2_lv, TRUE);
    +            Calculus::Schemas::emit_expand_from_locals(&loop_schema, Z1_lv, Z2_lv, TRUE);
                         Produce::inv_primitive(Emit::tree(), IF_BIP);
                         Produce::down(Emit::tree());
                             Produce::inv_primitive(Emit::tree(), INDIRECT4_BIP);
    @@ -1596,11 +1596,11 @@ combinations.
         if ((dbp == R_containment) && (KR == NULL)) KR = K_object;
         #endif
         if ((Calculus::Deferrals::has_finite_domain(KL)) && (Calculus::Deferrals::has_finite_domain(KL))) {
    -        i6_schema loop_schema_L, loop_schema_R;
    +        i6_schema loop_schema_L, loop_schema_R;
             if ((Calculus::Deferrals::write_loop_schema(&loop_schema_L, KL)) &&
                 (Calculus::Deferrals::write_loop_schema(&loop_schema_R, KR))) {
    -            Calculus::Schemas::emit_expand_from_locals(&loop_schema_L, Z1_lv, Z2_lv, TRUE);
    -                    Calculus::Schemas::emit_expand_from_locals(&loop_schema_R, Z3_lv, Z4_lv, TRUE);
    +            Calculus::Schemas::emit_expand_from_locals(&loop_schema_L, Z1_lv, Z2_lv, TRUE);
    +                    Calculus::Schemas::emit_expand_from_locals(&loop_schema_R, Z3_lv, Z4_lv, TRUE);
     
                                 Produce::inv_primitive(Emit::tree(), IF_BIP);
                                 Produce::down(Emit::tree());
    @@ -1750,7 +1750,7 @@ This begins with a header of 8 words and is then followed by a bitmap.
     

    -void Relations::compile_vtov_storage(binary_predicate *bp) {
    +void Relations::compile_vtov_storage(binary_predicate *bp) {
         int left_count = 0, right_count = 0, words_used = 0, bytes_used = 0;
         Relations::allocate_index_storage();
         Index the left and right domains and calculate their sizes14.1;
    @@ -1878,7 +1878,7 @@ not kinds); and that it must inherit from the domain of the term.
     

    -int Relations::infs_in_domain(inference_subject *infs, binary_predicate *bp, int index) {
    +int Relations::infs_in_domain(inference_subject *infs, binary_predicate *bp, int index) {
         if (InferenceSubjects::domain(infs) != NULL) return FALSE;
         kind *K = BinaryPredicates::term_kind(bp, index);
         if (K == NULL) return FALSE;
    @@ -1941,7 +1941,7 @@ domain. We count upwards from 0 (in order of creation).
     

    -int Relations::relation_range(binary_predicate *bp, int index) {
    +int Relations::relation_range(binary_predicate *bp, int index) {
         int t = 0;
         inference_subject *infs;
         LOOP_OVER(infs, inference_subject) {
    @@ -1956,22 +1956,22 @@ domain. We count upwards from 0 (in order of creation).
     
     
     int *relation_indices = NULL;
    -void Relations::allocate_index_storage(void) {
    +void Relations::allocate_index_storage(void) {
         int nc = NUMBER_CREATED(inference_subject);
         relation_indices = (int *) (Memory::calloc(nc, 2*sizeof(int), OBJECT_COMPILATION_MREASON));
     }
     
    -void Relations::set_relation_index(inference_subject *infs, int i, int v) {
    +void Relations::set_relation_index(inference_subject *infs, int i, int v) {
         if (relation_indices == NULL) internal_error("relation index unallocated");
         relation_indices[2*(infs->allocation_id) + i] = v;
     }
     
    -int Relations::get_relation_index(inference_subject *infs, int i) {
    +int Relations::get_relation_index(inference_subject *infs, int i) {
         if (relation_indices == NULL) internal_error("relation index unallocated");
         return relation_indices[2*(infs->allocation_id) + i];
     }
     
    -void Relations::free_index_storage(void) {
    +void Relations::free_index_storage(void) {
         if (relation_indices == NULL) internal_error("relation index unallocated");
         int nc = NUMBER_CREATED(inference_subject);
         Memory::I7_array_free(relation_indices, OBJECT_COMPILATION_MREASON, nc, 2*sizeof(int));
    @@ -2054,7 +2054,7 @@ $$ p(P) = 12, p(S) = 23, p(R) = 25, p(D) = 26, p(O) = 31. $$
     

    -void Relations::equivalence_relation_make_singleton_partitions(binary_predicate *bp,
    +void Relations::equivalence_relation_make_singleton_partitions(binary_predicate *bp,
         int domain_size) {
         int i;
         int *partition_array = Memory::calloc(domain_size, sizeof(int), PARTITION_MREASON);
    @@ -2101,7 +2101,7 @@ users to set up these relations in a stylistically poor way.
     

    -void Relations::equivalence_relation_merge_classes(binary_predicate *bp,
    +void Relations::equivalence_relation_merge_classes(binary_predicate *bp,
         int domain_size, int ix1, int ix2) {
         if (bp->form_of_relation != Relation_Equiv)
             internal_error("attempt to merge classes for a non-equivalence relation");
    @@ -2126,7 +2126,7 @@ in turn.
     

    -void Relations::equivalence_relation_add_properties(binary_predicate *bp) {
    +void Relations::equivalence_relation_add_properties(binary_predicate *bp) {
         kind *k = BinaryPredicates::term_kind(bp, 1);
         if (Kinds::Behaviour::is_object(k)) {
             instance *I;
    @@ -2156,7 +2156,7 @@ in turn.
     

    -int Relations::equivalence_relation_get_class(binary_predicate *bp, int ix) {
    +int Relations::equivalence_relation_get_class(binary_predicate *bp, int ix) {
         if (bp->form_of_relation != Relation_Equiv)
             internal_error("attempt to merge classes for a non-equivalence relation");
         if (bp->right_way_round == FALSE) bp = bp->reversal;
    @@ -2175,7 +2175,7 @@ checking in.
     

    -void Relations::check_OtoO_relation(binary_predicate *bp) {
    +void Relations::check_OtoO_relation(binary_predicate *bp) {
         int nc = NUMBER_CREATED(inference_subject);
         int *right_counts = (int *)
             (Memory::calloc(nc, sizeof(int), OBJECT_COMPILATION_MREASON));
    @@ -2228,7 +2228,7 @@ checking in.
         Memory::I7_array_free(right_counts, OBJECT_COMPILATION_MREASON, nc, sizeof(inference *));
     }
     
    -void Relations::check_OtoV_relation(binary_predicate *bp) {
    +void Relations::check_OtoV_relation(binary_predicate *bp) {
         int nc = NUMBER_CREATED(inference_subject);
         int *right_counts = (int *)
             (Memory::calloc(nc, sizeof(int), OBJECT_COMPILATION_MREASON));
    @@ -2312,7 +2312,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)
    @@ -2394,7 +2394,7 @@ whether or not $R(t_0<
                 }
                 Produce::inv_primitive(Emit::tree(), RETURN_BIP);
                 Produce::down(Emit::tree());
    -            Calculus::Schemas::emit_val_expand_from_locals(rg->f0, X_lv, X_lv);
    +            Calculus::Schemas::emit_val_expand_from_locals(rg->f0, X_lv, X_lv);
                 Produce::up(Emit::tree());
                 if (rg->check_R) {
                         Produce::up(Emit::tree());
    @@ -2436,7 +2436,7 @@ whether or not $R(t_0<
                 }
                 Produce::inv_primitive(Emit::tree(), RETURN_BIP);
                 Produce::down(Emit::tree());
    -            Calculus::Schemas::emit_val_expand_from_locals(rg->f1, X_lv, X_lv);
    +            Calculus::Schemas::emit_val_expand_from_locals(rg->f1, X_lv, X_lv);
                 Produce::up(Emit::tree());
                 if (rg->check_L) {
                         Produce::up(Emit::tree());
    @@ -2490,7 +2490,7 @@ whether or not $R(t_0<
                             Produce::up(Emit::tree());
                         downs++;
                     }
    -                Calculus::Schemas::emit_val_expand_from_locals(rg->inner_test, L_lv, R_lv);
    +                Calculus::Schemas::emit_val_expand_from_locals(rg->inner_test, L_lv, R_lv);
                     for (int i=0; i<downs; i++) Produce::up(Emit::tree());
     
                     Produce::code(Emit::tree());
    @@ -2547,7 +2547,7 @@ whether or not $R(t_0<
                     Produce::down(Emit::tree());
                 }
     
    -            Calculus::Schemas::emit_expand_from_locals(rg->inner_make_true, L_lv, R_lv, TRUE);
    +            Calculus::Schemas::emit_expand_from_locals(rg->inner_make_true, L_lv, R_lv, TRUE);
                 Produce::rtrue(Emit::tree());
     
                 if (downs > 0) { Produce::up(Emit::tree()); Produce::up(Emit::tree()); }
    @@ -2606,7 +2606,7 @@ whether or not $R(t_0<
                     Produce::down(Emit::tree());
                 }
     
    -            Calculus::Schemas::emit_expand_from_locals(rg->inner_make_false, L_lv, R_lv, TRUE);
    +            Calculus::Schemas::emit_expand_from_locals(rg->inner_make_false, L_lv, R_lv, TRUE);
                 Produce::rtrue(Emit::tree());
     
                 if (downs > 0) { Produce::up(Emit::tree()); Produce::up(Emit::tree()); }
    @@ -2626,7 +2626,7 @@ whether or not $R(t_0<
     

    §24.

    -void Relations::compile_routine_to_decide(inter_name *rname,
    +void Relations::compile_routine_to_decide(inter_name *rname,
         wording W, bp_term_details par1, bp_term_details par2) {
     
         packaging_state save = Routines::begin(rname);
    @@ -2691,7 +2691,7 @@ whether or not $R(t_0<
     

    -void Relations::index_for_verbs(OUTPUT_STREAM, binary_predicate *bp) {
    +void Relations::index_for_verbs(OUTPUT_STREAM, binary_predicate *bp) {
         WRITE(" ... <i>");
         if (bp == NULL) WRITE("(a meaning internal to Inform)");
         else {
    @@ -2704,8 +2704,28 @@ whether or not $R(t_0<
         WRITE("</i>");
     }
     
    +

    §27. Registering names of relations.

    + +
    +<relation-name-formal> ::=
    +    ... relation
    +
    + +

    §28.

    + +
    define REGISTER_RELATIONS_CALCULUS_CALLBACK Relations::register_name
    +
    +
    +void Relations::register_name(binary_predicate *bp, word_assemblage source_name) {
    +    word_assemblage wa =
    +        PreformUtilities::merge(<relation-name-formal>, 0, source_name);
    +    wording AW = WordAssemblages::to_wording(&wa);
    +    Nouns::new_proper_noun(AW, NEUTER_GENDER, ADD_TO_LEXICON_NTOPT,
    +        MISCELLANEOUS_MC, Rvalues::from_binary_predicate(bp), Task::language_of_syntax());
    +}
    +
    diff --git a/docs/core-module/7-tur.html b/docs/core-module/7-tur.html index 763ba5a18..ce758c914 100644 --- a/docs/core-module/7-tur.html +++ b/docs/core-module/7-tur.html @@ -67,55 +67,55 @@ function togglePopup(material_id) {

    To define the universal relation, which can apply and therefore subsumes all other relations.

    -
    +

    §1. Definitions.

    -

    §2.

    - +
    define VERB_MEANING_UNIVERSAL R_universal
    +
     binary_predicate *R_universal = NULL;
     binary_predicate *R_meaning = NULL;
     
    -

    §3. Family.

    +

    §2. Family.

     bp_family *universal_bp_family = NULL;
     
     void Relations::Universal::start(void) {
         universal_bp_family = BinaryPredicateFamilies::new();
    -    METHOD_ADD(universal_bp_family, STOCK_BPF_MTID, Relations::Universal::stock);
    -    METHOD_ADD(universal_bp_family, TYPECHECK_BPF_MTID, Relations::Universal::REL_typecheck);
    -    METHOD_ADD(universal_bp_family, ASSERT_BPF_MTID, Relations::Universal::REL_assert);
    -    METHOD_ADD(universal_bp_family, SCHEMA_BPF_MTID, Relations::Universal::REL_compile);
    -    METHOD_ADD(universal_bp_family, DESCRIBE_FOR_PROBLEMS_BPF_MTID, Relations::Universal::REL_describe_for_problems);
    +    METHOD_ADD(universal_bp_family, STOCK_BPF_MTID, Relations::Universal::stock);
    +    METHOD_ADD(universal_bp_family, TYPECHECK_BPF_MTID, Relations::Universal::REL_typecheck);
    +    METHOD_ADD(universal_bp_family, ASSERT_BPF_MTID, Relations::Universal::REL_assert);
    +    METHOD_ADD(universal_bp_family, SCHEMA_BPF_MTID, Relations::Universal::REL_compile);
    +    METHOD_ADD(universal_bp_family, DESCRIBE_FOR_PROBLEMS_BPF_MTID, Relations::Universal::REL_describe_for_problems);
     }
     
    -

    §4. Initial stock. There are just two relations of this kind, and both are hard-wired in. +

    §3. Initial stock. There are just two relations of this kind, and both are hard-wired in.

    -void Relations::Universal::stock(bp_family *self, int n) {
    +void Relations::Universal::stock(bp_family *self, int n) {
         if (n == 1) {
             R_universal =
                 BinaryPredicates::make_pair(universal_bp_family,
                     BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL),
    -                I"relates", NULL, NULL, NULL, NULL,
    +                I"relates", NULL, NULL, NULL,
                     PreformUtilities::wording(<relation-names>, UNIVERSAL_RELATION_NAME));
             R_meaning =
                 BinaryPredicates::make_pair(universal_bp_family,
                     BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL),
    -                I"means", NULL, NULL, NULL, NULL,
    +                I"means", NULL, NULL, NULL,
                     PreformUtilities::wording(<relation-names>, MEANING_RELATION_NAME));
         }
     }
     
    -

    §5. Typechecking. Universality is tricky to check. +

    §4. Typechecking. Universality is tricky to check.

    -int Relations::Universal::REL_typecheck(bp_family *self, binary_predicate *bp,
    -    kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
    +int Relations::Universal::REL_typecheck(bp_family *self, binary_predicate *bp,
    +    kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) {
         if (bp == R_meaning) {
             if (Kinds::eq(kinds_of_terms[0], K_verb) == FALSE) {
                 Problems::quote_kind(4, kinds_of_terms[0]);
    @@ -175,55 +175,55 @@ function togglePopup(material_id) {
         return ALWAYS_MATCH;
     }
     
    -

    §6. Assertion. This can't be asserted; it's for use at run-time only. +

    §5. Assertion. This can't be asserted; it's for use at run-time only.

    -int Relations::Universal::REL_assert(bp_family *self, binary_predicate *bp,
    +int Relations::Universal::REL_assert(bp_family *self, binary_predicate *bp,
             inference_subject *infs0, parse_node *spec0,
             inference_subject *infs1, parse_node *spec1) {
         return FALSE;
     }
     
    -

    §7. Compilation. Run-time is too late to change which verbs mean what, so this relation +

    §6. Compilation. Run-time is too late to change which verbs mean what, so this relation can't be changed at compile time, but the universal relation can.

    -int Relations::Universal::REL_compile(bp_family *self, int task, binary_predicate *bp,
    -    annotated_i6_schema *asch) {
    +int Relations::Universal::REL_compile(bp_family *self, int task, binary_predicate *bp,
    +    annotated_i6_schema *asch) {
         if (bp == R_meaning) {
             switch(task) {
                 case TEST_ATOM_TASK:
    -                Calculus::Schemas::modify(asch->schema, "*=-(BlkValueCompare(*1(CV_MEANING), *2)==0)");
    +                Calculus::Schemas::modify(asch->schema, "*=-(BlkValueCompare(*1(CV_MEANING), *2)==0)");
                     return TRUE;
             }
         } else {
             switch(task) {
                 case TEST_ATOM_TASK:
    -                Calculus::Schemas::modify(asch->schema, "*=-((RlnGetF(*1, RR_HANDLER))(*1, RELS_TEST, *&))");
    +                Calculus::Schemas::modify(asch->schema, "*=-((RlnGetF(*1, RR_HANDLER))(*1, RELS_TEST, *&))");
                     return TRUE;
                 case NOW_ATOM_TRUE_TASK:
    -                Calculus::Schemas::modify(asch->schema, "*=-((RlnGetF(*1, RR_HANDLER))(*1, RELS_ASSERT_TRUE, *&))");
    +                Calculus::Schemas::modify(asch->schema, "*=-((RlnGetF(*1, RR_HANDLER))(*1, RELS_ASSERT_TRUE, *&))");
                     return TRUE;
                 case NOW_ATOM_FALSE_TASK:
    -                Calculus::Schemas::modify(asch->schema, "*=-((RlnGetF(*1, RR_HANDLER))(*1, RELS_ASSERT_FALSE, *&))");
    +                Calculus::Schemas::modify(asch->schema, "*=-((RlnGetF(*1, RR_HANDLER))(*1, RELS_ASSERT_FALSE, *&))");
                     return TRUE;
             }
         }
         return FALSE;
     }
     
    -

    §8. Problem message text. Nothing special is needed here. +

    §7. Problem message text. Nothing special is needed here.

    -int Relations::Universal::REL_describe_for_problems(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
    +int Relations::Universal::REL_describe_for_problems(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) {
         return FALSE;
     }
     
    diff --git a/docs/core-module/7-vart.html b/docs/core-module/7-vart.html index d50eaa5ba..2c3aef122 100644 --- a/docs/core-module/7-vart.html +++ b/docs/core-module/7-vart.html @@ -645,7 +645,7 @@ usages to the debugging log. }
    diff --git a/docs/core-module/8-hdn.html b/docs/core-module/8-hdn.html index 2d87ced70..244792eba 100644 --- a/docs/core-module/8-hdn.html +++ b/docs/core-module/8-hdn.html @@ -725,7 +725,7 @@ but should this arise then the best recourse is to ignore the heading.
    • This code is used in §16.
    diff --git a/docs/core-module/8-ptu.html b/docs/core-module/8-ptu.html index b51132034..1825097b9 100644 --- a/docs/core-module/8-ptu.html +++ b/docs/core-module/8-ptu.html @@ -475,7 +475,7 @@ be such that their head nodes each pass this test: }
    diff --git a/docs/core-module/8-rs.html b/docs/core-module/8-rs.html index b9638f809..1fb762c01 100644 --- a/docs/core-module/8-rs.html +++ b/docs/core-module/8-rs.html @@ -1611,7 +1611,7 @@ match a given begin node. }
    diff --git a/docs/core-module/9-ef.html b/docs/core-module/9-ef.html index 7de0c232b..0efaa43ff 100644 --- a/docs/core-module/9-ef.html +++ b/docs/core-module/9-ef.html @@ -613,7 +613,7 @@ dictionary. }
    diff --git a/docs/core-module/P-wtmd.html b/docs/core-module/P-wtmd.html index f97e0b00b..934ccdef7 100644 --- a/docs/core-module/P-wtmd.html +++ b/docs/core-module/P-wtmd.html @@ -140,7 +140,7 @@ hat is indeed spatially on top of the can. more Linux-aware students to drink.

    diff --git a/docs/core-module/index.html b/docs/core-module/index.html index 673a6c74d..afa526d86 100644 --- a/docs/core-module/index.html +++ b/docs/core-module/index.html @@ -481,9 +481,9 @@

    This is where the propositions generated by the A-parser and the S-parser are at last acted upon, either immediately (generating inferences) or at run-time (by causing code to be compiled which will some day test or assert the truth of the proposition).

    • -

      - The Equality Relation - - To define that prince among predicates, the equality relation.

      +

      + The Equality Relation Revisited - + To define how equality behaves in the Inform language.

    • @@ -495,11 +495,6 @@ Assert Propositions - To declare that a given proposition is a true statement about the state of the world when play begins.

    • -
    • -

      - I6 Schemas - - To create, and later expand upon, short prototypes of I6 syntax for such run-time tasks as the setting, unsetting or testing of a relation.

      -
    • Compile Atoms - @@ -673,6 +668,11 @@ Inference Subjects - The different data structures for elements of the model world are all unified by a single concept, the inference subject, about which facts can be known.

    • +
    • +

      + Knowledge about Relations - + To store inferences about the state of relationships.

      +
    • Property Permissions - diff --git a/docs/if-module/3-mcr.html b/docs/if-module/3-mcr.html index fff6c7946..429aa9909 100644 --- a/docs/if-module/3-mcr.html +++ b/docs/if-module/3-mcr.html @@ -107,7 +107,7 @@ built in: BinaryPredicates::new_term(infs_room), BinaryPredicates::new_term(infs_room), I"adjacent-to", I"adjacent-from", - NULL, NULL, Calculus::Schemas::new("TestAdjacency(*1,*2)"), + NULL, Calculus::Schemas::new("TestAdjacency(*1,*2)"), PreformUtilities::wording(<relation-names>, ADJACENCY_RELATION_NAME)); } @@ -227,7 +227,7 @@ is intentionally done very early on. if (Str::get(pos) == ' ') Str::put(pos, '-'); bp_term_details room_term = BinaryPredicates::new_term(NULL); bp = BinaryPredicates::make_pair(map_connecting_bp_family, - room_term, room_term, relname, NULL, NULL, NULL, NULL, + room_term, room_term, relname, NULL, NULL, NULL, PreformUtilities::merge(<mapping-relation-construction>, 0, WordAssemblages::from_wording(W))); diff --git a/docs/if-module/3-rgn.html b/docs/if-module/3-rgn.html index 5c73f332e..f3612a85e 100644 --- a/docs/if-module/3-rgn.html +++ b/docs/if-module/3-rgn.html @@ -296,7 +296,7 @@ messages which would have been less helpful if core Inform had produced them. BinaryPredicates::new_term(infs_region), BinaryPredicates::new_term(Kinds::Knowledge::as_subject(K_object)), I"region-contains", I"in-region", - NULL, NULL, Calculus::Schemas::new("TestRegionalContainment(*2,*1)"), + NULL, Calculus::Schemas::new("TestRegionalContainment(*2,*1)"), PreformUtilities::wording(<relation-names>, REGIONAL_CONTAINMENT_RELATION_NAME)); BinaryPredicates::set_index_details(R_regional_containment, NULL, "room/region"); diff --git a/docs/if-module/3-sr.html b/docs/if-module/3-sr.html index 396223f58..079fec9cc 100644 --- a/docs/if-module/3-sr.html +++ b/docs/if-module/3-sr.html @@ -143,7 +143,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(NULL, NULL, EMPTY_WORDING, Calculus::Schemas::new("ContainerOf(*1)")), BinaryPredicates::new_term(NULL), I"contains", I"is-in", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(<relation-names>, CONTAINMENT_RELATION_NAME)); R_containment->loop_parent_optimisation_proviso = "ContainerOf"; R_containment->loop_parent_optimisation_ranger = "TestContainmentRange"; @@ -153,7 +153,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(infs_supporter, NULL, EMPTY_WORDING, Calculus::Schemas::new("SupporterOf(*1)")), BinaryPredicates::new_term(infs_thing), I"supports", I"is-on", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(<relation-names>, SUPPORT_RELATION_NAME)); R_support->loop_parent_optimisation_proviso = "SupporterOf"; R_incorporation = @@ -161,14 +161,14 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(infs_thing, NULL, EMPTY_WORDING, Calculus::Schemas::new("(*1.component_parent)")), BinaryPredicates::new_term(infs_thing), I"incorporates", I"is-part-of", - NULL, Calculus::Schemas::new("MakePart(*2,*1)"), NULL, + Calculus::Schemas::new("MakePart(*2,*1)"), NULL, PreformUtilities::wording(<relation-names>, INCORPORATION_RELATION_NAME)); R_carrying = BinaryPredicates::make_pair(spatial_bp_family, BinaryPredicates::full_new_term(infs_person, NULL, EMPTY_WORDING, Calculus::Schemas::new("CarrierOf(*1)")), BinaryPredicates::new_term(infs_thing), I"carries", I"is-carried-by", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(<relation-names>, CARRYING_RELATION_NAME)); R_carrying->loop_parent_optimisation_proviso = "CarrierOf"; R_holding = @@ -176,7 +176,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(infs_person, NULL, EMPTY_WORDING, Calculus::Schemas::new("HolderOf(*1)")), BinaryPredicates::new_term(infs_thing), I"holds", I"is-held-by", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(<relation-names>, HOLDING_RELATION_NAME)); can't be optimised, because parts are also held R_wearing = @@ -184,7 +184,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(infs_person, NULL, EMPTY_WORDING, Calculus::Schemas::new("WearerOf(*1)")), BinaryPredicates::new_term(infs_thing), I"wears", I"is-worn-by", - NULL, Calculus::Schemas::new("WearObject(*2,*1)"), NULL, + Calculus::Schemas::new("WearObject(*2,*1)"), NULL, PreformUtilities::wording(<relation-names>, WEARING_RELATION_NAME)); R_wearing->loop_parent_optimisation_proviso = "WearerOf"; a_has_b_predicate = @@ -192,7 +192,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(NULL, NULL, EMPTY_WORDING, Calculus::Schemas::new("OwnerOf(*1)")), BinaryPredicates::new_term(NULL), I"has", I"is-had-by", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(<relation-names>, POSSESSION_RELATION_NAME)); a_has_b_predicate->loop_parent_optimisation_proviso = "OwnerOf"; BinaryPredicates::set_index_details(a_has_b_predicate, "person", "thing"); @@ -201,7 +201,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(infs_room, NULL, EMPTY_WORDING, Calculus::Schemas::new("LocationOf(*1)")), BinaryPredicates::new_term(infs_thing), I"is-room-of", I"is-in-room", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(<relation-names>, ROOM_CONTAINMENT_RELATION_NAME)); room_containment_predicate->loop_parent_optimisation_proviso = "LocationOf";

    @@ -219,28 +219,28 @@ can be tested at run-time, but which can't be asserted or made true or false. BinaryPredicates::new_term(infs_thing), BinaryPredicates::new_term(infs_thing), I"can-see", I"can-be-seen-by", - NULL, NULL, Calculus::Schemas::new("TestVisibility(*1,*2)"), + NULL, Calculus::Schemas::new("TestVisibility(*1,*2)"), PreformUtilities::wording(<relation-names>, VISIBILITY_RELATION_NAME)); R_touchability = BinaryPredicates::make_pair(spatial_bp_family, BinaryPredicates::new_term(infs_thing), BinaryPredicates::new_term(infs_thing), I"can-touch", I"can-be-touched-by", - NULL, NULL, Calculus::Schemas::new("TestTouchability(*1,*2)"), + NULL, Calculus::Schemas::new("TestTouchability(*1,*2)"), PreformUtilities::wording(<relation-names>, TOUCHABILITY_RELATION_NAME)); R_concealment = BinaryPredicates::make_pair(spatial_bp_family, BinaryPredicates::new_term(infs_thing), BinaryPredicates::new_term(infs_thing), I"conceals", I"is-concealed-by", - NULL, NULL, Calculus::Schemas::new("TestConcealment(*1,*2)"), + NULL, Calculus::Schemas::new("TestConcealment(*1,*2)"), PreformUtilities::wording(<relation-names>, CONCEALMENT_RELATION_NAME)); R_enclosure = BinaryPredicates::make_pair(spatial_bp_family, BinaryPredicates::new_term(Kinds::Knowledge::as_subject(K_object)), BinaryPredicates::new_term(Kinds::Knowledge::as_subject(K_object)), I"encloses", I"is-enclosed-by", - NULL, NULL, Calculus::Schemas::new("IndirectlyContains(*1,*2)"), + NULL, Calculus::Schemas::new("IndirectlyContains(*1,*2)"), PreformUtilities::wording(<relation-names>, ENCLOSURE_RELATION_NAME));
    • This code is used in §2.
    diff --git a/inform7/Downloads/preform-diagnostics.txt b/inform7/Downloads/preform-diagnostics.txt index c7babf18f..7433c41c4 100644 --- a/inform7/Downloads/preform-diagnostics.txt +++ b/inform7/Downloads/preform-diagnostics.txt @@ -1,6 +1,6 @@ internal nti 19 constraint (none) extremes [1, 1] - internal hits 1088/5528 nti 20 constraint (none) extremes [0, 0] + internal hits 1087/5376 nti 20 constraint (none) extremes [0, 0] internal hits 3873/7958 nti 21 constraint (none) extremes [0, 0] @@ -4728,7 +4728,7 @@ twelfth constraint CS = {27} extremes [1, 1] - internal hits 200/24706 nti r0 constraint CS = {r0} extremes [1, 1] + internal hits 200/24494 nti r0 constraint CS = {r0} extremes [1, 1] internal nti r1 constraint CS = {r1} extremes [1, 1] @@ -4764,9 +4764,9 @@
    internal hits 16202/96586 nti r2 constraint (none) extremes [1, 1] - internal hits 21511/254038 nti r2 constraint (none) extremes [1, 1] + internal hits 21557/254354 nti r2 constraint (none) extremes [1, 1] - internal hits 2090/40276 nti r2 constraint (none) extremes [1, 1] + internal hits 2106/40288 nti r2 constraint (none) extremes [1, 1] nti r2 constraint CS = {r2} extremes [6, 6] English: @@ -4830,7 +4830,7 @@ hits 16/21706 nti 29 constraint DS = {29} extremes [2, infinity) English: not {...} - (hits 16/3790) (matched long text) constraint DS = {29} extremes [2, infinity) + (hits 16/3897) (matched long text) constraint DS = {29} extremes [2, infinity) hits 79/158 nti 30 constraint (none) extremes [1, infinity) English: @@ -4844,7 +4844,7 @@ hits 0/21422 nti 31 constraint DS = {31} extremes [2, infinity) English: no one {***} - (hits 0/5380) constraint DS = {31} extremes [2, infinity) + (hits 0/5524) constraint DS = {31} extremes [2, infinity) internal hits 92/1190 nti 18 constraint (none) extremes [1, 1] @@ -4911,13 +4911,13 @@ here here here here here here constraint CS = {12} extremes [6, 6] - internal hits 4028/9016 nti 6 constraint FS = {6} extremes [1, infinity) + internal hits 4036/9044 nti 6 constraint FS = {6} extremes [1, infinity) internal hits 16/128 nti 7 constraint FS = {7} extremes [1, infinity) - internal hits 1/8738 nti 8 constraint FS = {8} extremes [1, infinity) + internal hits 1/8808 nti 8 constraint FS = {8} extremes [1, infinity) - internal hits 0/720 nti 9 constraint FS = {9} extremes [1, infinity) + internal hits 0/2186 nti 9 constraint FS = {9} extremes [1, infinity) internal nti 10 constraint FS = {10} extremes [1, infinity) @@ -4937,7 +4937,7 @@ internal hits 635/18700 nti 13 constraint DS = {13} extremes [1, infinity) - internal hits 258/8096 nti 14 constraint DS = {14} extremes [1, infinity) + internal hits 258/8212 nti 14 constraint DS = {14} extremes [1, infinity) hits 67/4462 nti 13 constraint CS = {13} extremes [1, 1] English: @@ -4955,7 +4955,7 @@ hits 0/4304 nti 14 constraint DS = {14} extremes [1, infinity) English: {***} once/twice/thrice/turn/turns/time/times - (hits 0/1650) constraint DS = {14} extremes [1, infinity) + (hits 0/1659) constraint DS = {14} extremes [1, infinity) nti 18 constraint DW = {15, 16, 17, 18} extremes [1, 9] English: @@ -5031,7 +5031,7 @@ (hits 60/60) (matched: 'fixed in place') constraint (none) extremes [1, infinity) - hits 33/107786 nti 19 constraint CS = {19} extremes [1, 1] + hits 33/107858 nti 19 constraint CS = {19} extremes [1, 1] English: there (hits 33/44) (matched: 'there') constraint CS = {19} extremes [1, 1] @@ -5105,16 +5105,16 @@ hits 0/920 nti 15 constraint (none) extremes [1, infinity) English: - constraint CS = {22} extremes [1, 2] + (hits 0/2) constraint CS = {22} extremes [1, 2] {***} (hits 0/453) constraint (none) extremes [1, infinity) - (hits 0/362) constraint DS = {14} extremes [2, infinity) + (hits 0/376) constraint DS = {14} extremes [2, infinity) hits 0/1962 nti 16 constraint (none) extremes [1, infinity) English: - constraint CS = {22} extremes [1, 2] + (hits 0/4) constraint CS = {22} extremes [1, 2] (hits 0/981) constraint (none) extremes [1, infinity) @@ -5125,36 +5125,36 @@ internal hits 388/16686 nti 17 constraint (none) extremes [1, 1] - nti 22 constraint CS = {22} extremes [1, 2] + hits 0/12 nti 22 constraint CS = {22} extremes [1, 2] English: worn constraint CS = {22} extremes [1, 1] carried constraint CS = {22} extremes [1, 1] initially carried - constraint CS = {22} extremes [2, 2] + (hits 0/6) constraint CS = {22} extremes [2, 2] - hits 0/2686 nti 28 constraint DS = {14} extremes [2, infinity) + hits 0/2714 nti 28 constraint DS = {14} extremes [2, infinity) English: _,/and {...} - (hits 0/402) constraint DS = {14, 28} extremes [3, infinity) + (hits 0/393) constraint DS = {14, 28} extremes [3, infinity) _,/and - (hits 0/449) constraint DS = {14, 28} extremes [2, infinity) + (hits 0/432) constraint DS = {14, 28} extremes [2, infinity) - (hits 0/866) constraint DS = {14} extremes [2, infinity) + (hits 0/916) constraint DS = {14} extremes [2, infinity) hits 1467/2934 nti 27 constraint (none) extremes [1, infinity) English: {...} (hits 174/1467) (matched long text) constraint (none) extremes [1, infinity) {called} - (hits 57/409) (matched long text) constraint DS = {27} extremes [1, infinity) + (hits 57/414) (matched long text) constraint DS = {27} extremes [1, infinity) - (hits 0/715) constraint DS = {24} extremes [2, infinity) + (hits 0/717) constraint DS = {24} extremes [2, infinity) - (hits 87/456) (matched long text) constraint DS = {25} extremes [1, infinity) + (hits 87/312) (matched long text) constraint DS = {25} extremes [1, infinity) - (hits 30/212) (matched: 'a kind of supporter that is portable') constraint DS = {26} extremes [1, infinity) + (hits 30/200) (matched: 'a kind of supporter that is portable') constraint DS = {26} extremes [1, infinity) (hits 4/349) (matched: 'it') constraint (none) extremes [1, 1] @@ -5171,16 +5171,16 @@ (hits 431/431) (matched long text) constraint (none) extremes [1, infinity) - hits 0/10768 nti 24 constraint DS = {24} extremes [2, infinity) + hits 0/10790 nti 24 constraint DS = {24} extremes [2, infinity) English: it with action {***} - (hits 0/3836) constraint DS = {24} extremes [3, infinity) + (hits 0/3843) constraint DS = {24} extremes [3, infinity) {with/having} (/) {***} - (hits 0/3994) constraint DS = {24} extremes [2, infinity) + (hits 0/4001) constraint DS = {24} extremes [2, infinity) {with/having} {...} ( ) - (hits 0/3501) constraint DS = {24} extremes [5, infinity) + (hits 0/3504) constraint DS = {24} extremes [5, infinity) {with/having} - (hits 0/3994) constraint DS = {24} extremes [2, infinity) + (hits 0/4001) constraint DS = {24} extremes [2, infinity) nti 19 constraint (none) extremes [1, infinity) English: @@ -5203,26 +5203,26 @@ {...} constraint (none) extremes [1, infinity) - hits 174/3514 nti 25 constraint DS = {25} extremes [1, infinity) + hits 174/2264 nti 25 constraint DS = {25} extremes [1, infinity) English: , _{and} - (hits 8/1131) (matched: ', and didn't understand addressee's last name error') constraint DS = {25} extremes [2, infinity) + (hits 8/835) (matched: ', and didn't understand addressee's last name error') constraint DS = {25} extremes [2, infinity) _{,/and} - (hits 166/1266) (matched long text) constraint DS = {25} extremes [1, infinity) + (hits 166/970) (matched long text) constraint DS = {25} extremes [1, infinity) - hits 30/424 nti 21 constraint DS = {26} extremes [1, infinity) + hits 30/400 nti 21 constraint DS = {26} extremes [1, infinity) English: - (hits 30/212) (matched: 'a kind of supporter that is portable') constraint DS = {26} extremes [2, infinity) + (hits 30/200) (matched: 'a kind of supporter that is portable') constraint DS = {26} extremes [2, infinity) - (hits 0/182) constraint DS = {26} extremes [1, infinity) + (hits 0/170) constraint DS = {26} extremes [1, infinity) - hits 30/452 nti 26 constraint DS = {26} extremes [1, infinity) + hits 30/428 nti 26 constraint DS = {26} extremes [1, infinity) English: kind/kinds (hits 4/6) (matched: 'kind') constraint CS = {26} extremes [1, 1] kind/kinds of - (hits 26/220) (matched: 'kind of supporter that is portable') constraint DS = {26} extremes [2, infinity) + (hits 26/208) (matched: 'kind of supporter that is portable') constraint DS = {26} extremes [2, infinity) internal nti 22 constraint (none) extremes [1, infinity) @@ -5238,15 +5238,15 @@ {...} (hits 67/1202) (matched: 'usually table of general chitchat') constraint DS = {13} extremes [2, infinity) - hits 605/24640 nti 30 constraint CS = {30} extremes [1, 1] + hits 771/25442 nti 30 constraint CS = {30} extremes [1, 1] English: which/who/that - (hits 605/6165) (matched: 'which') constraint CS = {30} extremes [1, 1] + (hits 771/6130) (matched: 'which') constraint CS = {30} extremes [1, 1] hits 2/2742 nti 26 constraint DS = {30} extremes [2, infinity) English: {...} - (hits 2/718) (matched: 'answering it that') constraint DS = {30} extremes [2, infinity) + (hits 2/716) (matched: 'answering it that') constraint DS = {30} extremes [2, infinity) nti 31 constraint DS = {31} extremes [3, infinity) English: @@ -5477,29 +5477,29 @@ hits 199/10188 nti 7 constraint DW = {11, 12} extremes [2, infinity) English: - (hits 191/2750) (matched long text) constraint DS = {11} extremes [2, infinity) + (hits 191/2674) (matched long text) constraint DS = {11} extremes [2, infinity) - (hits 8/3856) (matched long text) constraint DS = {12} extremes [3, infinity) + (hits 8/3854) (matched long text) constraint DS = {12} extremes [3, infinity) - hits 191/2148 nti 11 constraint DS = {11} extremes [2, infinity) + hits 191/2146 nti 11 constraint DS = {11} extremes [2, infinity) English: volume {...} - (hits 6/1074) (matched long text) constraint DS = {11} extremes [2, infinity) + (hits 6/1073) (matched long text) constraint DS = {11} extremes [2, infinity) book {...} - (hits 0/1068) constraint DS = {11} extremes [2, infinity) + (hits 0/1067) constraint DS = {11} extremes [2, infinity) part {...} - (hits 14/1068) (matched: 'part two - the physical world model') constraint DS = {11} extremes [2, infinity) + (hits 14/1067) (matched: 'part two - the physical world model') constraint DS = {11} extremes [2, infinity) chapter {...} - (hits 20/1054) (matched long text) constraint DS = {11} extremes [2, infinity) + (hits 20/1053) (matched long text) constraint DS = {11} extremes [2, infinity) section {...} - (hits 151/1034) (matched long text) constraint DS = {11} extremes [2, infinity) + (hits 151/1033) (matched long text) constraint DS = {11} extremes [2, infinity) - hits 8/7712 nti 12 constraint DS = {12} extremes [3, infinity) + hits 8/7708 nti 12 constraint DS = {12} extremes [3, infinity) English: {...} begin/begins here - (hits 4/3856) (matched long text) constraint DS = {12} extremes [3, infinity) + (hits 4/3854) (matched long text) constraint DS = {12} extremes [3, infinity) {...} end/ends here - (hits 4/3852) (matched: 'the standard rules end here') constraint DS = {12} extremes [3, infinity) + (hits 4/3850) (matched: 'the standard rules end here') constraint DS = {12} extremes [3, infinity) hits 32/12958 nti 14 constraint (none) extremes [1, infinity) English: @@ -5514,15 +5514,15 @@ * constraint DS = {14} extremes [2, 2] table {...} - (hits 14/6321) (matched long text) constraint DS = {14} extremes [2, infinity) + (hits 14/6338) (matched long text) constraint DS = {14} extremes [2, infinity) equation {...} - (hits 0/6307) constraint DS = {14} extremes [2, infinity) + (hits 0/6324) constraint DS = {14} extremes [2, infinity) include the {...} by {...} - (hits 0/6226) constraint DS = {14} extremes [5, infinity) + (hits 0/6243) constraint DS = {14} extremes [5, infinity) include {...} by {...} - (hits 18/6307) (matched long text) constraint DS = {14} extremes [4, infinity) + (hits 18/6324) (matched long text) constraint DS = {14} extremes [4, infinity) include (- {...} - (hits 0/6289) constraint DS = {14} extremes [3, infinity) + (hits 0/6306) constraint DS = {14} extremes [3, infinity) hits 9/2788 nti 15 constraint DS = {15} extremes [2, infinity) English: @@ -5547,13 +5547,13 @@ hits 30/442 nti 22 constraint DS = {22} extremes [2, infinity) English: {...} ( ) - (hits 13/78) (matched long text) constraint DS = {22} extremes [4, infinity) + (hits 13/88) (matched long text) constraint DS = {22} extremes [4, infinity) {...} not for release - (hits 1/65) (matched long text) constraint DS = {22} extremes [4, infinity) + (hits 1/75) (matched long text) constraint DS = {22} extremes [4, infinity) {...} for release only - (hits 0/64) constraint DS = {22} extremes [4, infinity) + (hits 0/74) constraint DS = {22} extremes [4, infinity) {...} unindexed - (hits 16/64) (matched long text) constraint DS = {22} extremes [2, infinity) + (hits 16/74) (matched long text) constraint DS = {22} extremes [2, infinity) hits 13/26 nti 21 constraint DW = {18, 20, 21} extremes [1, infinity) English: @@ -5734,9 +5734,9 @@ hits 30/9858 nti 10 constraint DS = {10} extremes [2, infinity) English: instead {...} - (hits 0/1971) constraint DS = {10} extremes [2, infinity) + (hits 0/1965) constraint DS = {10} extremes [2, infinity) {...} instead - (hits 30/1971) (matched long text) constraint DS = {10} extremes [2, infinity) + (hits 30/1965) (matched long text) constraint DS = {10} extremes [2, infinity) hits 0/880 nti 11 constraint DS = {11} extremes [2, infinity) English: @@ -5865,9 +5865,9 @@ hits 4/1112 nti 19 constraint DS = {19} extremes [3, infinity) English:
    plural of - (hits 4/155) (matched: 'the plural of person') constraint DS = {19} extremes [4, infinity) + (hits 4/156) (matched: 'the plural of person') constraint DS = {19} extremes [4, infinity) plural of - (hits 0/153) constraint DS = {19} extremes [3, infinity) + (hits 0/154) constraint DS = {19} extremes [3, infinity) nti 16 constraint (none) extremes [1, infinity) English: @@ -6017,7 +6017,7 @@ hits 0/856 nti 7 constraint DS = {7} extremes [3, infinity) English: defined by - (hits 0/154) constraint DS = {7} extremes [3, infinity) + (hits 0/158) constraint DS = {7} extremes [3, infinity) nti 22 constraint (none) extremes [1, infinity) English: @@ -6061,7 +6061,7 @@ , _{and} (hits 1/362) (matched: ', and the library') constraint DS = {12} extremes [3, infinity) _{,/and} - (hits 29/389) (matched long text) constraint DS = {12} extremes [2, infinity) + (hits 29/390) (matched long text) constraint DS = {12} extremes [2, infinity) hits 83/352 nti 11 constraint DS = {11} extremes [2, infinity) English: @@ -6157,7 +6157,7 @@ hits 34/1104 nti 16 constraint DS = {16} extremes [1, 2] English:
    activity - (hits 34/34) (matched: 'an activity') constraint DS = {16} extremes [2, 2] + (hits 34/38) (matched: 'an activity') constraint DS = {16} extremes [2, 2] activity (hits 0/1) constraint CS = {16} extremes [1, 1] @@ -6336,7 +6336,7 @@ hits 0/856 nti 14 constraint DS = {14} extremes [2, infinity) English: either - (hits 0/245) constraint DS = {14} extremes [2, infinity) + (hits 0/264) constraint DS = {14} extremes [2, infinity) hits 0/86 nti 15 constraint (none) extremes [1, 2] English: @@ -6384,18 +6384,18 @@ hits 74/1260 nti 9 constraint DS = {19} extremes [1, infinity) English: - (hits 74/166) (matched: 'a verb') constraint DS = {19} extremes [2, infinity) + (hits 74/183) (matched: 'a verb') constraint DS = {19} extremes [2, infinity) - (hits 0/92) constraint DS = {19} extremes [1, infinity) + (hits 0/110) constraint DS = {19} extremes [1, infinity) - hits 74/448 nti 19 constraint DS = {19} extremes [1, infinity) + hits 74/516 nti 19 constraint DS = {19} extremes [1, infinity) English: verb - (hits 74/74) (matched: 'verb') constraint CS = {19} extremes [1, 1] + (hits 74/75) (matched: 'verb') constraint CS = {19} extremes [1, 1] verb implying/meaning nounphrase-unparsed> - (hits 0/27) constraint DS = {19} extremes [4, 4] + (hits 0/42) constraint DS = {19} extremes [4, 4] verb implying/meaning - (hits 0/150) constraint DS = {19} extremes [3, infinity) + (hits 0/183) constraint DS = {19} extremes [3, infinity) hits 82/168 nti 10 constraint DS = {20} extremes [2, infinity) English: @@ -6501,9 +6501,9 @@ hits 734/1956 nti 28 constraint (none) extremes [1, infinity) English: variable - (hits 0/42) constraint CS = {28} extremes [1, 1] + (hits 0/35) constraint CS = {28} extremes [1, 1] action of - (hits 0/79) constraint DS = {28} extremes [3, infinity) + (hits 0/81) constraint DS = {28} extremes [3, infinity) (hits 728/978) (matched: 'action name based rule producing nothing that varies') constraint (none) extremes [1, infinity) @@ -6512,7 +6512,7 @@ hits 0/514 nti 30 constraint DS = {29, 30} extremes [4, infinity) English: {...} ( ) - (hits 0/16) constraint DS = {29, 30} extremes [4, infinity) + (hits 0/18) constraint DS = {29, 30} extremes [4, infinity) nti 29 constraint CS = {29} extremes [1, 1] English: @@ -6528,11 +6528,11 @@
    (hits 0/73) constraint (none) extremes [1, 1] (/)/(- {***} - (hits 0/59) constraint DS = {31} extremes [1, infinity) + (hits 0/61) constraint DS = {31} extremes [1, infinity) {***} (/)/(- - (hits 0/59) constraint DS = {31} extremes [1, infinity) + (hits 0/61) constraint DS = {31} extremes [1, infinity) {...} (/)/(- {...} - (hits 0/46) constraint DS = {31} extremes [3, infinity) + (hits 0/48) constraint DS = {31} extremes [3, infinity) ni--crash--1 constraint CS = {31} extremes [1, 1] ni--crash--10 @@ -6540,11 +6540,11 @@ ni--crash--11 constraint CS = {31} extremes [1, 1] , {...} - (hits 0/59) constraint DS = {31} extremes [2, infinity) + (hits 0/61) constraint DS = {31} extremes [2, infinity) {...} , - (hits 0/59) constraint DS = {31} extremes [2, infinity) + (hits 0/61) constraint DS = {31} extremes [2, infinity) {...} when/while {...} - (hits 0/46) constraint DS = {31} extremes [3, infinity) + (hits 0/48) constraint DS = {31} extremes [3, infinity) {***} {***} (hits 0/273) constraint (none) extremes [1, infinity) condition @@ -6605,7 +6605,7 @@ hits 0/50 nti 10 constraint (none) extremes [1, infinity) English: {...} with/having/and/or {...} - (hits 0/9) constraint DS = {10} extremes [3, infinity) + (hits 0/8) constraint DS = {10} extremes [3, infinity) (hits 0/25) constraint (none) extremes [1, infinity) @@ -6616,30 +6616,30 @@ internal nti 13 constraint (none) extremes [1, infinity) - hits 0/7126 nti 31 constraint DW = {29, 30, 31} extremes [2, 5] + hits 0/7134 nti 31 constraint DW = {29, 30, 31} extremes [2, 5] English: minus - (hits 0/472) constraint DS = {29, 31} extremes [3, 5] + (hits 0/550) constraint DS = {29, 31} extremes [3, 5] - (hits 0/968) constraint DS = {29} extremes [2, 4] + (hits 0/1037) constraint DS = {29} extremes [2, 4] - (hits 0/1457) constraint DS = {30} extremes [2, 2] + (hits 0/1351) constraint DS = {30} extremes [2, 2] - hits 0/1936 nti 29 constraint DS = {29} extremes [2, 4] + hits 0/2074 nti 29 constraint DS = {29} extremes [2, 4] English: hour/hours - (hits 0/284) constraint DS = {29} extremes [2, 2] + (hits 0/292) constraint DS = {29} extremes [2, 2] minute/minutes - (hits 0/284) constraint DS = {29} extremes [2, 2] + (hits 0/292) constraint DS = {29} extremes [2, 2] hour/hours minute/minutes - (hits 0/371) constraint DS = {29} extremes [4, 4] + (hits 0/416) constraint DS = {29} extremes [4, 4] - hits 0/2914 nti 14 constraint DS = {30} extremes [2, 2] + hits 0/2702 nti 14 constraint DS = {30} extremes [2, 2] English: - (hits 0/1457) constraint DS = {30} extremes [2, 2] + (hits 0/1351) constraint DS = {30} extremes [2, 2] - (hits 0/1457) constraint DS = {30} extremes [2, 2] + (hits 0/1351) constraint DS = {30} extremes [2, 2] nti 30 constraint CS = {30} extremes [1, 1] English: @@ -6648,7 +6648,7 @@ pm constraint CS = {30} extremes [1, 1] - internal hits 0/2914 nti 15 constraint (none) extremes [1, 1] + internal hits 0/2702 nti 15 constraint (none) extremes [1, 1] internal nti 16 constraint (none) extremes [1, 1] @@ -6748,16 +6748,21 @@ {...} relation storage constraint DS = {16} extremes [3, infinity) - hits 438/876 nti 17 constraint (none) extremes [1, infinity) + nti 17 constraint DS = {17} extremes [2, infinity) + English: + {...} relation + constraint DS = {17} extremes [2, infinity) + + hits 438/876 nti 18 constraint (none) extremes [1, infinity) English: {***} . {***} - (hits 0/438) constraint DS = {17} extremes [1, infinity) + (hits 0/438) constraint DS = {18} extremes [1, infinity) , {***} - (hits 0/438) constraint DS = {17} extremes [1, infinity) + (hits 0/438) constraint DS = {18} extremes [1, infinity) {***} , - (hits 0/438) constraint DS = {17} extremes [1, infinity) + (hits 0/438) constraint DS = {18} extremes [1, infinity) {***} , , {***} - (hits 0/438) constraint DS = {17} extremes [2, infinity) + (hits 0/438) constraint DS = {18} extremes [2, infinity) {...} (hits 438/438) (matched long text) constraint (none) extremes [1, infinity) @@ -6795,7 +6800,7 @@ minus (hits 0/1235) constraint DS = {6} extremes [2, 2] ( ) - (hits 273/815) (matched: '"[current item from the multiple object list]: [run paragraph on]" ( a )') constraint DS = {6} extremes [4, 4] + (hits 273/816) (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 and outdoor, which are not necessarily areas in a building. A player in one @@ -6806,11 +6811,11 @@ (hits 78/103) (matched: 'false') constraint CS = {26} extremes [1, 1] - (hits 0/1568) constraint DS = {28} extremes [2, infinity) + (hits 0/1977) constraint DS = {28} extremes [2, infinity) unicode - (hits 0/3241) constraint DS = {6} extremes [2, infinity) + (hits 0/3243) constraint DS = {6} extremes [2, infinity) - (hits 0/3563) constraint DW = {29, 30, 31} extremes [2, 5] + (hits 0/3567) constraint DW = {29, 30, 31} extremes [2, 5] (hits 0/9820) constraint (none) extremes [1, infinity) @@ -6840,22 +6845,22 @@ internal hits 1/19798 nti 10 constraint (none) extremes [1, infinity) - hits 2367/20792 nti 18 constraint (none) extremes [1, infinity) + hits 2367/20792 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) nothing - (hits 97/1038) (matched: 'nothing') constraint CS = {18} extremes [1, 1] + (hits 97/142) (matched: 'nothing') constraint CS = {19} extremes [1, 1] (hits 446/8502) (matched: 'printing the name of a dark room') constraint (none) extremes [1, infinity) outcome - (hits 0/1760) constraint DS = {18} extremes [2, infinity) + (hits 0/911) constraint DS = {19} extremes [2, infinity) option - (hits 26/1760) (matched: 'serial comma option') constraint DS = {18} extremes [2, infinity) + (hits 26/911) (matched: 'serial comma option') constraint DS = {19} extremes [2, infinity) verb - (hits 1/1734) (matched: 'verb are') constraint DS = {18} extremes [2, infinity) + (hits 1/885) (matched: 'verb are') constraint DS = {19} extremes [2, infinity) response ( ) - (hits 0/699) constraint DS = {18} extremes [5, infinity) + (hits 0/570) constraint DS = {19} extremes [5, infinity) internal hits 446/17004 nti 11 constraint (none) extremes [1, infinity) @@ -6869,12 +6874,12 @@ internal hits 165/18530 nti 16 constraint (none) extremes [1, infinity) - hits 34/1592 nti 17 constraint DS = {19} extremes [2, infinity) + hits 34/1592 nti 17 constraint DS = {20} extremes [2, infinity) English: - (hits 34/34) (matched: 'the property initial appearance') constraint DS = {19} extremes [3, infinity) + (hits 34/191) (matched: 'the property initial appearance') constraint DS = {20} extremes [3, infinity) - constraint DS = {19} extremes [2, infinity) + (hits 0/178) constraint DS = {20} extremes [2, infinity) internal hits 796/21352 nti 18 constraint (none) extremes [1, infinity) @@ -6883,23 +6888,23 @@ (hits 651/10911) (matched: 'unmarked for listing') constraint (none) extremes [1, infinity) - hits 1442/27388 nti 21 constraint (none) extremes [1, infinity) + hits 1442/27388 nti 22 constraint (none) extremes [1, infinity) English: not - (hits 0/3023) constraint DS = {21} extremes [3, infinity) + (hits 0/2367) constraint DS = {22} extremes [3, infinity) (hits 0/6875) constraint (none) extremes [2, infinity) (hits 1442/13694) (matched: 'marked for listing other') constraint (none) extremes [1, infinity) - hits 1513/29618 nti 20 constraint (none) extremes [1, infinity) + hits 1513/29618 nti 21 constraint (none) extremes [1, infinity) English: not - (hits 12/4386) (matched: 'not lockable') constraint DS = {20} extremes [2, infinity) + (hits 12/4868) (matched: 'not lockable') constraint DS = {21} extremes [2, infinity) (hits 1430/2225) (matched: 'unmarked for listing') constraint CS = {r3} extremes [1, infinity) not - (hits 0/2761) constraint DS = {20} extremes [3, infinity) + (hits 0/3037) constraint DS = {21} extremes [3, infinity) (hits 71/7202) (matched: 'marked for listing other') constraint (none) extremes [2, infinity) @@ -6941,10 +6946,10 @@ (hits 257/1022) (matched: 'thing ( called the item being printed )') constraint (none) extremes [1, infinity) - hits 1649/40686 nti 22 constraint (none) extremes [1, infinity) + hits 1649/40686 nti 23 constraint (none) extremes [1, infinity) English: ( called ) - (hits 118/819) (matched long text) constraint DS = {22} extremes [5, infinity) + (hits 118/1466) (matched long text) constraint DS = {23} extremes [5, infinity) (hits 1531/20225) (matched: 'the alfred cralle pool hall') constraint (none) extremes [1, infinity) @@ -6999,10 +7004,10 @@ (hits 0/170) constraint (none) extremes [1, infinity) - hits 102/544 nti 23 constraint (none) extremes [1, infinity) + hits 102/544 nti 24 constraint (none) extremes [1, infinity) English: ( called ) - (hits 0/66) constraint DS = {23} extremes [5, infinity) + (hits 0/66) constraint DS = {24} extremes [5, infinity) (hits 102/272) (matched: 'the dark') constraint (none) extremes [1, infinity) @@ -7052,12 +7057,12 @@ (hits 1831/2286) (matched long text) constraint (none) extremes [1, infinity) - hits 3118/7704 nti 30 constraint (none) extremes [1, infinity) + hits 3118/7704 nti 31 constraint (none) extremes [1, infinity) English: variable/variables - (hits 2/499) (matched: 'text variables') constraint DS = {30} extremes [2, infinity) + (hits 2/353) (matched: 'text variables') constraint DS = {31} extremes [2, infinity) that/which vary/varies - (hits 59/369) (matched: 'action name based rule producing nothing that varies') constraint DS = {30} extremes [3, infinity) + (hits 59/265) (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) @@ -7088,12 +7093,12 @@ (hits 1178/1435) (matched long text) constraint (none) extremes [1, infinity) - hits 61/124 nti 29 constraint (none) extremes [1, infinity) + hits 61/124 nti 30 constraint (none) extremes [1, infinity) English: global - (hits 0/22) constraint CS = {29} extremes [1, 1] + constraint CS = {30} extremes [1, 1] global - constraint DS = {29} extremes [2, infinity) + (hits 0/1) constraint DS = {30} extremes [2, infinity) (hits 61/62) (matched: 'action name based rule producing nothing') constraint (none) extremes [1, infinity) @@ -7118,10 +7123,10 @@ internal hits 0/18492 nti 19 constraint (none) extremes [0, 0] - hits 8448/18780 nti 26 constraint (none) extremes [1, infinity) + hits 8448/18780 nti 27 constraint (none) extremes [1, infinity) English: ( ) - (hits 0/1353) constraint DS = {26} extremes [3, infinity) + (hits 0/1849) constraint DS = {27} extremes [3, infinity) (hits 144/9390) (matched: 'the person reaching') constraint (none) extremes [1, infinity) @@ -7143,17 +7148,17 @@ (hits 116/9145) (matched: 'a supporter ( called the chaise )') constraint (none) extremes [1, infinity) - (hits 0/1672) constraint DS = {25} extremes [2, infinity) + (hits 0/1035) constraint DS = {26} extremes [2, infinity) member/members of - (hits 0/1323) constraint DS = {26} extremes [3, infinity) + (hits 0/1799) constraint DS = {27} extremes [3, infinity) member/members of - (hits 0/1323) constraint DS = {26} extremes [3, infinity) + (hits 0/1799) constraint DS = {27} extremes [3, infinity) of - (hits 2/1323) (matched: 'the destination of the player') constraint DS = {26} extremes [3, infinity) + (hits 2/1799) (matched: 'the destination of the player') constraint DS = {27} extremes [3, infinity) (hits 0/4670) constraint (none) extremes [2, infinity) entry of/in/from - (hits 0/1177) constraint DS = {26} extremes [4, infinity) + (hits 0/1227) constraint DS = {27} extremes [4, infinity) (hits 0/9027) constraint (none) extremes [1, infinity) @@ -7161,12 +7166,12 @@ (hits 0/9027) constraint (none) extremes [1, infinity) - hits 4/18384 nti 24 constraint (none) extremes [1, infinity) + hits 4/18384 nti 25 constraint (none) extremes [1, infinity) English: where - (hits 4/1751) (matched long text) constraint DS = {24} extremes [3, infinity) + (hits 4/919) (matched long text) constraint DS = {25} extremes [3, infinity) where - (hits 0/1747) constraint DS = {24} extremes [3, infinity) + (hits 0/915) constraint DS = {25} extremes [3, infinity) (hits 0/9188) constraint (none) extremes [1, infinity) @@ -7181,10 +7186,10 @@ (hits 2211/8413) (matched: 'current item from the multiple object list') constraint (none) extremes [1, infinity) - nti 31 constraint (none) extremes [1, infinity) + nti 6 constraint (none) extremes [1, infinity) English: ( ) - constraint DS = {31} extremes [3, infinity) + constraint DS = {6} extremes [3, infinity) constraint (none) extremes [1, infinity) @@ -7201,34 +7206,34 @@ internal hits 2296/19516 nti 24 constraint (none) extremes [1, infinity) - hits 105/18348 nti 6 constraint DS = {6} extremes [3, infinity) + hits 105/18348 nti 7 constraint DS = {7} extremes [3, infinity) English: of {...} - (hits 105/1396) (matched long text) constraint DS = {6} extremes [3, infinity) + (hits 105/1437) (matched long text) constraint DS = {7} extremes [3, infinity) internal hits 490/18348 nti 25 constraint (none) extremes [1, infinity) internal hits 474/18054 nti 26 constraint (none) extremes [1, infinity) - hits 139/3344 nti 25 constraint DS = {25} extremes [2, infinity) + hits 139/2070 nti 26 constraint DS = {26} extremes [2, infinity) English: entry - (hits 135/1672) (matched: 'a final response rule entry') constraint DS = {25} extremes [2, infinity) + (hits 135/1035) (matched: 'a final response rule entry') constraint DS = {26} extremes [2, infinity) in row of - (hits 0/418) constraint DS = {25} extremes [6, infinity) + (hits 0/337) constraint DS = {26} extremes [6, infinity) listed in - (hits 2/1256) (matched: 'a topic listed in source') constraint DS = {25} extremes [4, infinity) + (hits 2/787) (matched: 'a topic listed in source') constraint DS = {26} extremes [4, infinity) corresponding to of in - (hits 0/192) constraint DS = {25} extremes [8, infinity) + (hits 0/161) constraint DS = {26} extremes [8, infinity) of in - (hits 2/654) (matched long text) constraint DS = {25} extremes [5, infinity) + (hits 2/555) (matched long text) constraint DS = {26} extremes [5, infinity) internal hits 3/19876 nti 27 constraint (none) extremes [1, infinity) hits 1074/2238 nti 28 constraint (none) extremes [3, infinity) English: - (hits 0/188) constraint DS = {19} extremes [3, infinity) + (hits 0/221) constraint DS = {19} extremes [3, infinity) (hits 1074/1108) (matched long text) constraint (none) extremes [3, infinity) @@ -7240,39 +7245,39 @@ hits 2149/6658 nti 30 constraint (none) extremes [2, infinity) English: - (hits 0/347) constraint DS = {28} & FS = {9} extremes [4, infinity) + (hits 0/914) constraint DS = {29} & FS = {9} extremes [4, infinity) - (hits 224/1730) (matched long text) constraint DS = {14} & FS = {6} extremes [3, infinity) + (hits 224/1741) (matched long text) constraint DS = {14} & FS = {6} extremes [3, infinity) - (hits 1925/2188) (matched long text) constraint FS = {6} extremes [2, infinity) + (hits 1925/2191) (matched long text) constraint FS = {6} extremes [2, infinity) - nti 28 constraint DS = {28} extremes [3, infinity) + nti 29 constraint DS = {29} extremes [3, infinity) English: to - constraint DS = {28} extremes [3, infinity) + constraint DS = {29} extremes [3, infinity) hits 260/9966 nti 31 constraint (none) extremes [3, infinity) English: (hits 169/4202) (matched long text) constraint DS = {13} extremes [3, infinity) - (hits 91/2792) (matched long text) constraint DS = {30} extremes [4, infinity) + (hits 91/2784) (matched long text) constraint DS = {30} extremes [4, infinity) - hits 448/30774 nti 27 constraint DS = {13} extremes [2, infinity) + hits 448/30774 nti 28 constraint DS = {13} extremes [2, infinity) English: (hits 447/9324) (matched long text) constraint DS = {13} extremes [2, infinity) not - (hits 1/5350) (matched: 'not carried by the person asked') constraint DS = {13, 27} extremes [3, infinity) + (hits 1/5290) (matched: 'not carried by the person asked') constraint DS = {13, 28} extremes [3, infinity) - hits 183/23866 nti 6 constraint DS = {30} extremes [3, infinity) + hits 183/23818 nti 6 constraint DS = {30} extremes [3, infinity) English: - (hits 0/1925) constraint DS = {28, 30} extremes [5, infinity) + (hits 0/2296) constraint DS = {29, 30} extremes [5, infinity) - (hits 32/3693) (matched long text) constraint DS = {14, 30} extremes [4, infinity) + (hits 32/3734) (matched long text) constraint DS = {14, 30} extremes [4, infinity) - (hits 151/5984) (matched: 'which provide the property initial appearance') constraint DS = {30} extremes [3, infinity) + (hits 151/5975) (matched: 'which provide the property initial appearance') constraint DS = {30} extremes [3, infinity) internal hits 791/18290 nti 7 constraint (none) extremes [1, infinity) @@ -7296,10 +7301,10 @@ ^ (hits 552/849) (matched long text) constraint (none) extremes [1, infinity) - hits 2/496 nti 7 constraint (none) extremes [1, infinity) + hits 2/496 nti 8 constraint (none) extremes [1, infinity) English: ( ) - (hits 0/6) constraint DS = {7} extremes [3, infinity) + (hits 0/18) constraint DS = {8} extremes [3, infinity) constraint CS = {r0} extremes [1, 1] @@ -7314,18 +7319,18 @@ (hits 2/248) (matched: 'switched off') constraint (none) extremes [1, infinity) - hits 1325/3170 nti 16 constraint (none) extremes [0, infinity) + hits 1325/3170 nti 17 constraint (none) extremes [0, infinity) English: ( ) - (hits 0/1313) constraint DS = {16} extremes [3, infinity) + (hits 0/1287) constraint DS = {17} extremes [3, infinity) , and - (hits 0/1207) constraint DS = {16} extremes [4, infinity) + (hits 0/1174) constraint DS = {17} extremes [4, infinity) and - (hits 97/1313) (matched long text) constraint DS = {16} extremes [3, infinity) + (hits 97/1287) (matched long text) constraint DS = {17} extremes [3, infinity) , or - (hits 0/1110) constraint DS = {16} extremes [4, infinity) + (hits 0/1077) constraint DS = {17} extremes [4, infinity) or - (hits 31/1216) (matched long text) constraint DS = {16} extremes [3, infinity) + (hits 31/1190) (matched long text) constraint DS = {17} extremes [3, infinity) (hits 0/1457) constraint (none) extremes [1, infinity) @@ -7333,49 +7338,49 @@ internal hits 0/2914 nti 12 constraint (none) extremes [1, infinity) - hits 1197/2914 nti 15 constraint (none) extremes [0, infinity) + hits 1197/2914 nti 16 constraint (none) extremes [0, infinity) English: (hits 1/1457) (matched: 'continuing') constraint (none) extremes [1, infinity) not - (hits 0/609) constraint DS = {15} extremes [2, infinity) + (hits 0/1187) constraint DS = {16} extremes [2, infinity) (hits 83/1456) (matched long text) constraint (none) extremes [1, infinity) - (hits 0/1107) constraint DS = {10} extremes [3, infinity) + (hits 0/1119) constraint DS = {11} extremes [3, infinity) - (hits 0/1002) constraint DS = {11} extremes [4, infinity) + (hits 0/1001) constraint DS = {12} extremes [4, infinity) (hits 28/1373) (matched long text) constraint (none) extremes [1, infinity) - (hits 0/1094) constraint DS = {13} extremes [2, infinity) + (hits 0/954) constraint DS = {14} extremes [2, infinity) (hits 1074/1119) (matched long text) constraint (none) extremes [3, infinity) (hits 11/271) (matched long text) constraint (none) extremes [0, infinity) - hits 83/2912 nti 9 constraint (none) extremes [1, infinity) + hits 83/2912 nti 10 constraint (none) extremes [1, infinity) English: - (hits 0/198) constraint DS = {8, 19} extremes [3, infinity) + (hits 0/231) constraint DS = {9, 19} extremes [3, infinity) (hits 83/1445) (matched long text) constraint (none) extremes [1, infinity) not - (hits 0/1090) constraint DS = {9} extremes [2, infinity) + (hits 0/1094) constraint DS = {10} extremes [2, infinity) - hits 11/542 nti 14 constraint (none) extremes [0, infinity) + hits 11/542 nti 15 constraint (none) extremes [0, infinity) English: ^ (hits 0/11) constraint (none) extremes [0, infinity) (hits 11/11) (matched long text) constraint (none) extremes [1, infinity) not - constraint DS = {14} extremes [2, infinity) + constraint DS = {15} extremes [2, infinity) - hits 22/960 nti 8 constraint DS = {8, 19} extremes [3, infinity) + hits 22/1026 nti 9 constraint DS = {9, 19} extremes [3, infinity) English: is/are {...} - (hits 22/220) (matched long text) constraint DS = {8, 19} extremes [3, infinity) + (hits 22/253) (matched long text) constraint DS = {9, 19} extremes [3, infinity) internal hits 94/2912 nti 13 constraint (none) extremes [1, infinity) @@ -7386,49 +7391,49 @@ (hits 28/1373) (matched long text) constraint (none) extremes [1, infinity) - hits 0/2188 nti 16 constraint DS = {13} extremes [2, infinity) + hits 0/1908 nti 16 constraint DS = {14} extremes [2, infinity) English: - (hits 0/1094) constraint DS = {13} extremes [2, infinity) + (hits 0/954) constraint DS = {14} extremes [2, infinity) - hits 0/2214 nti 17 constraint DS = {10} extremes [3, infinity) + hits 0/2238 nti 17 constraint DS = {11} extremes [3, infinity) English: - (hits 0/1107) constraint DS = {10} extremes [3, infinity) + (hits 0/1119) constraint DS = {11} extremes [3, infinity) - hits 0/2004 nti 18 constraint DS = {11} extremes [4, infinity) + hits 0/2002 nti 18 constraint DS = {12} extremes [4, infinity) English: - (hits 0/1002) constraint DS = {11} extremes [4, infinity) + (hits 0/1001) constraint DS = {12} extremes [4, infinity) - hits 1374/2748 nti 17 constraint (none) extremes [1, infinity) + hits 1374/2748 nti 18 constraint (none) extremes [1, infinity) English: ( ) - (hits 0/944) constraint DS = {17} extremes [3, infinity) + (hits 0/710) constraint DS = {18} extremes [3, infinity) (hits 1374/1374) (matched long text) constraint (none) extremes [1, infinity) - hits 2627/5254 nti 19 constraint (none) extremes [1, infinity) + hits 2627/5254 nti 20 constraint (none) extremes [1, infinity) English: ( ) - (hits 0/318) constraint DS = {19} extremes [3, infinity) + (hits 0/509) constraint DS = {20} extremes [3, infinity) (hits 239/2627) (matched: 'might not appreciate') constraint (none) extremes [1, infinity) (hits 2388/2388) (matched long text) constraint (none) extremes [1, infinity) - hits 239/5254 nti 18 constraint (none) extremes [1, infinity) + hits 239/5254 nti 19 constraint (none) extremes [1, infinity) English: (hits 0/2581) constraint (none) extremes [1, infinity) verb - (hits 0/449) constraint DS = {18} extremes [2, infinity) + (hits 0/330) constraint DS = {19} extremes [2, infinity) adjective - (hits 0/449) constraint DS = {18} extremes [2, infinity) + (hits 0/330) constraint DS = {19} extremes [2, infinity) (hits 210/2581) (matched: 'do not fit') constraint (none) extremes [1, infinity) verb - (hits 0/400) constraint DS = {18} extremes [3, infinity) + (hits 0/321) constraint DS = {19} extremes [3, infinity) (hits 29/855) (matched: 'might not appreciate') constraint (none) extremes [2, infinity) @@ -7438,77 +7443,77 @@ internal hits 2388/4776 nti 20 constraint (none) extremes [1, infinity) - nti 20 constraint CS = {20} extremes [1, 1] + nti 21 constraint CS = {21} extremes [1, 1] English: continue - constraint CS = {20} extremes [1, 1] + constraint CS = {21} extremes [1, 1] - nti 21 constraint (none) extremes [1, infinity) + nti 22 constraint (none) extremes [1, infinity) English: a list of {...} - constraint DS = {21} extremes [4, infinity) + constraint DS = {22} extremes [4, infinity) {...} constraint (none) extremes [1, infinity) nti 21 constraint (none) extremes [1, infinity) English: - constraint DS = {23} extremes [3, infinity) + constraint DS = {24} extremes [3, infinity) constraint (none) extremes [1, infinity) - nti 23 constraint DS = {23} extremes [2, infinity) + nti 24 constraint DS = {24} extremes [2, infinity) English: , and/or - constraint DS = {23} extremes [3, infinity) + constraint DS = {24} extremes [3, infinity) ,/and/or - constraint DS = {23} extremes [2, infinity) + constraint DS = {24} extremes [2, infinity) - nti 22 constraint (none) extremes [1, infinity) + nti 23 constraint (none) extremes [1, infinity) English: constraint (none) extremes [1, infinity) constraint (none) extremes [1, infinity) {...} begins/ends - constraint DS = {22} extremes [2, infinity) + constraint DS = {23} extremes [2, infinity) when/while {***} - constraint DS = {22} extremes [1, infinity) + constraint DS = {23} extremes [1, infinity) {...} constraint (none) extremes [1, infinity) - nti 24 constraint (none) extremes [1, infinity) + nti 25 constraint (none) extremes [1, infinity) English: say {...} - constraint DS = {24} extremes [2, infinity) + constraint DS = {25} extremes [2, infinity) {...} and/or {...} - constraint DS = {24} extremes [3, infinity) + constraint DS = {25} extremes [3, infinity) {...} constraint (none) extremes [1, infinity) - nti 25 constraint (none) extremes [1, infinity) + nti 26 constraint (none) extremes [1, infinity) English: , {...} - constraint DS = {25} extremes [2, infinity) + constraint DS = {26} extremes [2, infinity) unicode {...} - constraint DS = {25} extremes [2, infinity) + constraint DS = {26} extremes [2, infinity) {...} condition - constraint DS = {25} extremes [2, infinity) + constraint DS = {26} extremes [2, infinity) otherwise/else {***} - constraint DS = {25} extremes [1, infinity) + constraint DS = {26} extremes [1, infinity) {...} constraint (none) extremes [1, infinity) - nti 26 constraint (none) extremes [1, infinity) + nti 27 constraint (none) extremes [1, infinity) English: turns - constraint CS = {26} extremes [1, 1] + constraint CS = {27} extremes [1, 1] {...} is/are out of play - constraint DS = {26} extremes [5, infinity) + constraint DS = {27} extremes [5, infinity) unicode {...} - constraint DS = {26} extremes [2, infinity) + constraint DS = {27} extremes [2, infinity) {...} condition - constraint DS = {26} extremes [2, infinity) + constraint DS = {27} extremes [2, infinity) {...} constraint (none) extremes [1, infinity) @@ -7519,30 +7524,30 @@ {...} constraint (none) extremes [1, infinity) - nti 27 constraint (none) extremes [1, infinity) + nti 28 constraint (none) extremes [1, infinity) English: {...} of - constraint DS = {27} extremes [2, infinity) + constraint DS = {28} extremes [2, infinity) {...} for - constraint DS = {27} extremes [2, infinity) + constraint DS = {28} extremes [2, infinity) {...} constraint (none) extremes [1, infinity) - hits 4/292 nti 28 constraint CS = {28} extremes [1, 3] + hits 4/292 nti 29 constraint CS = {29} extremes [1, 3] English: description - (hits 1/2) (matched: 'description') constraint CS = {28} extremes [1, 1] + (hits 1/2) (matched: 'description') constraint CS = {29} extremes [1, 1] specification - (hits 1/1) (matched: 'specification') constraint CS = {28} extremes [1, 1] + (hits 1/1) (matched: 'specification') constraint CS = {29} extremes [1, 1] indefinite appearance text - (hits 1/2) (matched: 'indefinite appearance text') constraint CS = {28} extremes [3, 3] + (hits 1/2) (matched: 'indefinite appearance text') constraint CS = {29} extremes [3, 3] variable initial value - (hits 1/1) (matched: 'variable initial value') constraint CS = {28} extremes [3, 3] + (hits 1/1) (matched: 'variable initial value') constraint CS = {29} extremes [3, 3] - hits 34/68 nti 19 constraint DS = {19} extremes [2, infinity) + hits 34/516 nti 20 constraint DS = {20} extremes [2, infinity) English: property {...} - (hits 34/34) (matched: 'property initial appearance') constraint DS = {19} extremes [2, infinity) + (hits 34/212) (matched: 'property initial appearance') constraint DS = {20} extremes [2, infinity) internal hits 69/430 nti 23 constraint (none) extremes [1, infinity) @@ -7552,46 +7557,41 @@ internal hits 104/392 nti 26 constraint (none) extremes [1, infinity) - hits 0/292 nti 29 constraint DS = {29} extremes [1, infinity) + hits 0/292 nti 30 constraint DS = {30} extremes [1, infinity) English: {***} of {***} - (hits 0/3) constraint DS = {29} extremes [1, infinity) + (hits 0/8) constraint DS = {30} extremes [1, infinity) internal nti 27 constraint (none) extremes [1, infinity) - hits 40/176 nti 28 constraint DW = {6, 30, 31} extremes [2, infinity) + hits 40/176 nti 28 constraint DW = {6, 7, 31} extremes [2, infinity) English: - (hits 26/26) (matched: 'unlocking keylessly action') constraint DS = {30} extremes [2, infinity) + (hits 26/40) (matched: 'unlocking keylessly action') constraint DS = {31} extremes [2, infinity) - (hits 0/14) constraint DS = {31} extremes [2, infinity) + (hits 0/14) constraint DS = {6} extremes [2, infinity) - (hits 14/14) (matched: 'specific action-processing rulebook') constraint DS = {6} extremes [2, infinity) + (hits 14/16) (matched: 'specific action-processing rulebook') constraint DS = {7} extremes [2, infinity) - hits 26/52 nti 30 constraint DS = {30} extremes [2, infinity) + hits 26/80 nti 31 constraint DS = {31} extremes [2, infinity) English: {...} action - (hits 26/26) (matched: 'unlocking keylessly action') constraint DS = {30} extremes [2, infinity) + (hits 26/40) (matched: 'unlocking keylessly action') constraint DS = {31} extremes [2, infinity) - hits 0/28 nti 31 constraint DS = {31} extremes [2, infinity) + hits 0/28 nti 6 constraint DS = {6} extremes [2, infinity) English: {...} activity - (hits 0/14) constraint DS = {31} extremes [2, infinity) - - nti 7 constraint DS = {7} extremes [2, infinity) - English: - {...} relation - constraint DS = {7} extremes [2, infinity) + (hits 0/14) constraint DS = {6} extremes [2, infinity) hits 1191/2382 nti 8 constraint DS = {8} extremes [2, infinity) English: {...} rule (hits 1191/1191) (matched long text) constraint DS = {8} extremes [2, infinity) - hits 21/42 nti 6 constraint DS = {6} extremes [2, infinity) + hits 21/46 nti 7 constraint DS = {7} extremes [2, infinity) English: {...} rulebook - (hits 21/21) (matched: 'specific action-processing rulebook') constraint DS = {6} extremes [2, infinity) + (hits 21/23) (matched: 'specific action-processing rulebook') constraint DS = {7} extremes [2, infinity) hits 24/48 nti 29 constraint (none) extremes [1, infinity) English: @@ -7657,12 +7657,12 @@ {...} constraint (none) extremes [1, infinity) - hits 0/3136 nti 28 constraint DS = {28} extremes [2, infinity) + hits 0/3954 nti 28 constraint DS = {28} extremes [2, infinity) English: { } - (hits 0/3) constraint CS = {28} extremes [2, 2] + constraint CS = {28} extremes [2, 2] { } - (hits 0/1245) constraint DS = {28} extremes [3, infinity) + (hits 0/1445) constraint DS = {28} extremes [3, infinity) nti 27 constraint (none) extremes [1, infinity) English: @@ -7879,13 +7879,13 @@ (hits 0/418) constraint (none) extremes [2, infinity) rules/rulebook - (hits 24/140) (matched: 'does the player mean rules') constraint DS = {31} extremes [2, infinity) + (hits 24/148) (matched: 'does the player mean rules') constraint DS = {31} extremes [2, infinity) at {***} - (hits 0/116) constraint DS = {31} extremes [1, infinity) + (hits 0/124) constraint DS = {31} extremes [1, infinity) to {***} - (hits 0/116) constraint DS = {31} extremes [1, infinity) + (hits 0/124) constraint DS = {31} extremes [1, infinity) definition {***} - (hits 0/116) constraint DS = {31} extremes [1, infinity) + (hits 0/124) constraint DS = {31} extremes [1, infinity) {...} (hits 407/407) (matched long text) constraint (none) extremes [1, infinity) @@ -8035,9 +8035,9 @@ hits 35/70 nti 14 constraint (none) extremes [1, infinity) English: {...} of/for something/anything - (hits 14/34) (matched: 'printing the plural name of something') constraint DS = {14} extremes [3, infinity) + (hits 14/35) (matched: 'printing the plural name of something') constraint DS = {14} extremes [3, infinity) {...} something/anything - (hits 5/20) (matched: 'printing a locale paragraph about something') constraint DS = {14} extremes [2, infinity) + (hits 5/21) (matched: 'printing a locale paragraph about something') constraint DS = {14} extremes [2, infinity) {...} (hits 16/16) (matched: 'printing a refusal to act in the dark') constraint (none) extremes [1, infinity) @@ -8165,14 +8165,14 @@ hits 371/742 nti 29 constraint (none) extremes [1, infinity) English: during - (hits 0/317) constraint DS = {29} extremes [3, infinity) + (hits 0/321) constraint DS = {29} extremes [3, infinity) (hits 371/371) (matched long text) constraint (none) extremes [1, infinity) hits 371/742 nti 28 constraint (none) extremes [1, infinity) English: {} {when/while ...} - (hits 23/176) (matched long text) constraint DS = {28} extremes [3, infinity) + (hits 23/177) (matched long text) constraint DS = {28} extremes [3, infinity) {} (hits 348/348) (matched long text) constraint (none) extremes [1, infinity) {...} @@ -8356,9 +8356,9 @@ ( ) {***} (hits 579/1755) (matched long text) constraint DS = {18} extremes [3, infinity) ( {***} - (hits 0/1299) constraint DS = {18} extremes [1, infinity) + (hits 0/1298) constraint DS = {18} extremes [1, infinity) ) {***} - (hits 0/1299) constraint DS = {18} extremes [1, infinity) + (hits 0/1298) constraint DS = {18} extremes [1, infinity) {###} {***} (hits 1652/1652) (matched long text) constraint (none) extremes [1, infinity) @@ -8820,28 +8820,28 @@ hits 336/61212 nti 17 constraint DS = {17} extremes [1, infinity) English: _something/anything {***} - (hits 255/5735) (matched long text) constraint DS = {17} extremes [1, infinity) + (hits 255/5783) (matched long text) constraint DS = {17} extremes [1, infinity) _somewhere/anywhere {***} - (hits 0/5480) constraint DS = {17} extremes [1, infinity) + (hits 0/5528) constraint DS = {17} extremes [1, infinity) _someone/anyone/somebody/anybody {***} - (hits 57/5480) (matched: 'someone') constraint DS = {17} extremes [1, infinity) + (hits 57/5528) (matched: 'someone') constraint DS = {17} extremes [1, infinity) _everything {***} - (hits 0/5423) constraint DS = {17} extremes [1, infinity) + (hits 0/5471) constraint DS = {17} extremes [1, infinity) _everywhere {***} - (hits 0/5423) constraint DS = {17} extremes [1, infinity) + (hits 0/5471) constraint DS = {17} extremes [1, infinity) _everyone/everybody {***} - (hits 0/5423) constraint DS = {17} extremes [1, infinity) + (hits 0/5471) constraint DS = {17} extremes [1, infinity) _nowhere {***} - (hits 24/5423) (matched: 'nowhere') constraint DS = {17} extremes [1, infinity) + (hits 24/5471) (matched: 'nowhere') constraint DS = {17} extremes [1, infinity) _nobody/no-one {***} - (hits 0/5399) constraint DS = {17} extremes [1, infinity) + (hits 0/5447) constraint DS = {17} extremes [1, infinity) _no _one {***} - (hits 0/5200) constraint DS = {17} extremes [2, infinity) + (hits 0/5248) constraint DS = {17} extremes [2, infinity) hits 0/2166 nti 18 constraint CS = {18} extremes [1, 1] English: nowhere - (hits 0/64) constraint CS = {18} extremes [1, 1] + (hits 0/63) constraint CS = {18} extremes [1, 1] hits 1/334 nti 19 constraint CS = {19} extremes [1, 1] English: @@ -9167,14 +9167,14 @@ hits 90/1036 nti 26 constraint DS = {24} extremes [1, infinity) English: - (hits 90/330) (matched long text) constraint DS = {24} extremes [2, infinity) + (hits 90/331) (matched long text) constraint DS = {24} extremes [2, infinity) - (hits 0/243) constraint DS = {24} extremes [1, infinity) + (hits 0/244) constraint DS = {24} extremes [1, infinity) - hits 90/934 nti 24 constraint DS = {24} extremes [1, infinity) + hits 90/936 nti 24 constraint DS = {24} extremes [1, infinity) English: action - (hits 90/347) (matched long text) constraint DS = {24} extremes [1, infinity) + (hits 90/348) (matched long text) constraint DS = {24} extremes [1, infinity) action (hits 0/3) constraint CS = {24} extremes [1, 1] @@ -9186,9 +9186,9 @@ hits 1/182 nti 25 constraint DS = {25} extremes [1, infinity) English: {***} that/which vary/varies - (hits 1/91) (matched: 'name based rule producing nothing that varies') constraint DS = {25} extremes [2, infinity) + (hits 1/90) (matched: 'name based rule producing nothing that varies') constraint DS = {25} extremes [2, infinity) {***} variable - (hits 0/90) constraint DS = {25} extremes [1, infinity) + (hits 0/89) constraint DS = {25} extremes [1, infinity) hits 90/180 nti 28 constraint (none) extremes [1, infinity) English: @@ -9273,11 +9273,11 @@ hits 128/1002 nti 29 constraint DS = {28} extremes [1, infinity) English: , and - (hits 0/255) constraint DS = {28, 29} extremes [3, infinity) + (hits 0/302) constraint DS = {28, 29} extremes [3, infinity) and - (hits 19/276) (matched: 'applying to nothing or one thing and') constraint DS = {28, 29} extremes [2, infinity) + (hits 19/338) (matched: 'applying to nothing or one thing and') constraint DS = {28, 29} extremes [2, infinity) , - (hits 0/257) constraint DS = {28, 29} extremes [2, infinity) + (hits 0/319) constraint DS = {28, 29} extremes [2, infinity) (hits 109/347) (matched long text) constraint DS = {28} extremes [1, infinity) @@ -9324,35 +9324,35 @@ {...} (hits 326/326) (matched long text) constraint (none) extremes [1, infinity) - hits 12/4738 nti 30 constraint DS = {30} extremes [2, infinity) + hits 12/4710 nti 30 constraint DS = {30} extremes [2, infinity) English: fixed in place {***} - (hits 0/957) constraint DS = {30} extremes [3, infinity) + (hits 0/955) constraint DS = {30} extremes [3, infinity) is/are/was/were/been/listed in {***} - (hits 0/1396) constraint DS = {30} extremes [2, infinity) + (hits 0/1380) constraint DS = {30} extremes [2, infinity) in {...} - (hits 12/1396) (matched: 'in the public library') constraint DS = {30} extremes [2, infinity) + (hits 12/1380) (matched: 'in the public library') constraint DS = {30} extremes [2, infinity) hits 958/2310 nti 9 constraint (none) extremes [1, infinity) English: - (hits 0/306) constraint DS = {31} extremes [3, infinity) + (hits 0/315) constraint DS = {31} extremes [3, infinity) (hits 958/1155) (matched long text) constraint (none) extremes [1, infinity) - hits 0/2726 nti 31 constraint DS = {31} extremes [2, infinity) + hits 0/2770 nti 31 constraint DS = {31} extremes [2, infinity) English: , _or - (hits 0/688) constraint DS = {31} extremes [3, infinity) + (hits 0/694) constraint DS = {31} extremes [3, infinity) _,/or - (hits 0/881) constraint DS = {31} extremes [2, infinity) + (hits 0/900) constraint DS = {31} extremes [2, infinity) hits 958/2310 nti 10 constraint (none) extremes [1, infinity) English: (hits 0/1155) constraint (none) extremes [1, infinity) - (hits 0/457) constraint DS = {30} extremes [3, infinity) + (hits 0/451) constraint DS = {30} extremes [3, infinity) (hits 958/1155) (matched long text) constraint (none) extremes [1, infinity) @@ -9363,89 +9363,89 @@ hits 556/21224 nti 9 constraint (none) extremes [1, infinity) English: asking to try - (hits 0/964) constraint DS = {9} extremes [5, infinity) + (hits 0/962) constraint DS = {9} extremes [5, infinity) trying - (hits 23/2100) (matched long text) constraint DS = {9} extremes [3, infinity) + (hits 23/2096) (matched long text) constraint DS = {9} extremes [3, infinity) an actor trying - (hits 0/1625) constraint DS = {9} extremes [4, infinity) + (hits 0/1623) constraint DS = {9} extremes [4, infinity) an actor - (hits 408/2077) (matched long text) constraint DS = {9} extremes [3, infinity) + (hits 408/2073) (matched long text) constraint DS = {9} extremes [3, infinity) trying - (hits 0/2095) constraint DS = {9} extremes [2, infinity) + (hits 0/2091) constraint DS = {9} extremes [2, infinity) (hits 125/10181) (matched long text) constraint (none) extremes [1, infinity) - hits 28/2746 nti 12 constraint (none) extremes [1, infinity) + hits 28/2746 nti 13 constraint (none) extremes [1, infinity) English: we are asking to try - (hits 0/231) constraint DS = {12} extremes [7, infinity) + (hits 0/231) constraint DS = {13} extremes [7, infinity) asking to try - (hits 0/623) constraint DS = {12} extremes [5, infinity) + (hits 0/623) constraint DS = {13} extremes [5, infinity) trying - (hits 0/1095) constraint DS = {12} extremes [3, infinity) + (hits 0/1097) constraint DS = {13} extremes [3, infinity) an actor trying - (hits 0/1000) constraint DS = {12} extremes [4, infinity) + (hits 0/1001) constraint DS = {13} extremes [4, infinity) an actor - (hits 3/1095) (matched: 'an actor smelling') constraint DS = {12} extremes [3, infinity) + (hits 3/1097) (matched: 'an actor smelling') constraint DS = {13} extremes [3, infinity) we are trying - (hits 0/1000) constraint DS = {12} extremes [4, infinity) + (hits 0/1001) constraint DS = {13} extremes [4, infinity) trying - (hits 0/1098) constraint DS = {12} extremes [2, infinity) + (hits 0/1100) constraint DS = {13} extremes [2, infinity) we are - (hits 0/1092) constraint DS = {12} extremes [3, infinity) + (hits 0/1094) constraint DS = {13} extremes [3, infinity) (hits 25/1370) (matched long text) constraint (none) extremes [1, infinity) - hits 0/2188 nti 13 constraint DS = {13} extremes [2, infinity) + hits 0/1908 nti 14 constraint DS = {14} extremes [2, infinity) English: we are not asking to try - (hits 0/135) constraint DS = {13} extremes [8, infinity) + (hits 0/135) constraint DS = {14} extremes [8, infinity) not asking to try - (hits 0/403) constraint DS = {13} extremes [6, infinity) + (hits 0/401) constraint DS = {14} extremes [6, infinity) not trying - (hits 0/1000) constraint DS = {13} extremes [4, infinity) + (hits 0/936) constraint DS = {14} extremes [4, infinity) an actor not trying - (hits 0/622) constraint DS = {13} extremes [5, infinity) + (hits 0/593) constraint DS = {14} extremes [5, infinity) an actor not - (hits 0/1000) constraint DS = {13} extremes [4, infinity) + (hits 0/936) constraint DS = {14} extremes [4, infinity) we are not trying - (hits 0/622) constraint DS = {13} extremes [5, infinity) + (hits 0/593) constraint DS = {14} extremes [5, infinity) not trying - (hits 0/1093) constraint DS = {13} extremes [3, infinity) + (hits 0/953) constraint DS = {14} extremes [3, infinity) we are not - (hits 0/1000) constraint DS = {13} extremes [4, infinity) + (hits 0/936) constraint DS = {14} extremes [4, infinity) not - (hits 0/1094) constraint DS = {13} extremes [2, infinity) + (hits 0/954) constraint DS = {14} extremes [2, infinity) - hits 0/2214 nti 10 constraint DS = {10} extremes [3, infinity) + hits 0/2238 nti 11 constraint DS = {11} extremes [3, infinity) English: we have asked to try - (hits 0/231) constraint DS = {10} extremes [7, infinity) + (hits 0/231) constraint DS = {11} extremes [7, infinity) has tried - (hits 0/998) constraint DS = {10} extremes [4, infinity) + (hits 0/1002) constraint DS = {11} extremes [4, infinity) an actor has tried - (hits 0/623) constraint DS = {10} extremes [5, infinity) + (hits 0/627) constraint DS = {11} extremes [5, infinity) an actor has - (hits 0/998) constraint DS = {10} extremes [4, infinity) + (hits 0/1002) constraint DS = {11} extremes [4, infinity) we have tried - (hits 0/998) constraint DS = {10} extremes [4, infinity) + (hits 0/1002) constraint DS = {11} extremes [4, infinity) we have - (hits 0/1107) constraint DS = {10} extremes [3, infinity) + (hits 0/1119) constraint DS = {11} extremes [3, infinity) - hits 0/2004 nti 11 constraint DS = {11} extremes [4, infinity) + hits 0/2002 nti 12 constraint DS = {12} extremes [4, infinity) English: we have not asked to try - (hits 0/136) constraint DS = {11} extremes [8, infinity) + (hits 0/136) constraint DS = {12} extremes [8, infinity) has not tried - (hits 0/627) constraint DS = {11} extremes [5, infinity) + (hits 0/623) constraint DS = {12} extremes [5, infinity) an actor has not tried - (hits 0/404) constraint DS = {11} extremes [6, infinity) + (hits 0/404) constraint DS = {12} extremes [6, infinity) an actor has not - (hits 0/627) constraint DS = {11} extremes [5, infinity) + (hits 0/623) constraint DS = {12} extremes [5, infinity) we have not tried - (hits 0/627) constraint DS = {11} extremes [5, infinity) + (hits 0/623) constraint DS = {12} extremes [5, infinity) we have not - (hits 0/1002) constraint DS = {11} extremes [4, infinity) + (hits 0/1001) constraint DS = {12} extremes [4, infinity) hits 150/23102 nti 13 constraint (none) extremes [1, infinity) English: @@ -9566,28 +9566,28 @@ {...} (hits 383/383) (matched: '"n"') constraint (none) extremes [1, infinity) - hits 32/478 nti 23 constraint (none) extremes [1, infinity) + hits 70/554 nti 23 constraint (none) extremes [1, infinity) English: {...} - (hits 31/239) (matched long text) constraint (none) extremes [1, infinity) + (hits 69/277) (matched long text) constraint (none) extremes [1, infinity) - (hits 0/8) constraint DS = {17, 18} extremes [4, infinity) + (hits 0/32) constraint DS = {17, 18} extremes [4, infinity) - (hits 1/9) (matched: 'the infection color property') constraint DS = {17} extremes [2, infinity) + (hits 1/52) (matched: 'the infection color property') constraint DS = {17} extremes [2, infinity) - hits 31/156 nti 18 constraint DS = {18} extremes [2, infinity) + hits 69/372 nti 18 constraint DS = {18} extremes [2, infinity) English: , _and/or - (hits 0/62) constraint DS = {18} extremes [3, infinity) + (hits 0/122) constraint DS = {18} extremes [3, infinity) _,/and/or - (hits 31/70) (matched long text) constraint DS = {18} extremes [2, infinity) + (hits 69/154) (matched long text) constraint DS = {18} extremes [2, infinity) - hits 1/80 nti 17 constraint DS = {17} extremes [2, infinity) + hits 1/242 nti 17 constraint DS = {17} extremes [2, infinity) English: property - (hits 1/32) (matched: 'the infection color property') constraint DS = {17} extremes [2, infinity) + (hits 1/89) (matched: 'the infection color property') constraint DS = {17} extremes [2, infinity) {...} property - (hits 0/31) constraint DS = {17} extremes [2, infinity) + (hits 0/88) constraint DS = {17} extremes [2, infinity) hits 167/334 nti 23 constraint (none) extremes [1, infinity) English: @@ -9688,7 +9688,7 @@ hits 22/186 nti 27 constraint DS = {27} extremes [1, infinity) English: understood - (hits 16/27) (matched: 'command parser error understood') constraint DS = {27} extremes [2, infinity) + (hits 16/31) (matched: 'command parser error understood') constraint DS = {27} extremes [2, infinity) noun (hits 1/4) (matched: 'noun') constraint CS = {27} extremes [1, 1] location @@ -9791,14 +9791,14 @@ hits 1/4 nti 30 constraint DS = {31} extremes [2, infinity) English: - (hits 1/1) (matched: 'the file of cover art ( The cover art. )') constraint DS = {31} extremes [3, infinity) + (hits 1/2) (matched: 'the file of cover art ( The cover art. )') constraint DS = {31} extremes [3, infinity) - constraint DS = {31} extremes [2, infinity) + (hits 0/1) constraint DS = {31} extremes [2, infinity) - hits 1/2 nti 31 constraint DS = {31} extremes [2, infinity) + hits 1/4 nti 31 constraint DS = {31} extremes [2, infinity) English: file - (hits 1/1) (matched: 'file of cover art ( The cover art. )') constraint DS = {31} extremes [2, infinity) + (hits 1/2) (matched: 'file of cover art ( The cover art. )') constraint DS = {31} extremes [2, infinity) hits 2/690 nti 6 constraint DS = {6} extremes [2, infinity) English: @@ -9866,14 +9866,14 @@ binary (hits 0/268) constraint DS = {14, 15} extremes [3, infinity) - (hits 0/436) constraint DS = {14} extremes [2, infinity) + (hits 0/443) constraint DS = {14} extremes [2, infinity) - hits 0/872 nti 14 constraint DS = {14} extremes [2, infinity) + hits 0/886 nti 14 constraint DS = {14} extremes [2, infinity) English: {file ...} ( owned by ) (hits 0/77) constraint DS = {14} extremes [7, infinity) {file ...} - (hits 0/436) constraint DS = {14} extremes [2, infinity) + (hits 0/443) constraint DS = {14} extremes [2, infinity) nti 13 constraint (none) extremes [1, infinity) English: @@ -9911,9 +9911,9 @@ hits 447/2552 nti 17 constraint DS = {16, 17} extremes [6, infinity) English: {...} ( ) - (hits 424/870) (matched long text) constraint DS = {16, 17} extremes [6, infinity) + (hits 424/871) (matched long text) constraint DS = {16, 17} extremes [6, infinity) {...} -- -- - (hits 23/446) (matched long text) constraint DS = {16, 17} extremes [6, infinity) + (hits 23/447) (matched long text) constraint DS = {16, 17} extremes [6, infinity) hits 480/1188 nti 16 constraint DS = {16} extremes [3, 3] English: diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt index 5fa646ae9..cef1da87c 100644 --- a/inform7/Figures/memory-diagnostics.txt +++ b/inform7/Figures/memory-diagnostics.txt @@ -1,13 +1,13 @@ -Total memory consumption was 257143K = 251 MB +Total memory consumption was 256343K = 250 MB -62.5% was used for 1330234 objects, in 273429 frames in 201 x 800K = 160800K = 157 MB: +62.4% was used for 1330234 objects, in 273429 frames in 200 x 800K = 160000K = 156 MB: 9.8% inter_tree_node_array 36 x 8192 = 294912 objects, 25953408 bytes - 5.4% text_stream_array 2567 x 100 = 256700 objects, 14457344 bytes + 5.5% text_stream_array 2567 x 100 = 256700 objects, 14457344 bytes 3.9% parse_node 129994 objects, 10399520 bytes 2.8% verb_conjugation 160 objects, 7425280 bytes 2.6% parse_node_annotation_array 431 x 500 = 215500 objects, 6909792 bytes - 2.3% inter_symbol_array 70 x 1024 = 71680 objects, 6310080 bytes + 2.4% inter_symbol_array 70 x 1024 = 71680 objects, 6310080 bytes 1.8% linked_list 8904 objects, 4986240 bytes 1.3% pcalc_prop_array 24 x 1000 = 24000 objects, 3648768 bytes 1.2% map_data 668 objects, 3168992 bytes @@ -39,7 +39,7 @@ Total memory consumption was 257143K = 251 MB 0.1% scan_directory 70 objects, 288960 bytes 0.1% noun 2379 objects, 285480 bytes ---- action_name_list_array 3 x 1000 = 3000 objects, 240096 bytes - ---- binary_predicate 321 objects, 200304 bytes + ---- binary_predicate 321 objects, 197736 bytes ---- inter_annotation_array 1 x 8192 objects, 196640 bytes ---- inference 1703 objects, 177112 bytes ---- linked_list_item_array 10 x 1000 = 10000 objects, 160320 bytes @@ -111,23 +111,23 @@ Total memory consumption was 257143K = 251 MB ---- parsing_pp_data 96 objects, 4608 bytes ---- build_vertex 40 objects, 4480 bytes ---- hierarchy_attachment_point 48 objects, 4224 bytes - ---- placement_affecting_array 1 x 100 objects, 4032 bytes ---- stacked_variable_list_array 1 x 100 objects, 4032 bytes + ---- placement_affecting_array 1 x 100 objects, 4032 bytes ---- activity 35 objects, 3920 bytes ---- inbuild_edition 54 objects, 3888 bytes ---- parse_node_annotation_type 121 objects, 3872 bytes ---- inbuild_copy 35 objects, 3640 bytes ---- command_line_switch 43 objects, 3440 bytes - ---- instance_usage_array 1 x 200 objects, 3232 bytes ---- kind_constructor_comparison_schema_array 1 x 100 objects, 3232 bytes + ---- instance_usage_array 1 x 200 objects, 3232 bytes ---- compatibility_specification 66 objects, 3168 bytes ---- definition 44 objects, 3168 bytes ---- inform_extension 19 objects, 3040 bytes ---- property_of_value_storage 93 objects, 2976 bytes ---- submodule_request 72 objects, 2880 bytes ---- inter_construct 32 objects, 2560 bytes - ---- kind_constructor_casting_rule_array 1 x 100 objects, 2432 bytes ---- kind_constructor_instance_array 1 x 100 objects, 2432 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 67 objects, 2144 bytes @@ -142,15 +142,15 @@ Total memory consumption was 257143K = 251 MB ---- noun_filter_token 22 objects, 1408 bytes ---- scene 1 object, 1344 bytes ---- special_meaning_holder 33 objects, 1320 bytes - ---- constant_phrase 20 objects, 1280 bytes ---- build_script 40 objects, 1280 bytes + ---- constant_phrase 20 objects, 1280 bytes ---- invocation_options_array 1 x 100 objects, 1224 bytes ---- hierarchy_metadatum 15 objects, 1200 bytes ---- quantifier 16 objects, 1024 bytes ---- table_column 16 objects, 896 bytes ---- inbuild_requirement 22 objects, 880 bytes - ---- control_structure_phrase 12 objects, 864 bytes ---- code_generation 1 object, 864 bytes + ---- control_structure_phrase 12 objects, 864 bytes ---- cached_understanding 21 objects, 840 bytes ---- runtime_kind_structure 13 objects, 832 bytes ---- phrase_option_array 1 x 100 objects, 824 bytes @@ -166,15 +166,15 @@ Total memory consumption was 257143K = 251 MB ---- I6T_intervention 8 objects, 640 bytes ---- relation_guard 5 objects, 640 bytes ---- nascent_array 7 objects, 616 bytes - ---- inbuild_search_result 15 objects, 600 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 - ---- dval_written 10 objects, 400 bytes + ---- equation 4 objects, 416 bytes ---- module_package 10 objects, 400 bytes + ---- dval_written 10 objects, 400 bytes ---- article_usage 8 objects, 384 bytes ---- source_file 5 objects, 360 bytes ---- bp_family 11 objects, 352 bytes @@ -192,29 +192,29 @@ Total memory consumption was 257143K = 251 MB ---- kit_dependency 4 objects, 192 bytes ---- plural_dictionary_entry 4 objects, 192 bytes ---- inform_project 1 object, 176 bytes + ---- pointer_allocation 2 objects, 160 bytes ---- inter_architecture 4 objects, 160 bytes ---- code_generation_target 4 objects, 160 bytes - ---- pointer_allocation 2 objects, 160 bytes ---- link_instruction 4 objects, 160 bytes ---- element_activation 4 objects, 128 bytes ---- codegen_pipeline 1 object, 128 bytes ---- inbuild_nest 3 objects, 120 bytes ---- inform_kit_ittt 2 objects, 96 bytes + ---- compile_task_data 1 object, 80 bytes ---- article 2 objects, 80 bytes ---- list_together_routine 2 objects, 80 bytes - ---- compile_task_data 1 object, 80 bytes - ---- build_methodology 1 object, 56 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 ---- star_invention 1 object, 48 bytes - ---- blorb_figure 1 object, 48 bytes - ---- loop_over_scope 1 object, 40 bytes ---- kind_template_definition 1 object, 40 bytes + ---- loop_over_scope 1 object, 40 bytes ---- parse_name_notice 1 object, 40 bytes -37.4% was used for memory not allocated for objects: +37.5% was used for memory not allocated for objects: - 15.8% text stream storage 41840948 bytes in 263039 claims + 15.9% text stream storage 41840928 bytes in 263039 claims 3.5% dictionary storage 9265664 bytes in 16347 claims ---- sorting 1048 bytes in 3 claims 2.7% source text 7200000 bytes in 3 claims @@ -222,7 +222,7 @@ Total memory consumption was 257143K = 251 MB ---- linguistic stock array 81920 bytes in 2 claims ---- small word set array 105600 bytes in 22 claims 0.8% inter symbols storage 2277376 bytes in 13914 claims - 6.3% inter bytecode storage 16802820 bytes in 14 claims + 6.4% inter bytecode storage 16802820 bytes in 14 claims 3.3% inter links storage 8750208 bytes in 246 claims 0.5% instance-of-kind counting 1468944 bytes in 1 claim ---- lists for type-checking invocations 16000 bytes in 1 claim @@ -231,5 +231,5 @@ Total memory consumption was 257143K = 251 MB ---- emitter array storage 14368 bytes in 8 claims ---- code generation workspace for objects 9200 bytes in 9 claims -20.3% was overhead - 53603960 bytes = 52347K = 51 MB +20.1% was overhead - 52787328 bytes = 51550K = 50 MB diff --git a/inform7/Figures/preform-summary.txt b/inform7/Figures/preform-summary.txt index 3896175ff..92ce48d51 100644 --- a/inform7/Figures/preform-summary.txt +++ b/inform7/Figures/preform-summary.txt @@ -5,7 +5,7 @@ (@1)minus (@2)=1 (hits 0/1235) constraint DS = {6} extremes [2, 2] (@1)=1 (@2)( (@3)=2 (@4)) - (hits 273/815) (matched: '"[current item from the multiple object list]: [run paragraph on]" ( a )') constraint DS = {6} extremes [4, 4] + (hits 273/816) (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 and outdoor, which are not necessarily areas in a building. A player in one @@ -16,10 +16,10 @@ (@1)=1 (hits 78/103) (matched: 'false') constraint CS = {26} extremes [1, 1] =1 - (hits 0/1568) constraint DS = {28} extremes [2, infinity) + (hits 0/1977) constraint DS = {28} extremes [2, infinity) (@1)unicode =1 - (hits 0/3241) constraint DS = {6} extremes [2, infinity) + (hits 0/3243) constraint DS = {6} extremes [2, infinity) =1 - (hits 0/3563) constraint DW = {29, 30, 31} extremes [2, 5] + (hits 0/3567) constraint DW = {29, 30, 31} extremes [2, 5] =1 (hits 0/9820) constraint (none) extremes [1, infinity) diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt index ed92d5a12..e6d475cb3 100644 --- a/inform7/Figures/timings-diagnostics.txt +++ b/inform7/Figures/timings-diagnostics.txt @@ -1,12 +1,12 @@ 100.0% in inform7 run - 66.5% in compilation to Inter - 25.0% in //Phrases::Manager::compile_first_block// - 8.2% in //Phrases::Manager::compile_as_needed// - 7.0% in //Strings::compile_responses// - 6.4% in //World::Compile::compile// - 4.4% in //MajorNodes::pre_pass// - 3.4% in //MajorNodes::pass_1// - 1.9% in //Phrases::Manager::RulePrintingRule_routine// + 67.4% in compilation to Inter + 25.9% in //Phrases::Manager::compile_first_block// + 8.8% in //Phrases::Manager::compile_as_needed// + 6.9% in //Strings::compile_responses// + 6.2% in //World::Compile::compile// + 4.3% in //MajorNodes::pre_pass// + 3.3% in //MajorNodes::pass_1// + 2.0% in //Phrases::Manager::RulePrintingRule_routine// 1.9% in //Phrases::Manager::rulebooks_array// 1.0% in //VerbsAtRunTime::ConjugateVerb// 0.8% in //Phrases::Manager::traverse// @@ -19,9 +19,9 @@ 0.1% in //PL::Parsing::Verbs::compile_all// 0.1% in //Task::make_built_in_kind_constructors// 3.2% not specifically accounted for - 30.9% in running Inter pipeline - 9.8% in inter step 2/12: link - 9.7% in step preparation + 30.1% in running Inter pipeline + 9.9% in step preparation + 9.5% in inter step 2/12: link 7.1% 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 @@ -31,6 +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.5% not specifically accounted for - 2.1% in supervisor + 1.9% not specifically accounted for + 2.0% in supervisor 0.4% 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 472797e94..c60415d8f 100644 --- a/inform7/core-module/Chapter 1/Core Module.w +++ b/inform7/core-module/Chapter 1/Core Module.w @@ -33,7 +33,6 @@ which use this module: @e pcalc_prop_deferral_CLASS @e literal_pattern_CLASS @e generalisation_CLASS -@e i6_schema_CLASS @e list_together_routine_CLASS @e past_tense_condition_record_CLASS @e past_tense_action_record_CLASS @@ -86,6 +85,7 @@ which use this module: @e adjective_iname_holder_CLASS @e label_namespace_CLASS @e compile_task_data_CLASS +@e comparative_bp_data_CLASS @ Deep breath, then: the following macros define several hundred functions. @@ -148,6 +148,7 @@ DECLARE_CLASS(runtime_kind_structure) DECLARE_CLASS(adjective_iname_holder) DECLARE_CLASS(label_namespace) DECLARE_CLASS(compile_task_data) +DECLARE_CLASS(comparative_bp_data) @ So much for the managed structures: now for the unmanaged structures. @@ -155,7 +156,6 @@ DECLARE_CLASS(compile_task_data) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(activity_crossref, 100) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(activity_list, 1000) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(application, 100) -DECLARE_CLASS_ALLOCATED_IN_ARRAYS(i6_schema, 100) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(instance_usage, 200) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(invocation_options, 100) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(local_variable, 100) @@ -221,7 +221,6 @@ void CoreModule::start(void) { @; @; CorePreform::set_core_internal_NTIs(); - Calculus::Equality::start(); Calculus::QuasinumericRelations::start(); Properties::SameRelations::start(); Properties::SettingRelations::start(); @@ -229,6 +228,8 @@ void CoreModule::start(void) { Tables::Relations::start(); Properties::ProvisionRelation::start(); Relations::Universal::start(); + Relations::Explicit::start(); + EqualityDetails::start(); @; } void CoreModule::end(void) { @@ -603,15 +604,6 @@ MAKE_ANNOTATION_FUNCTIONS(token_check_to_do, parse_node) MAKE_ANNOTATION_FUNCTIONS(token_to_be_parsed_against, parse_node) MAKE_ANNOTATION_FUNCTIONS(vu, verb_usage) -@ We also have to make annotation functions for one special annotation needed -by //linguistics//: - -= (early code) -DECLARE_ANNOTATION_FUNCTIONS(relationship, binary_predicate) - -@ = -MAKE_ANNOTATION_FUNCTIONS(relationship, binary_predicate) - @ And we have declare all of those: @ = diff --git a/inform7/core-module/Chapter 11/Type Check Propositions.w b/inform7/core-module/Chapter 11/Type Check Propositions.w index beee6f7fa..8d35ab42e 100644 --- a/inform7/core-module/Chapter 11/Type Check Propositions.w +++ b/inform7/core-module/Chapter 11/Type Check Propositions.w @@ -21,17 +21,6 @@ typedef struct variable_type_assignment { struct kind *assigned_kinds[26]; /* one for each of the 26 variables */ } variable_type_assignment; -@ Another convenience is a sort of kit for preparing problem messages: - -= -typedef struct tc_problem_kit { - int issue_error; - struct wording ew_text; - char *intention; - int log_to_I6_text; - int flag_problem; -} tc_problem_kit; - @h Problem reporting kit. The caller to |Calculus::Propositions::Checker::type_check| has to fill this form out first. Paperwork, what can you do, eh? diff --git a/inform7/core-module/Chapter 12/Compile Atoms.w b/inform7/core-module/Chapter 12/Compile Atoms.w index d64195f56..9691f69e1 100644 --- a/inform7/core-module/Chapter 12/Compile Atoms.w +++ b/inform7/core-module/Chapter 12/Compile Atoms.w @@ -12,28 +12,6 @@ from those originally found in the atom, however, so we also need to keep track of that; and also of whether a condition is being regarded negatively. -= -typedef struct annotated_i6_schema { - struct i6_schema *schema; - int negate_schema; /* true if atom is to be tested with the opposite parity */ - struct pcalc_term pt0; /* terms on which the I6 schema is to be expanded */ - struct pcalc_term pt1; - int involves_action_variables; -} annotated_i6_schema; - -@ Some constants to enumerate the three cases of what we are to do. This -looks asymmetrical -- shouldn't we also test to see whether an atom is false, -a fourth case? - -The answer is that there's no need, since "test false" can be done by -compiling "test true" and applying the I7 negation operator |~~| to the -result. No similar trick can be used to combine making something -true or false into a single operation. - -@d TEST_ATOM_TASK 1 -@d NOW_ATOM_TRUE_TASK 2 -@d NOW_ATOM_FALSE_TASK 3 - @ For its internal purposes, Inform is sometimes able to compile atoms which wouldn't be allowed in a typical use of "now" from the source text; so it can suppress the following problem messages: diff --git a/inform7/core-module/Chapter 12/Quasinumeric Relations.w b/inform7/core-module/Chapter 12/Quasinumeric Relations.w index 3dd90868d..c204bcdac 100644 --- a/inform7/core-module/Chapter 12/Quasinumeric Relations.w +++ b/inform7/core-module/Chapter 12/Quasinumeric Relations.w @@ -46,22 +46,22 @@ void Calculus::QuasinumericRelations::stock(bp_family *self, int n) { R_numerically_greater_than = BinaryPredicates::make_pair(quasinumeric_bp_family, number_term, number_term, - I"greater-than", NULL, NULL, NULL, Calculus::Schemas::new("*1 > *2"), + I"greater-than", NULL, NULL, Calculus::Schemas::new("*1 > *2"), PreformUtilities::wording(, GT_RELATION_NAME)); R_numerically_less_than = BinaryPredicates::make_pair(quasinumeric_bp_family, number_term, number_term, - I"less-than", NULL, NULL, NULL, Calculus::Schemas::new("*1 < *2"), + I"less-than", NULL, NULL, Calculus::Schemas::new("*1 < *2"), PreformUtilities::wording(, LT_RELATION_NAME)); R_numerically_greater_than_or_equal_to = BinaryPredicates::make_pair(quasinumeric_bp_family, number_term, number_term, - I"at-least", NULL, NULL, NULL, Calculus::Schemas::new("*1 >= *2"), + I"at-least", NULL, NULL, Calculus::Schemas::new("*1 >= *2"), PreformUtilities::wording(, GE_RELATION_NAME)); R_numerically_less_than_or_equal_to = BinaryPredicates::make_pair(quasinumeric_bp_family, number_term, number_term, - I"at-most", NULL, NULL, NULL, Calculus::Schemas::new("*1 <= *2"), + I"at-most", NULL, NULL, Calculus::Schemas::new("*1 <= *2"), PreformUtilities::wording(, LE_RELATION_NAME)); BinaryPredicates::set_index_details(R_numerically_greater_than, "arithmetic value", "arithmetic value"); diff --git a/inform7/core-module/Chapter 12/The Equality Relation.w b/inform7/core-module/Chapter 12/The Equality Relation Revisited.w similarity index 78% rename from inform7/core-module/Chapter 12/The Equality Relation.w rename to inform7/core-module/Chapter 12/The Equality Relation Revisited.w index 692443093..17533ec6b 100644 --- a/inform7/core-module/Chapter 12/The Equality Relation.w +++ b/inform7/core-module/Chapter 12/The Equality Relation Revisited.w @@ -1,63 +1,14 @@ -[Calculus::Equality::] The Equality Relation. +[EqualityDetails::] The Equality Relation Revisited. -To define that prince among predicates, the equality relation. +To define how equality behaves in the Inform language. -@ This predicate expresses the meaning of $a=b$, and plays a very special role -in our calculus. - -= (early code) -bp_family *equality_bp_family = NULL; -bp_family *spatial_bp_family = NULL; - -binary_predicate *R_equality = NULL; -binary_predicate *a_has_b_predicate = NULL; - -@h Family. +@h Additional details. = -void Calculus::Equality::start(void) { - equality_bp_family = BinaryPredicateFamilies::new(); - METHOD_ADD(equality_bp_family, STOCK_BPF_MTID, Calculus::Equality::stock); - METHOD_ADD(equality_bp_family, TYPECHECK_BPF_MTID, Calculus::Equality::REL_typecheck); - METHOD_ADD(equality_bp_family, ASSERT_BPF_MTID, Calculus::Equality::REL_assert); - METHOD_ADD(equality_bp_family, SCHEMA_BPF_MTID, Calculus::Equality::REL_compile); - METHOD_ADD(equality_bp_family, DESCRIBE_FOR_PROBLEMS_BPF_MTID, Calculus::Equality::REL_describe_for_problems); - METHOD_ADD(equality_bp_family, DESCRIBE_FOR_INDEX_BPF_MTID, Calculus::Equality::REL_describe_briefly); - - spatial_bp_family = BinaryPredicateFamilies::new(); - #ifndef IF_MODULE - METHOD_ADD(spatial_bp_family, STOCK_BPF_MTID, Calculus::Equality::stock_spatial); - #endif -} - -@h Initial stock. -This relation is hard-wired in, and it is made in a slightly special way -since (alone among binary predicates) it has no distinct reversal. - -= -void Calculus::Equality::stock(bp_family *self, int n) { - if (n == 1) { - R_equality = BinaryPredicates::make_equality(); - BinaryPredicates::set_index_details(R_equality, "value", "value"); - - word_assemblage wa = PreformUtilities::merge(, 0, - PreformUtilities::wording(, EQUALITY_RELATION_NAME)); - wording AW = WordAssemblages::to_wording(&wa); - Nouns::new_proper_noun(AW, NEUTER_GENDER, ADD_TO_LEXICON_NTOPT, - MISCELLANEOUS_MC, Rvalues::from_binary_predicate(R_equality), - Task::language_of_syntax()); - } -} -void Calculus::Equality::stock_spatial(bp_family *self, int n) { - if (n == 1) { - a_has_b_predicate = - BinaryPredicates::make_pair(spatial_bp_family, - BinaryPredicates::full_new_term(NULL, NULL, EMPTY_WORDING, NULL), - BinaryPredicates::new_term(NULL), - I"has", I"is-had-by", - NULL, NULL, NULL, - PreformUtilities::wording(, POSSESSION_RELATION_NAME)); - } +void EqualityDetails::start(void) { + METHOD_ADD(equality_bp_family, TYPECHECK_BPF_MTID, EqualityDetails::REL_typecheck); + METHOD_ADD(equality_bp_family, ASSERT_BPF_MTID, EqualityDetails::REL_assert); + METHOD_ADD(equality_bp_family, SCHEMA_BPF_MTID, EqualityDetails::REL_compile); } @h Typechecking. @@ -65,7 +16,7 @@ This is a very polymorphic relation, in that it can accept terms of almost any kind. = -int Calculus::Equality::REL_typecheck(bp_family *self, binary_predicate *bp, +int EqualityDetails::REL_typecheck(bp_family *self, binary_predicate *bp, kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) { LOGIF(MATCHING, "Typecheck %u '==' %u\n", kinds_of_terms[0], kinds_of_terms[1]); if ((K_understanding) && (Kinds::eq(kinds_of_terms[0], K_understanding)) && @@ -123,11 +74,11 @@ vice versa. So rules and rulebooks are comparable, for instance, but numbers and scenes are not. @ = - if (Calculus::Equality::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_rule)) + if (EqualityDetails::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_rule)) return ALWAYS_MATCH; - if (Calculus::Equality::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_rulebook)) + if (EqualityDetails::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_rulebook)) return ALWAYS_MATCH; - if (Calculus::Equality::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_activity)) + if (EqualityDetails::both_terms_of_same_construction(kinds_of_terms[0], kinds_of_terms[1], CON_activity)) return ALWAYS_MATCH; if ((Kinds::compatible(kinds_of_terms[0], kinds_of_terms[1]) == NEVER_MATCH) && (Kinds::compatible(kinds_of_terms[1], kinds_of_terms[0]) == NEVER_MATCH)) { @@ -137,7 +88,7 @@ and scenes are not. } @ = -int Calculus::Equality::both_terms_of_same_construction(kind *k0, kind *k1, kind_constructor *cons) { +int EqualityDetails::both_terms_of_same_construction(kind *k0, kind *k1, kind_constructor *cons) { if ((Kinds::get_construct(k0) == cons) && (Kinds::get_construct(k1) == cons)) return TRUE; return FALSE; @@ -148,7 +99,7 @@ In general values differ, and cannot be equated by fiat. But an exception is setting a global variable. = -int Calculus::Equality::REL_assert(bp_family *self, binary_predicate *bp, +int EqualityDetails::REL_assert(bp_family *self, binary_predicate *bp, inference_subject *infs0, parse_node *spec0, inference_subject *infs1, parse_node *spec1) { if (Lvalues::is_actual_NONLOCAL_VARIABLE(spec0)) { @@ -202,7 +153,7 @@ schema is a function of both the storage class of A and the kinds of value of both A and B. = -int Calculus::Equality::REL_compile(bp_family *self, int task, binary_predicate *bp, annotated_i6_schema *asch) { +int EqualityDetails::REL_compile(bp_family *self, int task, binary_predicate *bp, annotated_i6_schema *asch) { kind *st[2]; st[0] = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt0); st[1] = Calculus::Deferrals::Cinders::kind_of_value_of_term(asch->pt1); @@ -360,13 +311,3 @@ one that's more helpfully specific and return |TRUE|. Calculus::Schemas::append(asch->schema, "%S", TEMP); DISCARD_TEXT(TEMP) } - -@h Problem message text. - -= -int Calculus::Equality::REL_describe_for_problems(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) { - return FALSE; -} -void Calculus::Equality::REL_describe_briefly(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) { - WRITE("equality"); -} diff --git a/inform7/core-module/Chapter 15/Comparative Relations.w b/inform7/core-module/Chapter 15/Comparative Relations.w index 355b533ad..aa687f724 100644 --- a/inform7/core-module/Chapter 15/Comparative Relations.w +++ b/inform7/core-module/Chapter 15/Comparative Relations.w @@ -38,6 +38,19 @@ void Properties::ComparativeRelations::stock(bp_family *self, int n) { } } +typedef struct comparative_bp_data { + struct property *comparative_property; /* (if right way) if a comparative adjective */ + int comparison_sign; /* ...and |+1| or |-1| according to sign of definition */ + CLASS_DEFINITION +} comparative_bp_data; + +void Properties::ComparativeRelations::initialise(binary_predicate *bp, + int sign, property *prn) { + comparative_bp_data *D = CREATE(comparative_bp_data); + D->comparison_sign = sign; D->comparative_property = prn; + bp->family_specific = STORE_POINTER_comparative_bp_data(D); +} + @h Typechecking. Because of the ambiguity between absolute and relative comparisons (see below), we'll typecheck this asymmetrically; the left term is typechecked @@ -56,10 +69,11 @@ int Properties::ComparativeRelations::REL_typecheck(bp_family *self, binary_pred } property *prn = Properties::Conditions::get_coinciding_property(kinds_of_terms[1]); - if ((prn) && (prn != bp->comparative_property)) { + comparative_bp_data *D = RETRIEVE_POINTER_comparative_bp_data(bp->family_specific); + if ((prn) && (prn != D->comparative_property)) { if (tck->log_to_I6_text) - LOG("Comparative misapplied to $Y not $Y\n", prn, bp->comparative_property); - Problems::quote_property(4, bp->comparative_property); + LOG("Comparative misapplied to $Y not $Y\n", prn, D->comparative_property); + Problems::quote_property(4, D->comparative_property); Problems::quote_property(5, prn); StandardProblems::tcp_problem(_p_(PM_ComparativeMisapplied), tck, "that ought to make a comparison of %4 not %5."); @@ -104,9 +118,10 @@ so symmetrically; we rewrite the annotated schema on the fly. (Properties::Conditions::name_can_coincide_with_property(st[1]))) { property *prn = Properties::Conditions::get_coinciding_property(st[1]); if (prn) { + comparative_bp_data *D = RETRIEVE_POINTER_comparative_bp_data(bp->family_specific); Calculus::Schemas::modify(asch->schema, "*1.%n %s *2", Properties::iname(prn), - Properties::Measurement::strict_comparison(bp->comparison_sign)); + Properties::Measurement::strict_comparison(D->comparison_sign)); return TRUE; } } diff --git a/inform7/core-module/Chapter 15/Measurement Adjectives.w b/inform7/core-module/Chapter 15/Measurement Adjectives.w index bd336c8fe..f4688e1d2 100644 --- a/inform7/core-module/Chapter 15/Measurement Adjectives.w +++ b/inform7/core-module/Chapter 15/Measurement Adjectives.w @@ -482,10 +482,10 @@ behaviour despite being of mutually incompatible kinds.) WRITE_TO(relname, "%V", quiddity); bp = BinaryPredicates::make_pair(property_comparison_bp_family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL), - relname, NULL, NULL, NULL, + relname, NULL, NULL, schema_to_compare_property_values, WordAssemblages::lit_1(quiddity)); DISCARD_TEXT(relname) - BinaryPredicates::set_comparison_details(bp, mdef->region_shape, mdef->prop); + Properties::ComparativeRelations::initialise(bp, mdef->region_shape, mdef->prop); Properties::Measurement::register_comparative(comparative_form, bp); @h Late registration of prepositions comparing properties. diff --git a/inform7/core-module/Chapter 15/Property Sentences.w b/inform7/core-module/Chapter 15/Property Sentences.w index a8547e2c6..2355f267f 100644 --- a/inform7/core-module/Chapter 15/Property Sentences.w +++ b/inform7/core-module/Chapter 15/Property Sentences.w @@ -80,9 +80,6 @@ a noun, we write it in the formal way "taking action". ::= ... activity - ::= - ... relation - ::= ... rule diff --git a/inform7/core-module/Chapter 15/Same Property Relation.w b/inform7/core-module/Chapter 15/Same Property Relation.w index 4d61aa842..92e1d8e75 100644 --- a/inform7/core-module/Chapter 15/Same Property Relation.w +++ b/inform7/core-module/Chapter 15/Same Property Relation.w @@ -47,12 +47,12 @@ void Properties::SameRelations::stock(bp_family *self, int n) { WRITE_TO(relname, "%V", rel_name); binary_predicate *bp = BinaryPredicates::make_pair(same_property_bp_family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL), - relname, NULL, NULL, + relname, NULL, Calculus::Schemas::new("*1.%n = *2.%n", i6_pname, i6_pname), Calculus::Schemas::new("*1.%n == *2.%n", i6_pname, i6_pname), WordAssemblages::lit_1(rel_name)); DISCARD_TEXT(relname) - bp->same_property = prn; + bp->family_specific = STORE_POINTER_property(prn); Properties::SameRelations::register_same_property_as(bp, Properties::get_name(prn)); } } @@ -124,7 +124,9 @@ int Properties::SameRelations::REL_compile(bp_family *self, int task, @ = property *Properties::SameRelations::bp_get_same_as_property(binary_predicate *bp) { - return bp->same_property; + if (bp->relation_family != same_property_bp_family) return NULL; + if (bp->right_way_round == FALSE) return NULL; + return RETRIEVE_POINTER_property(bp->family_specific); } @h Problem message text. diff --git a/inform7/core-module/Chapter 15/Setting Property Relation.w b/inform7/core-module/Chapter 15/Setting Property Relation.w index 083e16065..33c2d37bc 100644 --- a/inform7/core-module/Chapter 15/Setting Property Relation.w +++ b/inform7/core-module/Chapter 15/Setting Property Relation.w @@ -42,7 +42,7 @@ binary_predicate *Properties::SettingRelations::make_set_property_BP(wording W) binary_predicate *bp = BinaryPredicates::make_pair(property_setting_bp_family, BinaryPredicates::new_term(Kinds::Knowledge::as_subject(K_object)), BinaryPredicates::new_term(NULL), - I"set-property", NULL, NULL, NULL, NULL, WordAssemblages::lit_0()); + I"set-property", NULL, NULL, NULL, WordAssemblages::lit_0()); bp->property_pending_text = W; bp->reversal->property_pending_text = W; return bp; diff --git a/inform7/core-module/Chapter 15/The Provision Relation.w b/inform7/core-module/Chapter 15/The Provision Relation.w index 8e0ef6023..d103755d1 100644 --- a/inform7/core-module/Chapter 15/The Provision Relation.w +++ b/inform7/core-module/Chapter 15/The Provision Relation.w @@ -38,7 +38,7 @@ void Properties::ProvisionRelation::stock(bp_family *self, int n) { R_provision = BinaryPredicates::make_pair(provision_bp_family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL), - I"provides", NULL, NULL, NULL, NULL, + I"provides", NULL, NULL, NULL, PreformUtilities::wording(, PROVISION_RELATION_NAME)); BinaryPredicates::set_index_details(R_provision, "value", "property"); } diff --git a/inform7/core-module/Chapter 16/Inference Subjects.w b/inform7/core-module/Chapter 16/Inference Subjects.w index 4ca6a470a..3cffc0122 100644 --- a/inform7/core-module/Chapter 16/Inference Subjects.w +++ b/inform7/core-module/Chapter 16/Inference Subjects.w @@ -48,6 +48,11 @@ There is no direct way to access the links downwards from any node -- in other words, we often want to know what a given subject S inherits from, but we never ask what other subjects inherit from S. +@d TERM_DOMAIN_CALCULUS_TYPE struct inference_subject +@d TERM_DOMAIN_WORDING_FUNCTION InferenceSubjects::get_name_text +@d TERM_DOMAIN_TO_KIND_FUNCTION InferenceSubjects::domain +@d TERM_DOMAIN_FROM_KIND_FUNCTION Kinds::Knowledge::as_subject + = typedef struct inference_subject { int kind_of_infs; /* one of the |*_SUB| constants above */ @@ -478,7 +483,7 @@ wording InferenceSubjects::get_name_text(inference_subject *infs) { case KIND_SUB: W = Kinds::Knowledge::get_name_text(infs); break; case INST_SUB: W = Instances::SUBJ_get_name_text(infs); break; case VARI_SUB: W = NonlocalVariables::SUBJ_get_name_text(infs); break; - case RELN_SUB: W = BinaryPredicates::SUBJ_get_name_text(infs); break; + case RELN_SUB: W = KnowledgeAboutRelations::SUBJ_get_name_text(infs); break; } LOOP_THROUGH_WORDING(i, W) if (Lexer::word(i) == STROKE_V) { @@ -501,7 +506,7 @@ general_pointer InferenceSubjects::new_permission_granted(inference_subject *inf case KIND_SUB: return Kinds::Knowledge::new_permission_granted(infs); case INST_SUB: return Instances::SUBJ_new_permission_granted(infs); case VARI_SUB: return NonlocalVariables::SUBJ_new_permission_granted(infs); - case RELN_SUB: return BinaryPredicates::SUBJ_new_permission_granted(infs); + case RELN_SUB: return KnowledgeAboutRelations::SUBJ_new_permission_granted(infs); } return NULL_GENERAL_POINTER; } @@ -520,7 +525,7 @@ void InferenceSubjects::make_adj_const_domain(inference_subject *infs, case KIND_SUB: Kinds::Knowledge::make_adj_const_domain(infs, nc, prn); break; case INST_SUB: Instances::SUBJ_make_adj_const_domain(infs, nc, prn); break; case VARI_SUB: NonlocalVariables::SUBJ_make_adj_const_domain(infs, nc, prn); break; - case RELN_SUB: BinaryPredicates::SUBJ_make_adj_const_domain(infs, nc, prn); break; + case RELN_SUB: KnowledgeAboutRelations::SUBJ_make_adj_const_domain(infs, nc, prn); break; } } @@ -536,7 +541,7 @@ void InferenceSubjects::complete_model(inference_subject *infs) { case KIND_SUB: Kinds::Knowledge::complete_model(infs); break; case INST_SUB: Instances::SUBJ_complete_model(infs); break; case VARI_SUB: NonlocalVariables::SUBJ_complete_model(infs); break; - case RELN_SUB: BinaryPredicates::SUBJ_complete_model(infs); break; + case RELN_SUB: KnowledgeAboutRelations::SUBJ_complete_model(infs); break; } } @@ -551,7 +556,7 @@ void InferenceSubjects::check_model(inference_subject *infs) { case KIND_SUB: Kinds::Knowledge::check_model(infs); break; case INST_SUB: Instances::SUBJ_check_model(infs); break; case VARI_SUB: NonlocalVariables::SUBJ_check_model(infs); break; - case RELN_SUB: BinaryPredicates::SUBJ_check_model(infs); break; + case RELN_SUB: KnowledgeAboutRelations::SUBJ_check_model(infs); break; } } @@ -573,7 +578,7 @@ void InferenceSubjects::emit_element_of_condition(inference_subject *infs, inter case KIND_SUB: written = Kinds::Knowledge::emit_element_of_condition(infs, t0_s); break; case INST_SUB: written = Instances::SUBJ_emit_element_of_condition(infs, t0_s); break; case VARI_SUB: written = NonlocalVariables::SUBJ_emit_element_of_condition(infs, t0_s); break; - case RELN_SUB: written = BinaryPredicates::SUBJ_emit_element_of_condition(infs, t0_s); break; + case RELN_SUB: written = KnowledgeAboutRelations::SUBJ_emit_element_of_condition(infs, t0_s); break; } if (written == FALSE) { Produce::val(Emit::tree(), K_truth_state, LITERAL_IVAL, 1); @@ -604,7 +609,7 @@ void InferenceSubjects::compile_all(void) { case KIND_SUB: done = Kinds::Knowledge::emit_all(); break; case INST_SUB: done = Instances::SUBJ_compile_all(); break; case VARI_SUB: done = NonlocalVariables::SUBJ_compile_all(); break; - case RELN_SUB: done = BinaryPredicates::SUBJ_compile_all(); break; + case RELN_SUB: done = KnowledgeAboutRelations::SUBJ_compile_all(); break; } if (done) continue; inference_subject *infs; @@ -615,7 +620,7 @@ void InferenceSubjects::compile_all(void) { case KIND_SUB: Kinds::Knowledge::emit(infs); break; case INST_SUB: Instances::SUBJ_compile(infs); break; case VARI_SUB: NonlocalVariables::SUBJ_compile(infs); break; - case RELN_SUB: BinaryPredicates::SUBJ_compile(infs); break; + case RELN_SUB: KnowledgeAboutRelations::SUBJ_compile(infs); break; } } } diff --git a/inform7/core-module/Chapter 16/Knowledge about Relations.w b/inform7/core-module/Chapter 16/Knowledge about Relations.w new file mode 100644 index 000000000..d79c039c9 --- /dev/null +++ b/inform7/core-module/Chapter 16/Knowledge about Relations.w @@ -0,0 +1,85 @@ +[KnowledgeAboutRelations::] Knowledge about Relations. + +To store inferences about the state of relationships. + +@ + += +wording KnowledgeAboutRelations::SUBJ_get_name_text(inference_subject *from) { + return EMPTY_WORDING; /* nameless */ +} + +general_pointer KnowledgeAboutRelations::SUBJ_new_permission_granted(inference_subject *from) { + return NULL_GENERAL_POINTER; +} + +void KnowledgeAboutRelations::SUBJ_make_adj_const_domain(inference_subject *infs, + instance *nc, property *prn) { +} + +void KnowledgeAboutRelations::SUBJ_complete_model(inference_subject *infs) { + int domain_size = NUMBER_CREATED(inference_subject); + binary_predicate *bp = InferenceSubjects::as_bp(infs); + + if (BinaryPredicates::store_dynamically(bp)) return; /* handled at run-time instead */ + if ((BinaryPredicates::get_form_of_relation(bp) == Relation_Equiv) && (bp->right_way_round)) { + Relations::equivalence_relation_make_singleton_partitions(bp, domain_size); + inference *i; + POSITIVE_KNOWLEDGE_LOOP(i, BinaryPredicates::as_subject(bp), ARBITRARY_RELATION_INF) { + inference_subject *infs0, *infs1; + World::Inferences::get_references(i, &infs0, &infs1); + Relations::equivalence_relation_merge_classes(bp, domain_size, + infs0->allocation_id, infs1->allocation_id); + } + Relations::equivalence_relation_add_properties(bp); + } +} + +void KnowledgeAboutRelations::SUBJ_check_model(inference_subject *infs) { + binary_predicate *bp = InferenceSubjects::as_bp(infs); + if ((bp->right_way_round) && + ((bp->form_of_relation == Relation_OtoO) || + (bp->form_of_relation == Relation_Sym_OtoO))) + Relations::check_OtoO_relation(bp); + if ((bp->right_way_round) && + ((bp->form_of_relation == Relation_OtoV) || + (bp->form_of_relation == Relation_VtoO))) + Relations::check_OtoV_relation(bp); +} + +int KnowledgeAboutRelations::SUBJ_emit_element_of_condition(inference_subject *infs, inter_symbol *t0_s) { + internal_error("BP in runtime match condition"); + return FALSE; +} + +int KnowledgeAboutRelations::SUBJ_compile_all(void) { + return FALSE; +} + +void KnowledgeAboutRelations::SUBJ_compile(inference_subject *infs) { + binary_predicate *bp = InferenceSubjects::as_bp(infs); + if (bp->right_way_round) { + if (BinaryPredicates::store_dynamically(bp)) { + packaging_state save = Routines::begin(bp->initialiser_iname); + inference *i; + inter_name *rtiname = Hierarchy::find(RELATIONTEST_HL); + POSITIVE_KNOWLEDGE_LOOP(i, BinaryPredicates::as_subject(bp), ARBITRARY_RELATION_INF) { + parse_node *spec0, *spec1; + World::Inferences::get_references_spec(i, &spec0, &spec1); + BinaryPredicates::mark_as_needed(bp); + Produce::inv_call_iname(Emit::tree(), rtiname); + Produce::down(Emit::tree()); + Produce::val_iname(Emit::tree(), K_value, bp->bp_iname); + Produce::val_iname(Emit::tree(), K_value, Hierarchy::find(RELS_ASSERT_TRUE_HL)); + Specifications::Compiler::emit_as_val(K_value, spec0); + Specifications::Compiler::emit_as_val(K_value, spec1); + Produce::up(Emit::tree()); + } + Routines::end(save); + } else { + if ((bp->form_of_relation == Relation_VtoV) || + (bp->form_of_relation == Relation_Sym_VtoV)) + Relations::compile_vtov_storage(bp); + } + } +} diff --git a/inform7/core-module/Chapter 19/Listed-In Relations.w b/inform7/core-module/Chapter 19/Listed-In Relations.w index a0a8953a2..44d90d16d 100644 --- a/inform7/core-module/Chapter 19/Listed-In Relations.w +++ b/inform7/core-module/Chapter 19/Listed-In Relations.w @@ -33,7 +33,7 @@ binary_predicate *Tables::Relations::make_listed_in_predicate(table_column *tc) binary_predicate *bp = BinaryPredicates::make_pair(listed_in_bp_family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(Kinds::Knowledge::as_subject(K_table)), - I"listed_in", I"lists-in", NULL, NULL, + I"listed_in", I"lists-in", NULL, Calculus::Schemas::new("(ct_1=ExistsTableRowCorr(ct_0=*2,%d,*1))", Tables::Columns::get_id(tc)), WordAssemblages::lit_0()); diff --git a/inform7/core-module/Chapter 4/New Relation Requests.w b/inform7/core-module/Chapter 4/New Relation Requests.w index cdf43fbbd..b66c8f5fb 100644 --- a/inform7/core-module/Chapter 4/New Relation Requests.w +++ b/inform7/core-module/Chapter 4/New Relation Requests.w @@ -39,7 +39,7 @@ int RelationRequests::new_relation_SMF(int task, parse_node *V, wording *NPs) { "this is too long a name for a single relation to have", "and would become unwieldy."); else Node::set_new_relation_here(V->next, - BinaryPredicates::make_pair_sketchily( + BinaryPredicates::make_pair_sketchily(explicit_bp_family, WordAssemblages::from_wording(RW), Relation_OtoO)); return TRUE; } diff --git a/inform7/core-module/Chapter 7/Explicit Relations.w b/inform7/core-module/Chapter 7/Explicit Relations.w index 1cf137368..df37fc720 100644 --- a/inform7/core-module/Chapter 7/Explicit Relations.w +++ b/inform7/core-module/Chapter 7/Explicit Relations.w @@ -4,10 +4,23 @@ To draw inferences from the relations created explicitly by the source text. @h Managing the BPs generated. -The relations created in this section belong to the | family, +The relations created in this section belong to the "explicit" family, named so because their definitions are explicit in the source text. Initially, there are none. += (early code) +bp_family *explicit_bp_family = NULL; + +@ = +void Relations::Explicit::start(void) { + explicit_bp_family = BinaryPredicateFamilies::new(); + METHOD_ADD(explicit_bp_family, TYPECHECK_BPF_MTID, Relations::Explicit::REL_typecheck); + METHOD_ADD(explicit_bp_family, ASSERT_BPF_MTID, Relations::Explicit::REL_assert); + METHOD_ADD(explicit_bp_family, SCHEMA_BPF_MTID, Relations::Explicit::REL_compile); + METHOD_ADD(explicit_bp_family, DESCRIBE_FOR_PROBLEMS_BPF_MTID, Relations::Explicit::REL_describe_for_problems); + METHOD_ADD(explicit_bp_family, DESCRIBE_FOR_INDEX_BPF_MTID, Relations::Explicit::REL_describe_briefly); +} + @ They typecheck by the default rule only: = diff --git a/inform7/core-module/Chapter 7/Relations.w b/inform7/core-module/Chapter 7/Relations.w index 2763618de..59721dca1 100644 --- a/inform7/core-module/Chapter 7/Relations.w +++ b/inform7/core-module/Chapter 7/Relations.w @@ -2343,3 +2343,22 @@ void Relations::index_for_verbs(OUTPUT_STREAM, binary_predicate *bp) { } WRITE(""); } + +@h Registering names of relations. + += + ::= + ... relation + +@ + +@d REGISTER_RELATIONS_CALCULUS_CALLBACK Relations::register_name + += +void Relations::register_name(binary_predicate *bp, word_assemblage source_name) { + word_assemblage wa = + PreformUtilities::merge(, 0, source_name); + wording AW = WordAssemblages::to_wording(&wa); + Nouns::new_proper_noun(AW, NEUTER_GENDER, ADD_TO_LEXICON_NTOPT, + MISCELLANEOUS_MC, Rvalues::from_binary_predicate(bp), Task::language_of_syntax()); +} diff --git a/inform7/core-module/Chapter 7/The Universal Relation.w b/inform7/core-module/Chapter 7/The Universal Relation.w index 33104d901..8b958f83c 100644 --- a/inform7/core-module/Chapter 7/The Universal Relation.w +++ b/inform7/core-module/Chapter 7/The Universal Relation.w @@ -5,7 +5,7 @@ subsumes all other relations. @h Definitions. -@ +@d VERB_MEANING_UNIVERSAL R_universal = (early code) binary_predicate *R_universal = NULL; @@ -34,12 +34,12 @@ void Relations::Universal::stock(bp_family *self, int n) { R_universal = BinaryPredicates::make_pair(universal_bp_family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL), - I"relates", NULL, NULL, NULL, NULL, + I"relates", NULL, NULL, NULL, PreformUtilities::wording(, UNIVERSAL_RELATION_NAME)); R_meaning = BinaryPredicates::make_pair(universal_bp_family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL), - I"means", NULL, NULL, NULL, NULL, + I"means", NULL, NULL, NULL, PreformUtilities::wording(, MEANING_RELATION_NAME)); } } diff --git a/inform7/core-module/Contents.w b/inform7/core-module/Contents.w index 2a32f5052..83760feb5 100644 --- a/inform7/core-module/Contents.w +++ b/inform7/core-module/Contents.w @@ -125,10 +125,9 @@ Chapter 12: Use of Propositions are at last acted upon, either immediately (generating inferences) or at run-time (by causing code to be compiled which will some day test or assert the truth of the proposition)." - The Equality Relation + The Equality Relation Revisited Quasinumeric Relations Assert Propositions - I6 Schemas Compile Atoms Deciding to Defer Cinders and Deferrals @@ -178,6 +177,7 @@ about the model world, we must now resolve this mass of facts, applying Occam's Razor to construct the simplest explicit model of the world which fits this knowledge." Inference Subjects + Knowledge about Relations Property Permissions Inferences Complete Model World diff --git a/inform7/if-module/Chapter 3/Map Connection Relations.w b/inform7/if-module/Chapter 3/Map Connection Relations.w index 996ffbccf..75042611f 100644 --- a/inform7/if-module/Chapter 3/Map Connection Relations.w +++ b/inform7/if-module/Chapter 3/Map Connection Relations.w @@ -38,7 +38,7 @@ void PL::MapDirections::create_relations(void) { BinaryPredicates::new_term(infs_room), BinaryPredicates::new_term(infs_room), I"adjacent-to", I"adjacent-from", - NULL, NULL, Calculus::Schemas::new("TestAdjacency(*1,*2)"), + NULL, Calculus::Schemas::new("TestAdjacency(*1,*2)"), PreformUtilities::wording(, ADJACENCY_RELATION_NAME)); } @@ -138,7 +138,7 @@ int no_directions_noticed = 0; if (Str::get(pos) == ' ') Str::put(pos, '-'); bp_term_details room_term = BinaryPredicates::new_term(NULL); bp = BinaryPredicates::make_pair(map_connecting_bp_family, - room_term, room_term, relname, NULL, NULL, NULL, NULL, + room_term, room_term, relname, NULL, NULL, NULL, PreformUtilities::merge(, 0, WordAssemblages::from_wording(W))); diff --git a/inform7/if-module/Chapter 3/Regions.w b/inform7/if-module/Chapter 3/Regions.w index 1a2875bee..b627040ae 100644 --- a/inform7/if-module/Chapter 3/Regions.w +++ b/inform7/if-module/Chapter 3/Regions.w @@ -211,7 +211,7 @@ void PL::Regions::create_relations(void) { BinaryPredicates::new_term(infs_region), BinaryPredicates::new_term(Kinds::Knowledge::as_subject(K_object)), I"region-contains", I"in-region", - NULL, NULL, Calculus::Schemas::new("TestRegionalContainment(*2,*1)"), + NULL, Calculus::Schemas::new("TestRegionalContainment(*2,*1)"), PreformUtilities::wording(, REGIONAL_CONTAINMENT_RELATION_NAME)); BinaryPredicates::set_index_details(R_regional_containment, NULL, "room/region"); diff --git a/inform7/if-module/Chapter 3/Spatial Relations.w b/inform7/if-module/Chapter 3/Spatial Relations.w index 73454cd25..51af6c6f2 100644 --- a/inform7/if-module/Chapter 3/Spatial Relations.w +++ b/inform7/if-module/Chapter 3/Spatial Relations.w @@ -58,7 +58,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(NULL, NULL, EMPTY_WORDING, Calculus::Schemas::new("ContainerOf(*1)")), BinaryPredicates::new_term(NULL), I"contains", I"is-in", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(, CONTAINMENT_RELATION_NAME)); R_containment->loop_parent_optimisation_proviso = "ContainerOf"; R_containment->loop_parent_optimisation_ranger = "TestContainmentRange"; @@ -68,7 +68,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(infs_supporter, NULL, EMPTY_WORDING, Calculus::Schemas::new("SupporterOf(*1)")), BinaryPredicates::new_term(infs_thing), I"supports", I"is-on", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(, SUPPORT_RELATION_NAME)); R_support->loop_parent_optimisation_proviso = "SupporterOf"; R_incorporation = @@ -76,14 +76,14 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(infs_thing, NULL, EMPTY_WORDING, Calculus::Schemas::new("(*1.component_parent)")), BinaryPredicates::new_term(infs_thing), I"incorporates", I"is-part-of", - NULL, Calculus::Schemas::new("MakePart(*2,*1)"), NULL, + Calculus::Schemas::new("MakePart(*2,*1)"), NULL, PreformUtilities::wording(, INCORPORATION_RELATION_NAME)); R_carrying = BinaryPredicates::make_pair(spatial_bp_family, BinaryPredicates::full_new_term(infs_person, NULL, EMPTY_WORDING, Calculus::Schemas::new("CarrierOf(*1)")), BinaryPredicates::new_term(infs_thing), I"carries", I"is-carried-by", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(, CARRYING_RELATION_NAME)); R_carrying->loop_parent_optimisation_proviso = "CarrierOf"; R_holding = @@ -91,7 +91,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(infs_person, NULL, EMPTY_WORDING, Calculus::Schemas::new("HolderOf(*1)")), BinaryPredicates::new_term(infs_thing), I"holds", I"is-held-by", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(, HOLDING_RELATION_NAME)); /* can't be optimised, because parts are also held */ R_wearing = @@ -99,7 +99,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(infs_person, NULL, EMPTY_WORDING, Calculus::Schemas::new("WearerOf(*1)")), BinaryPredicates::new_term(infs_thing), I"wears", I"is-worn-by", - NULL, Calculus::Schemas::new("WearObject(*2,*1)"), NULL, + Calculus::Schemas::new("WearObject(*2,*1)"), NULL, PreformUtilities::wording(, WEARING_RELATION_NAME)); R_wearing->loop_parent_optimisation_proviso = "WearerOf"; a_has_b_predicate = @@ -107,7 +107,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(NULL, NULL, EMPTY_WORDING, Calculus::Schemas::new("OwnerOf(*1)")), BinaryPredicates::new_term(NULL), I"has", I"is-had-by", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(, POSSESSION_RELATION_NAME)); a_has_b_predicate->loop_parent_optimisation_proviso = "OwnerOf"; BinaryPredicates::set_index_details(a_has_b_predicate, "person", "thing"); @@ -116,7 +116,7 @@ a union of the others, and therefore includes incorporation.) BinaryPredicates::full_new_term(infs_room, NULL, EMPTY_WORDING, Calculus::Schemas::new("LocationOf(*1)")), BinaryPredicates::new_term(infs_thing), I"is-room-of", I"is-in-room", - NULL, Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, + Calculus::Schemas::new("MoveObject(*2,*1)"), NULL, PreformUtilities::wording(, ROOM_CONTAINMENT_RELATION_NAME)); room_containment_predicate->loop_parent_optimisation_proviso = "LocationOf"; @@ -129,28 +129,28 @@ can be tested at run-time, but which can't be asserted or made true or false. BinaryPredicates::new_term(infs_thing), BinaryPredicates::new_term(infs_thing), I"can-see", I"can-be-seen-by", - NULL, NULL, Calculus::Schemas::new("TestVisibility(*1,*2)"), + NULL, Calculus::Schemas::new("TestVisibility(*1,*2)"), PreformUtilities::wording(, VISIBILITY_RELATION_NAME)); R_touchability = BinaryPredicates::make_pair(spatial_bp_family, BinaryPredicates::new_term(infs_thing), BinaryPredicates::new_term(infs_thing), I"can-touch", I"can-be-touched-by", - NULL, NULL, Calculus::Schemas::new("TestTouchability(*1,*2)"), + NULL, Calculus::Schemas::new("TestTouchability(*1,*2)"), PreformUtilities::wording(, TOUCHABILITY_RELATION_NAME)); R_concealment = BinaryPredicates::make_pair(spatial_bp_family, BinaryPredicates::new_term(infs_thing), BinaryPredicates::new_term(infs_thing), I"conceals", I"is-concealed-by", - NULL, NULL, Calculus::Schemas::new("TestConcealment(*1,*2)"), + NULL, Calculus::Schemas::new("TestConcealment(*1,*2)"), PreformUtilities::wording(, CONCEALMENT_RELATION_NAME)); R_enclosure = BinaryPredicates::make_pair(spatial_bp_family, BinaryPredicates::new_term(Kinds::Knowledge::as_subject(K_object)), BinaryPredicates::new_term(Kinds::Knowledge::as_subject(K_object)), I"encloses", I"is-enclosed-by", - NULL, NULL, Calculus::Schemas::new("IndirectlyContains(*1,*2)"), + NULL, Calculus::Schemas::new("IndirectlyContains(*1,*2)"), PreformUtilities::wording(, ENCLOSURE_RELATION_NAME)); @h Typechecking. diff --git a/services/calculus-module/Chapter 1/Calculus Module.w b/services/calculus-module/Chapter 1/Calculus Module.w index e4078e958..33c8024f0 100644 --- a/services/calculus-module/Chapter 1/Calculus Module.w +++ b/services/calculus-module/Chapter 1/Calculus Module.w @@ -10,6 +10,7 @@ which use this module: @ This module defines the following classes: +@e i6_schema_CLASS @e binary_predicate_CLASS @e bp_family_CLASS @e pcalc_term_CLASS @@ -24,6 +25,7 @@ DECLARE_CLASS_ALLOCATED_IN_ARRAYS(pcalc_func, 1000) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(pcalc_term, 1000) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(pcalc_prop, 1000) DECLARE_CLASS_ALLOCATED_IN_ARRAYS(unary_predicate, 1000) +DECLARE_CLASS_ALLOCATED_IN_ARRAYS(i6_schema, 100) @ Like all modules, this one must define a |start| and |end| function: @@ -34,7 +36,16 @@ DECLARE_CLASS_ALLOCATED_IN_ARRAYS(unary_predicate, 1000) void CalculusModule::start(void) { Log::declare_aspect(PREDICATE_CALCULUS_DA, L"predicate calculus", FALSE, FALSE); Log::declare_aspect(PREDICATE_CALCULUS_WORKINGS_DA, L"predicate calculus workings", FALSE, FALSE); - BinaryPredicates::start_explicit_relation(); + Calculus::Equality::start(); } void CalculusModule::end(void) { } + +@ We also have to make annotation functions for one special annotation needed +by //linguistics//: + += (early code) +DECLARE_ANNOTATION_FUNCTIONS(relationship, binary_predicate) + +@ = +MAKE_ANNOTATION_FUNCTIONS(relationship, binary_predicate) diff --git a/services/calculus-module/Chapter 2/Binary Predicate Families.w b/services/calculus-module/Chapter 2/Binary Predicate Families.w index 154f35a76..8597176fe 100644 --- a/services/calculus-module/Chapter 2/Binary Predicate Families.w +++ b/services/calculus-module/Chapter 2/Binary Predicate Families.w @@ -56,6 +56,14 @@ such as "if 19 is false", where the terms of the relation do not fit. @d NEVER_MATCH_SAYING_WHY_NOT 1001 /* not one of the three legal |*_MATCH| values */ = +typedef struct tc_problem_kit { + int issue_error; + struct wording ew_text; + char *intention; + int log_to_I6_text; + int flag_problem; +} tc_problem_kit; + INT_METHOD_TYPE(TYPECHECK_BPF_MTID, bp_family *f, binary_predicate *bp, kind **kinds_of_terms, kind **kinds_required, tc_problem_kit *tck) @@ -74,10 +82,12 @@ world. = INT_METHOD_TYPE(ASSERT_BPF_MTID, bp_family *f, binary_predicate *bp, - inference_subject *subj0, parse_node *spec0, inference_subject *subj1, parse_node *spec1) + TERM_DOMAIN_CALCULUS_TYPE *subj0, parse_node *spec0, + TERM_DOMAIN_CALCULUS_TYPE *subj1, parse_node *spec1) int BinaryPredicateFamilies::assert(binary_predicate *bp, - inference_subject *subj0, parse_node *spec0, inference_subject *subj1, parse_node *spec1) { + TERM_DOMAIN_CALCULUS_TYPE *subj0, parse_node *spec0, + TERM_DOMAIN_CALCULUS_TYPE *subj1, parse_node *spec1) { int rv = FALSE; INT_METHOD_CALL(rv, bp->relation_family, ASSERT_BPF_MTID, bp, subj0, spec0, subj1, spec1); return rv; @@ -85,6 +95,18 @@ int BinaryPredicateFamilies::assert(binary_predicate *bp, @ This is for compiling run-time code to either test, make true, or make false. +Some constants here enumerate the three cases of what we are to do. This +looks asymmetrical -- shouldn't we also test to see whether an atom is false, +a fourth case? + +The answer is that there's no need, since "test false" can be done by +compiling "test true" and then negating. No similar trick can be used to +combine making something true or false into a single operation. + +@d TEST_ATOM_TASK 1 +@d NOW_ATOM_TRUE_TASK 2 +@d NOW_ATOM_FALSE_TASK 3 + @e SCHEMA_BPF_MTID = diff --git a/services/calculus-module/Chapter 2/Binary Predicates.w b/services/calculus-module/Chapter 2/Binary Predicates.w index a5376d582..7f282d56b 100644 --- a/services/calculus-module/Chapter 2/Binary Predicates.w +++ b/services/calculus-module/Chapter 2/Binary Predicates.w @@ -119,10 +119,15 @@ container (if any) is at present directly containing $y$. $f_i$ function. Every one of these details is optional. They are gathered together in a sub-structure called |bp_term_details|. +(For Inform, the following will be an inference subject, which is a wider +category than kinds.) + +@default TERM_DOMAIN_CALCULUS_TYPE struct kind + = typedef struct bp_term_details { struct wording called_name; /* "(called...)" name, if any exists */ - struct inference_subject *implies_infs; /* the domain of values allowed */ + TERM_DOMAIN_CALCULUS_TYPE *implies_infs; /* the domain of values allowed */ struct kind *implies_kind; /* the kind of these values */ struct i6_schema *function_of_other; /* the function $f_0$ or $f_1$ as above */ char *index_term_as; /* usually null, but if not, used in Phrasebook index */ @@ -193,10 +198,15 @@ typedef struct binary_predicate { struct word_assemblage relation_name; /* (which might have length 0) */ struct parse_node *bp_created_at; /* where declared in the source text */ struct text_stream *debugging_log_name; /* used when printing propositions to the debug log */ + + #ifdef CORE_MODULE struct package_request *bp_package; struct inter_name *bp_iname; /* when referred to as a constant */ struct inter_name *handler_iname; struct inter_name *v2v_bitmap_iname; /* only relevant for some relations */ + struct inter_name *bp_by_routine_iname; /* for relations by routine */ + struct inter_name *initialiser_iname; /* if stored in dynamically allocated memory */ + #endif struct bp_term_details term_details[2]; /* term 0 is the left term, 1 is the right */ @@ -204,7 +214,6 @@ typedef struct binary_predicate { int right_way_round; /* was this BP created directly? or is it a reversal of another? */ /* how to compile code which tests or forces this BP to be true or false: */ - struct inter_name *bp_by_routine_iname; /* for relations by routine */ struct i6_schema *test_function; /* I6 schema for (a) testing $B(x, y)$... */ struct wording condition_defn_text; /* ...unless this I7 condition is used instead */ struct i6_schema *make_true_function; /* I6 schema for (b) "now $B(x, y)$" */ @@ -215,12 +224,13 @@ typedef struct binary_predicate { struct property *set_property; /* asserting $B(x, v)$ sets this prop. of $x$ to $v$ */ struct wording property_pending_text; /* temp. version used until props created */ int relates_values_not_objects; /* true if either term is necessarily a value... */ - struct inference_subject *knowledge_about_bp; /* ...and if so, here's the list of known assertions */ + TERM_DOMAIN_CALCULUS_TYPE *knowledge_about_bp; /* ...and if so, here's the list of known assertions */ /* for optimisation of run-time code: */ int dynamic_memory; /* stored in dynamically allocated memory */ - struct inter_name *initialiser_iname; /* and if so, this is the name of its initialiser */ + #ifdef CORE_MODULE struct property *i6_storage_property; /* provides run-time storage */ + #endif struct kind *storage_kind; /* kind of property owner */ int allow_function_simplification; /* allow Inform to make use of any $f_i$ functions? */ int fast_route_finding; /* use fast rather than slow route-finding algorithm? */ @@ -230,11 +240,10 @@ typedef struct binary_predicate { /* details, filled in for right-way-round BPs only, for particular kinds of BP: */ int a_listed_in_predicate; /* (if right way) was this generated from a table column? */ - struct property *same_property; /* (if right way) if a "same property as..." */ - struct property *comparative_property; /* (if right way) if a comparative adjective */ - int comparison_sign; /* ...and |+1| or |-1| according to sign of definition */ int *equivalence_partition; /* (if right way) partition array of equivalence classes */ + general_pointer family_specific; + CLASS_DEFINITION } binary_predicate; @@ -292,7 +301,6 @@ one of the tables which has a column of this name. @d VERB_MEANING_LINGUISTICS_TYPE struct binary_predicate @d VERB_MEANING_REVERSAL_LINGUISTICS_CALLBACK BinaryPredicates::get_reversal @d VERB_MEANING_EQUALITY R_equality -@d VERB_MEANING_UNIVERSAL R_universal @d VERB_MEANING_POSSESSION a_has_b_predicate @h Creating term details. @@ -303,7 +311,7 @@ about; here it will almost always be a generality of things, such as "all numbers", or "all rooms". = -bp_term_details BinaryPredicates::new_term(inference_subject *infs) { +bp_term_details BinaryPredicates::new_term(TERM_DOMAIN_CALCULUS_TYPE *infs) { bp_term_details bptd; bptd.called_name = EMPTY_WORDING; bptd.function_of_other = NULL; @@ -316,7 +324,7 @@ bp_term_details BinaryPredicates::new_term(inference_subject *infs) { @ And there is also a fuller version, including the inessentials: = -bp_term_details BinaryPredicates::full_new_term(inference_subject *infs, kind *K, +bp_term_details BinaryPredicates::full_new_term(TERM_DOMAIN_CALCULUS_TYPE *infs, kind *K, wording CW, i6_schema *f) { bp_term_details bptd = BinaryPredicates::new_term(infs); bptd.implies_kind = K; @@ -332,7 +340,7 @@ so that we must fill them in later, using the following: void BinaryPredicates::set_term_domain(bp_term_details *bptd, kind *K) { if (bptd == NULL) internal_error("no BPTD"); bptd->implies_kind = K; - bptd->implies_infs = Kinds::Knowledge::as_subject(K); + bptd->implies_infs = TERM_DOMAIN_FROM_KIND_FUNCTION(K); } @ Similarly: @@ -366,7 +374,7 @@ kind *BinaryPredicates::kind(binary_predicate *bp) { kind *BinaryPredicates::kind_of_term(bp_term_details *bptd) { if (bptd == NULL) return NULL; if (bptd->implies_kind) return bptd->implies_kind; - return InferenceSubjects::domain(bptd->implies_infs); + return TERM_DOMAIN_TO_KIND_FUNCTION(bptd->implies_infs); } @ The table of relations in the index uses the textual name of an INFS, so: @@ -375,7 +383,7 @@ kind *BinaryPredicates::kind_of_term(bp_term_details *bptd) { void BinaryPredicates::index_term_details(OUTPUT_STREAM, bp_term_details *bptd) { if (bptd->index_term_as) { WRITE("%s", bptd->index_term_as); return; } wording W = EMPTY_WORDING; - if (bptd->implies_infs) W = InferenceSubjects::get_name_text(bptd->implies_infs); + if (bptd->implies_infs) W = TERM_DOMAIN_WORDING_FUNCTION(bptd->implies_infs); if (Wordings::nonempty(W)) WRITE("%W", W); else WRITE("--"); } @@ -443,13 +451,14 @@ It will take special handling in the type-checker to achieve this effect. For now, we give $EQ$ entirely blank term details. = -binary_predicate *BinaryPredicates::make_equality(void) { - binary_predicate *bp = BinaryPredicates::make_single(equality_bp_family, +binary_predicate *BinaryPredicates::make_equality(bp_family *family, word_assemblage WA) { + binary_predicate *bp = BinaryPredicates::make_single(family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL), - I"is", NULL, NULL, NULL, - PreformUtilities::wording(, EQUALITY_RELATION_NAME)); - + I"is", NULL, NULL, WA); bp->reversal = bp; bp->right_way_round = TRUE; + #ifdef REGISTER_RELATIONS_CALCULUS_CALLBACK + REGISTER_RELATIONS_CALCULUS_CALLBACK(bp, WA); + #endif return bp; } @@ -466,7 +475,7 @@ how to compile the BP for the one which is the right way round. = binary_predicate *BinaryPredicates::make_pair(bp_family *family, bp_term_details left_term, bp_term_details right_term, - text_stream *name, text_stream *namer, property *pn, + text_stream *name, text_stream *namer, i6_schema *mtf, i6_schema *tf, word_assemblage source_name) { binary_predicate *bp, *bpr; TEMPORARY_TEXT(n) @@ -477,19 +486,17 @@ binary_predicate *BinaryPredicates::make_pair(bp_family *family, if (Str::len(nr) == 0) WRITE_TO(nr, "%S-r", n); bp = BinaryPredicates::make_single(family, left_term, right_term, n, - pn, mtf, tf, source_name); + mtf, tf, source_name); bpr = BinaryPredicates::make_single(family, right_term, left_term, nr, - NULL, NULL, NULL, WordAssemblages::lit_0()); + NULL, NULL, WordAssemblages::lit_0()); bp->reversal = bpr; bpr->reversal = bp; bp->right_way_round = TRUE; bpr->right_way_round = FALSE; if (WordAssemblages::nonempty(source_name)) { - word_assemblage wa = - PreformUtilities::merge(, 0, source_name); - wording AW = WordAssemblages::to_wording(&wa); - Nouns::new_proper_noun(AW, NEUTER_GENDER, ADD_TO_LEXICON_NTOPT, - MISCELLANEOUS_MC, Rvalues::from_binary_predicate(bp), Task::language_of_syntax()); + #ifdef REGISTER_RELATIONS_CALCULUS_CALLBACK + REGISTER_RELATIONS_CALCULUS_CALLBACK(bp, source_name); + #endif } return bp; @@ -502,24 +509,14 @@ then fill in the correct details later. This is where such sketchy pairs are made: = -bp_family *explicit_bp_family = NULL; - -void BinaryPredicates::start_explicit_relation(void) { - explicit_bp_family = BinaryPredicateFamilies::new(); - METHOD_ADD(explicit_bp_family, TYPECHECK_BPF_MTID, Relations::Explicit::REL_typecheck); - METHOD_ADD(explicit_bp_family, ASSERT_BPF_MTID, Relations::Explicit::REL_assert); - METHOD_ADD(explicit_bp_family, SCHEMA_BPF_MTID, Relations::Explicit::REL_compile); - METHOD_ADD(explicit_bp_family, DESCRIBE_FOR_PROBLEMS_BPF_MTID, Relations::Explicit::REL_describe_for_problems); - METHOD_ADD(explicit_bp_family, DESCRIBE_FOR_INDEX_BPF_MTID, Relations::Explicit::REL_describe_briefly); -} - -binary_predicate *BinaryPredicates::make_pair_sketchily(word_assemblage wa, int f) { +binary_predicate *BinaryPredicates::make_pair_sketchily(bp_family *family, + word_assemblage wa, int f) { TEMPORARY_TEXT(relname) WRITE_TO(relname, "%V", WordAssemblages::first_word(&wa)); binary_predicate *bp = - BinaryPredicates::make_pair(explicit_bp_family, + BinaryPredicates::make_pair(family, BinaryPredicates::new_term(NULL), BinaryPredicates::new_term(NULL), - relname, NULL, NULL, NULL, NULL, wa); + relname, NULL, NULL, NULL, wa); DISCARD_TEXT(relname) bp->form_of_relation = f; bp->reversal->form_of_relation = f; @@ -540,7 +537,7 @@ would always be |NULL| in practice. = binary_predicate *BinaryPredicates::make_single(bp_family *family, bp_term_details left_term, bp_term_details right_term, - text_stream *name, property *pn, + text_stream *name, i6_schema *mtf, i6_schema *tf, word_assemblage rn) { binary_predicate *bp = CREATE(binary_predicate); bp->relation_family = family; @@ -548,17 +545,21 @@ binary_predicate *BinaryPredicates::make_single(bp_family *family, bp->relation_name = rn; bp->bp_created_at = current_sentence; bp->debugging_log_name = Str::duplicate(name); + + #ifdef CORE_MODULE bp->bp_package = NULL; bp->bp_iname = NULL; bp->handler_iname = NULL; bp->v2v_bitmap_iname = NULL; + bp->bp_by_routine_iname = NULL; + bp->initialiser_iname = NULL; + #endif bp->term_details[0] = left_term; bp->term_details[1] = right_term; /* the |reversal| and the |right_way_round| field must be set by the caller */ /* for use in code compilation */ - bp->bp_by_routine_iname = NULL; bp->test_function = tf; bp->condition_defn_text = EMPTY_WORDING; bp->make_true_function = mtf; @@ -569,14 +570,20 @@ binary_predicate *BinaryPredicates::make_single(bp_family *family, bp->set_property = NULL; bp->property_pending_text = EMPTY_WORDING; bp->relates_values_not_objects = FALSE; + #ifdef CORE_MODULE bp->knowledge_about_bp = InferenceSubjects::new(relations, RELN_SUB, STORE_POINTER_binary_predicate(bp), CERTAIN_CE); - + #endif + #ifndef CORE_MODULE + bp->knowledge_about_bp = NULL; + #endif + /* for optimisation of run-time code */ bp->dynamic_memory = FALSE; - bp->initialiser_iname = NULL; - bp->i6_storage_property = pn; + #ifdef CORE_MODULE + bp->i6_storage_property = NULL; + #endif bp->storage_kind = NULL; bp->allow_function_simplification = TRUE; bp->fast_route_finding = FALSE; @@ -586,27 +593,29 @@ binary_predicate *BinaryPredicates::make_single(bp_family *family, /* details for particular kinds of relation */ bp->a_listed_in_predicate = FALSE; - bp->same_property = NULL; - bp->comparative_property = NULL; - bp->comparison_sign = 0; bp->equivalence_partition = NULL; + bp->family_specific = NULL_GENERAL_POINTER; + return bp; } @h The package. = +#ifdef CORE_MODULE package_request *BinaryPredicates::package(binary_predicate *bp) { if (bp == NULL) internal_error("null bp"); if (bp->bp_package == NULL) bp->bp_package = Hierarchy::package(CompilationUnits::find(bp->bp_created_at), RELATIONS_HAP); return bp->bp_package; } +#endif @h The handler. = +#ifdef CORE_MODULE inter_name *BinaryPredicates::handler_iname(binary_predicate *bp) { if (bp->handler_iname == NULL) { package_request *R = BinaryPredicates::package(bp); @@ -614,89 +623,6 @@ inter_name *BinaryPredicates::handler_iname(binary_predicate *bp) { } return bp->handler_iname; } - -@h As an INFS. - -= -#ifdef CORE_MODULE -wording BinaryPredicates::SUBJ_get_name_text(inference_subject *from) { - return EMPTY_WORDING; /* nameless */ -} - -general_pointer BinaryPredicates::SUBJ_new_permission_granted(inference_subject *from) { - return NULL_GENERAL_POINTER; -} - -void BinaryPredicates::SUBJ_make_adj_const_domain(inference_subject *infs, - instance *nc, property *prn) { -} - -void BinaryPredicates::SUBJ_complete_model(inference_subject *infs) { - int domain_size = NUMBER_CREATED(inference_subject); - binary_predicate *bp = InferenceSubjects::as_bp(infs); - - if (BinaryPredicates::store_dynamically(bp)) return; /* handled at run-time instead */ - if ((BinaryPredicates::get_form_of_relation(bp) == Relation_Equiv) && (bp->right_way_round)) { - Relations::equivalence_relation_make_singleton_partitions(bp, domain_size); - inference *i; - POSITIVE_KNOWLEDGE_LOOP(i, BinaryPredicates::as_subject(bp), ARBITRARY_RELATION_INF) { - inference_subject *infs0, *infs1; - World::Inferences::get_references(i, &infs0, &infs1); - Relations::equivalence_relation_merge_classes(bp, domain_size, - infs0->allocation_id, infs1->allocation_id); - } - Relations::equivalence_relation_add_properties(bp); - } -} - -void BinaryPredicates::SUBJ_check_model(inference_subject *infs) { - binary_predicate *bp = InferenceSubjects::as_bp(infs); - if ((bp->right_way_round) && - ((bp->form_of_relation == Relation_OtoO) || - (bp->form_of_relation == Relation_Sym_OtoO))) - Relations::check_OtoO_relation(bp); - if ((bp->right_way_round) && - ((bp->form_of_relation == Relation_OtoV) || - (bp->form_of_relation == Relation_VtoO))) - Relations::check_OtoV_relation(bp); -} - -int BinaryPredicates::SUBJ_emit_element_of_condition(inference_subject *infs, inter_symbol *t0_s) { - internal_error("BP in runtime match condition"); - return FALSE; -} - -int BinaryPredicates::SUBJ_compile_all(void) { - return FALSE; -} - -void BinaryPredicates::SUBJ_compile(inference_subject *infs) { - binary_predicate *bp = InferenceSubjects::as_bp(infs); - if (bp->right_way_round) { - if (BinaryPredicates::store_dynamically(bp)) { - packaging_state save = Routines::begin(bp->initialiser_iname); - inference *i; - inter_name *rtiname = Hierarchy::find(RELATIONTEST_HL); - POSITIVE_KNOWLEDGE_LOOP(i, BinaryPredicates::as_subject(bp), ARBITRARY_RELATION_INF) { - parse_node *spec0, *spec1; - World::Inferences::get_references_spec(i, &spec0, &spec1); - BinaryPredicates::mark_as_needed(bp); - Produce::inv_call_iname(Emit::tree(), rtiname); - Produce::down(Emit::tree()); - Produce::val_iname(Emit::tree(), K_value, bp->bp_iname); - Produce::val_iname(Emit::tree(), K_value, Hierarchy::find(RELS_ASSERT_TRUE_HL)); - Specifications::Compiler::emit_as_val(K_value, spec0); - Specifications::Compiler::emit_as_val(K_value, spec1); - Produce::up(Emit::tree()); - } - Routines::end(save); - } else { - if ((bp->form_of_relation == Relation_VtoV) || - (bp->form_of_relation == Relation_Sym_VtoV)) - Relations::compile_vtov_storage(bp); - } - } -} #endif @h BP and term logging. @@ -706,7 +632,7 @@ void BinaryPredicates::log_term_details(bp_term_details *bptd, int i) { LOG(" function(%d): $i\n", i, bptd->function_of_other); if (Wordings::nonempty(bptd->called_name)) LOG(" term %d is '%W'\n", i, bptd->called_name); if (bptd->implies_infs) { - wording W = InferenceSubjects::get_name_text(bptd->implies_infs); + wording W = TERM_DOMAIN_WORDING_FUNCTION(bptd->implies_infs); if (Wordings::nonempty(W)) LOG(" term %d has domain %W\n", i, W); } } @@ -721,7 +647,9 @@ void BinaryPredicates::log(binary_predicate *bp) { LOG(" test: $i\n", bp->test_function); LOG(" make true: $i\n", bp->make_true_function); LOG(" make false: $i\n", bp->make_false_function); + #ifdef CORE_MODULE LOG(" storage property: $Y\n", bp->i6_storage_property); + #endif } @h Relation names. @@ -829,19 +757,22 @@ int BinaryPredicates::store_dynamically(binary_predicate *bp) { int BinaryPredicates::relates_values_not_objects(binary_predicate *bp) { return bp->relates_values_not_objects; } -inference_subject *BinaryPredicates::as_subject(binary_predicate *bp) { +TERM_DOMAIN_CALCULUS_TYPE *BinaryPredicates::as_subject(binary_predicate *bp) { return bp->knowledge_about_bp; } @ For use when optimising code. = +#ifdef CORE_MODULE property *BinaryPredicates::get_i6_storage_property(binary_predicate *bp) { return bp->i6_storage_property; } +#endif int BinaryPredicates::allows_function_simplification(binary_predicate *bp) { return bp->allow_function_simplification; } +#ifdef CORE_MODULE inter_name *default_rr = NULL; void BinaryPredicates::mark_as_needed(binary_predicate *bp) { if (bp->record_needed == FALSE) { @@ -855,19 +786,14 @@ void BinaryPredicates::mark_as_needed(binary_predicate *bp) { } bp->record_needed = TRUE; } +#endif +#ifdef CORE_MODULE inter_name *BinaryPredicates::iname(binary_predicate *bp) { if (bp == NULL) return NULL; return bp->bp_iname; } - -@ For use with comparative relations. - -= -void BinaryPredicates::set_comparison_details(binary_predicate *bp, - int sign, property *prn) { - bp->comparison_sign = sign; bp->comparative_property = prn; -} +#endif @ The predicate-calculus engine compiles much better loops if we can help it by providing an I6 schema of a loop header solving the diff --git a/inform7/core-module/Chapter 12/I6 Schemas.w b/services/calculus-module/Chapter 2/Compilation Schemas.w similarity index 93% rename from inform7/core-module/Chapter 12/I6 Schemas.w rename to services/calculus-module/Chapter 2/Compilation Schemas.w index 612222657..2c24599ce 100644 --- a/inform7/core-module/Chapter 12/I6 Schemas.w +++ b/services/calculus-module/Chapter 2/Compilation Schemas.w @@ -1,4 +1,4 @@ -[Calculus::Schemas::] I6 Schemas. +[Calculus::Schemas::] Compilation Schemas. To create, and later expand upon, short prototypes of I6 syntax for such run-time tasks as the setting, unsetting or testing of a relation. @@ -48,11 +48,24 @@ error. typedef struct i6_schema { wchar_t prototype_storage[TYPICAL_I6_SCHEMA_LENGTH]; struct text_stream prototype; - struct inter_schema *compiled; int no_quoted_inames; + #ifdef CORE_MODULE + struct inter_schema *compiled; struct inter_name *quoted_inames[2]; + #endif } i6_schema; +@ + += +typedef struct annotated_i6_schema { + struct i6_schema *schema; + int negate_schema; /* true if atom is to be tested with the opposite parity */ + struct pcalc_term pt0; /* terms on which the I6 schema is to be expanded */ + struct pcalc_term pt1; + int involves_action_variables; +} annotated_i6_schema; + @h Building schemas. The following makes up a new schema from a |printf|-style formatted string: @@ -69,7 +82,9 @@ i6_schema *Calculus::Schemas::new(char *fmt, ...) { text_stream *OUT = &(sch->prototype); @; va_end(ap); /* macro to end variable argument processing */ + #ifdef CORE_MODULE sch->compiled = InterSchemas::from_i6s(&(sch->prototype), sch->no_quoted_inames, (void **) sch->quoted_inames); + #endif return sch; } @@ -83,7 +98,9 @@ void Calculus::Schemas::modify(i6_schema *sch, char *fmt, ...) { text_stream *OUT = &(sch->prototype); @; va_end(ap); /* macro to end variable argument processing */ + #ifdef CORE_MODULE sch->compiled = InterSchemas::from_i6s(&(sch->prototype), sch->no_quoted_inames, (void **) sch->quoted_inames); + #endif } @ And another: @@ -94,7 +111,9 @@ void Calculus::Schemas::append(i6_schema *sch, char *fmt, ...) { text_stream *OUT = &(sch->prototype); @; va_end(ap); /* macro to end variable argument processing */ + #ifdef CORE_MODULE sch->compiled = InterSchemas::from_i6s(&(sch->prototype), sch->no_quoted_inames, (void **) sch->quoted_inames); + #endif } @ Either way, the schema's prototype is written as follows: @@ -116,13 +135,28 @@ an integer; |%s|, a C string; |%S|, a text stream; and |%k|, a kind ID. p++; switch (*p) { case 'd': WRITE("%d", va_arg(ap, int)); break; - case 'k': Kinds::RunTime::compile_weak_id(OUT, va_arg(ap, kind *)); break; - case 'L': WRITE("%~L", va_arg(ap, local_variable *)); break; + case 'k': + #ifdef CORE_MODULE + Kinds::RunTime::compile_weak_id(OUT, va_arg(ap, kind *)); + #endif + #ifndef CORE_MODULE + WRITE("{%u}", va_arg(ap, kind *)); + #endif + break; + case 'L': + #ifdef CORE_MODULE + WRITE("%~L", va_arg(ap, local_variable *)); break; + #endif + #ifndef CORE_MODULE + WRITE("%08x", va_arg(ap, void *)); break; + #endif + break; case 'n': { - inter_name *iname = (inter_name *) va_arg(ap, inter_name *); int N = sch->no_quoted_inames++; if (N >= 2) internal_error("too many inter_name quotes"); - sch->quoted_inames[N] = iname; + #ifdef CORE_MODULE + sch->quoted_inames[N] = (inter_name *) va_arg(ap, inter_name *); + #endif WRITE("QUOTED_INAME_%d_%08x", N, unique_qi_counter++); break; } @@ -150,6 +184,7 @@ We provide two routines as a sort of API for expanding schemas. The user can either specify two parameters, both of them terms... = +#ifdef CORE_MODULE void Calculus::Schemas::emit_expand_from_terms(i6_schema *sch, pcalc_term *pt1, pcalc_term *pt2, int semicolon) { i6s_emission_state ems = Calculus::Schemas::state(pt1, pt2, NULL, NULL); @@ -181,6 +216,7 @@ void Calculus::Schemas::emit_val_expand_from_terms(i6_schema *sch, Calculus::Schemas::sch_emit_inner(sch, &ems, FALSE); } +#endif typedef struct i6s_emission_state { struct text_stream *ops_textual[2]; @@ -197,6 +233,7 @@ i6s_emission_state Calculus::Schemas::state(pcalc_term *pt1, pcalc_term *pt2, te } @ = +#ifdef CORE_MODULE void Calculus::Schemas::sch_emit_inner(i6_schema *sch, i6s_emission_state *ems, int code_mode) { if ((ems->ops_textual[0]) || (ems->ops_textual[1])) internal_error("Zap"); @@ -349,15 +386,18 @@ void Calculus::Schemas::sch_emit_parameter(pcalc_term *pt, } } } +#endif @ Last and very much least: in case we receive an untypechecked term, we fill in its kind. = +#ifdef CORE_MODULE void Calculus::Schemas::sch_type_parameter(pcalc_term *pt) { if ((pt) && (pt->constant) && (pt->term_checked_as_kind == NULL)) pt->term_checked_as_kind = Specifications::to_kind(pt->constant); } +#endif @h Logging schemas. diff --git a/services/calculus-module/Chapter 2/The Equality Relation.w b/services/calculus-module/Chapter 2/The Equality Relation.w new file mode 100644 index 000000000..0d5a17e81 --- /dev/null +++ b/services/calculus-module/Chapter 2/The Equality Relation.w @@ -0,0 +1,65 @@ +[Calculus::Equality::] The Equality Relation. + +To define that prince among predicates, the equality relation. + +@ This predicate plays a very special role in our calculus, and must always +exist. + += (early code) +bp_family *equality_bp_family = NULL; +bp_family *spatial_bp_family = NULL; + +binary_predicate *R_equality = NULL; +binary_predicate *a_has_b_predicate = NULL; + +@h Family. +This is a minimal representation only: Inform adds other methods to the equality +family to handle its typechecking and so on. + += +void Calculus::Equality::start(void) { + equality_bp_family = BinaryPredicateFamilies::new(); + METHOD_ADD(equality_bp_family, STOCK_BPF_MTID, Calculus::Equality::stock); + METHOD_ADD(equality_bp_family, DESCRIBE_FOR_PROBLEMS_BPF_MTID, Calculus::Equality::REL_describe_for_problems); + METHOD_ADD(equality_bp_family, DESCRIBE_FOR_INDEX_BPF_MTID, Calculus::Equality::REL_describe_briefly); + + spatial_bp_family = BinaryPredicateFamilies::new(); + #ifndef IF_MODULE + METHOD_ADD(spatial_bp_family, STOCK_BPF_MTID, Calculus::Equality::stock_spatial); + #endif +} + +@h Initial stock. +This relation is hard-wired in, and it is made in a slightly special way +since (alone among binary predicates) it has no distinct reversal. + += +void Calculus::Equality::stock(bp_family *self, int n) { + if (n == 1) { + R_equality = BinaryPredicates::make_equality(equality_bp_family, + PreformUtilities::wording(, EQUALITY_RELATION_NAME)); + BinaryPredicates::set_index_details(R_equality, "value", "value"); + } +} + +void Calculus::Equality::stock_spatial(bp_family *self, int n) { + if (n == 1) { + a_has_b_predicate = + BinaryPredicates::make_pair(spatial_bp_family, + BinaryPredicates::full_new_term(NULL, NULL, EMPTY_WORDING, NULL), + BinaryPredicates::new_term(NULL), + I"has", I"is-had-by", + NULL, NULL, + PreformUtilities::wording(, POSSESSION_RELATION_NAME)); + } +} + +@h Problem message text. + += +int Calculus::Equality::REL_describe_for_problems(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) { + return FALSE; +} +void Calculus::Equality::REL_describe_briefly(bp_family *self, OUTPUT_STREAM, binary_predicate *bp) { + WRITE("equality"); +} diff --git a/services/calculus-module/Contents.w b/services/calculus-module/Contents.w index e1b90946b..aca1008ee 100644 --- a/services/calculus-module/Contents.w +++ b/services/calculus-module/Contents.w @@ -14,7 +14,9 @@ Chapter 1: Setting Up Chapter 2: Propositions Introduction to Predicate Calculus Unary Predicates + Compilation Schemas Binary Predicate Families Binary Predicates + The Equality Relation Terms Atomic Propositions diff --git a/services/calculus-module/Preliminaries/How To Include This Module.w b/services/calculus-module/Preliminaries/How To Include This Module.w index a32055026..41bf1ec93 100644 --- a/services/calculus-module/Preliminaries/How To Include This Module.w +++ b/services/calculus-module/Preliminaries/How To Include This Module.w @@ -21,3 +21,6 @@ Import: somepath/calculus (*) The parent must call |CalculusModule::start()| just after it starts up, and |CalculusModule::end()| just before it shuts down. (But just after, and just before, the corresponding calls to //foundation//.) + + +@ |REGISTER_RELATIONS_CALCULUS_CALLBACK|. \ No newline at end of file diff --git a/services/calculus-test/Chapter 1/Program Control.w b/services/calculus-test/Chapter 1/Program Control.w index 5265e2cec..8ea4a7ea8 100644 --- a/services/calculus-test/Chapter 1/Program Control.w +++ b/services/calculus-test/Chapter 1/Program Control.w @@ -60,3 +60,28 @@ void Main::respond(int id, int val, text_stream *arg, void *state) { void Main::ignore(int id, text_stream *arg, void *state) { Errors::fatal("only switches may be used at the command line"); } + +@ + +@d TERM_DOMAIN_WORDING_FUNCTION Main::get_name_text +@d TERM_DOMAIN_FROM_KIND_FUNCTION Main::get_kind +@d TERM_DOMAIN_TO_KIND_FUNCTION Main::get_kind += +wording Main::get_name_text(kind *K) { + return EMPTY_WORDING; +} +kind *Main::get_kind(kind *K) { + return K; +} + +@ + +@d EQUALITY_RELATION_NAME 0 +@d UNIVERSAL_RELATION_NAME 1 +@d POSSESSION_RELATION_NAME 2 + += + ::= + equality | + universal | + possession diff --git a/services/calculus-test/Chapter 1/Relating.w b/services/calculus-test/Chapter 1/Relating.w deleted file mode 100644 index 67ecce632..000000000 --- a/services/calculus-test/Chapter 1/Relating.w +++ /dev/null @@ -1,88 +0,0 @@ -[Relating::] Relating. - -Providing a sense of meaning for relationships. - -@ This test tool uses the //linguistics// module, and it needs to have some -concept of what relationships are -- that is, of what might be meant by -"X sees Y" or "X is on top of Y". - -Inform uses a class called |binary_predicate| for this, but we will use a -class simply called |rel|. - -@e rel_CLASS -@d VERB_MEANING_LINGUISTICS_TYPE struct rel - -@ //linguistics// also needs us to make annotation functions for one special -annotation it uses. (It can't do this itself without knowing the type.) But -we don't need to create the annotation or give it permissions. - -= (early code) -DECLARE_ANNOTATION_FUNCTIONS(relationship, rel) - -@ = -DECLARE_CLASS(rel) -MAKE_ANNOTATION_FUNCTIONS(relationship, rel) - -@ There isn't much to this, since all we want to be able to do is to -print out a name. - -= -typedef struct rel { - struct text_stream *debugging_log_name; - struct rel *reversed; - CLASS_DEFINITION -} rel; - -@ //linguistics// requires that whatever this is, it has to be "reversible". -(This transposes the two terms. The reversal of "X sees Y" is "X is seen by Y".) - -= -@d VERB_MEANING_REVERSAL_LINGUISTICS_CALLBACK Relating::reverse_rel - -= -rel *Relating::reverse_rel(rel *R) { - return R->reversed; -} - -@ //linguistics// also wants to know the identities of two special meanings, -roughly those of the verbs "to be" and "to have". So it requires us to define -these two macros: - -@d VERB_MEANING_EQUALITY R_equality -@d VERB_MEANING_POSSESSION R_possession - -= (early code) -rel *R_equality = NULL; -rel *R_possession = NULL; - -@ And so we will create rels in pairs, and the first two (pairs) to be created -must be for equality and possession: - -= -rel *Relating::new(wording W) { - TEMPORARY_TEXT(name) - WRITE_TO(name, "%W", W); - rel *R = CREATE(rel), *RR = CREATE(rel); - R->debugging_log_name = Str::duplicate(name); - WRITE_TO(name, "-reversed"); - RR->debugging_log_name = Str::duplicate(name); - R->reversed = RR; RR->reversed = R; - if (R_equality == NULL) R_equality = R; - else if (R_possession == NULL) R_possession = R; - DISCARD_TEXT(name) - return R; -} - -@ This function finds a rel by name. - -= -rel *Relating::find(wording W) { - TEMPORARY_TEXT(name) - WRITE_TO(name, "%W", W); - rel *T; - LOOP_OVER(T, rel) - if (Str::eq_insensitive(T->debugging_log_name, name)) - break; - DISCARD_TEXT(name) - return T; -} diff --git a/services/calculus-test/Contents.w b/services/calculus-test/Contents.w index bc2701dd1..31bb4de76 100644 --- a/services/calculus-test/Contents.w +++ b/services/calculus-test/Contents.w @@ -11,8 +11,8 @@ Import: lexicon Import: inflections Import: linguistics Import: kinds +Import: calculus Chapter 1: Scaffolding Program Control - Relating Declarations