<ulclass="crumbs"><li><ahref="../index.html">Home</a></li><li><ahref="../inform7n.html">Inform7</a></li><li><ahref="index.html">knowledge</a></li><li><ahref="index.html#P">Preliminaries</a></li><li><b>What This Module Does</b></li></ul></div>
<ulclass="toc"><li><ahref="P-wtmd.html#SP1">§1. Prerequisites</a></li><li><ahref="P-wtmd.html#SP2">§2. The Model</a></li></ul><hrclass="tocbar">
<pclass="commentary firstcommentary"><aid="SP1"class="paragraph-anchor"></a><b>§1. Prerequisites. </b>The knowledge module is a part of the Inform compiler toolset. It is
presented as a literate program or "web". Before diving in:
full details, but essentially: it's C without predeclarations or header files,
and where functions have names like <spanclass="extract"><spanclass="extract-syntax">Tags::add_by_name</span></span> rather than just <spanclass="extract"><spanclass="extract-syntax">add_by_name</span></span>.
<pclass="commentary firstcommentary"><aid="SP2"class="paragraph-anchor"></a><b>§2. The Model. </b>This module's task is to build the "model world", the initial state of the
world as it is chosen by an Inform author.<supid="fnref:1"><ahref="#fn:1"rel="footnote">1</a></sup> This consists of:
</p>
<ulclass="items"><li>● Kinds, such as "vehicle", created in source text.
</li><li>● Instances of kinds, such as a specific lorry in a fictional world being
created with Inform.
</li><li>● Permanently existing variables, which have kinds and initial values.
</li><li>● Either-or properties, which individual instances might or might not have:
for example, the lorry might be "parked" or "not parked".
</li><li>● Properties with values, which some instances will have and some will not,
and with differing values: for example, the colour of the lorry might be "yellow".
</li><li>● Relationships between instances. For example, a specific person might
"know how to drive" the yellow lorry, or might not.
</li></ul>
<pclass="commentary">But the model does not contain:
</p>
<ulclass="items"><li>● Kinds, such as "number", built in to Inform.<supid="fnref:2"><ahref="#fn:2"rel="footnote">2</a></sup>
</li><li>● Values, such as the number 176, which exist without anyone getting to
choose whether they should exist or not.
</li><li>● Temporary variables used during phrases or activities, but not existing
at the start of play.
</li><li>● Adjectives such as "even" as applied to numbers, or "empty" as applied
to containers, whose truth or falsity is determined by something other than
the author's whim. An author cannot choose that 176 is odd, and whether a
container is empty depends only on whether there is something in it.
</li><li>● Relationships which are, similarly, determined by an algorithm and not
by a specific authorial choice. Like it or not, 176 is "greater than" 8.
</li></ul>
<ulclass="footnotetexts"><liclass="footnote"id="fn:1"><pclass="inwebfootnote"><supid="fnref:1"><ahref="#fn:1"rel="footnote">1</a></sup> The term "model" is drawn partly from interactive fiction, but also from
model theory in the sense of logic, where a "model" is a specific solution
showing that a set of logical propositions can all simultaneously be true.
<ahref="#fnref:1"title="return to text">↩</a></p></li><liclass="footnote"id="fn:2"><pclass="inwebfootnote"><supid="fnref:2"><ahref="#fn:2"rel="footnote">2</a></sup> Properly speaking, kinds created by Neptune files inside kits rather than
being declared in source text.
<ahref="#fnref:2"title="return to text">↩</a></p></li></ul>
<pclass="commentary firstcommentary"><aid="SP3"class="paragraph-anchor"></a><b>§3. </b>The model is constructed entirely from a stream of logical propositions
sent here by the <ahref="../assertions-module/index.html"class="internal">assertions</a> module. Those propositions may be mutually
inconsistent — either flatly contradictory or just impossible to reconcile.
</p>
<pclass="commentary">The stream of supposed truthful statements comes to this module through calls
<pclass="commentary"><ahref="4-is.html"class="internal">Chapter 4: Subjects</a> gives a general API for dealing with <ahref="4-is.html"class="internal">Inference Subjects</a>,
and then works systematically through the various categories of these.
Kinds and binary predicates already exist from other modules (see
<ahref="../kinds-module/2-knd.html"class="internal">Chapter 2: Kinds (in kinds)</a> and <ahref="../calculus-module/3-bpf.html"class="internal">Chapter 3: Binary Predicates (in calculus)</a>
respectively), but <ahref="2-ins.html"class="internal">Instances</a> and <ahref="2-nv.html"class="internal">Nonlocal Variables</a> are new.
</p>
<pclass="commentary">Finally, <ahref="5-inf.html"class="internal">Chapter 5: Modelling</a> deals with the actual inferences, and with how the
model world is constructed. The core of Inform does nothing very interesting