{"id":208,"date":"2012-05-20T09:35:21","date_gmt":"2012-05-20T07:35:21","guid":{"rendered":"https:\/\/herr-rau.de\/blogs\/inform\/?page_id=208"},"modified":"2012-05-20T09:39:02","modified_gmt":"2012-05-20T07:39:02","slug":"relationen","status":"publish","type":"page","link":"https:\/\/herr-rau.de\/blogs\/inform\/?page_id=208","title":{"rendered":"Relationen"},"content":{"rendered":"<p>Ein St\u00fcck Interactive Fiction besteht aus Objekten, vor allem aus Personen, Gegenst\u00e4nden und R\u00e4umen. Beschreibungen von solchen Objekten k\u00f6nnen so aussehen:<\/p>\n<ul>\n<li><code>Mr Smith<\/code><\/li>\n<li><code>the green hat<\/code><\/li>\n<li><code>the treasure chest<\/code><\/li>\n<li><code>the bronze key<\/code><\/li>\n<\/ul>\n<p>Diese Objekte k\u00f6nnen zu einander in verschiedenen Beziehungen stehen. Diese Beziehungen werden durch eine relativ kleine Zahl bestimmter Verben ausgedr\u00fcckt; einige davon sind: <code>carry, wear, contain, have, unlock<\/code>. Dann sieht eine Beziehung zum Beispiel so aus:<\/p>\n<ol>\n<li><code>Mr Smith <strong><em>wears<\/em><\/strong> the green hat.<\/code><\/li>\n<li><code>The green hat <strong><em>is worn<\/em><\/strong> by Mr Smith.<\/code><\/li>\n<li><code>Mr Smith <strong><em>carries<\/em><\/strong> the green hat.<\/code><\/li>\n<li><code>The green hat <strong><em>is carried<\/em><\/strong> by Mr Smith.<\/code><\/li>\n<li><code>The bronze key <strong><em>unlocks<\/em><\/strong> the treasure chest.<\/code><\/li>\n<li><code>The treasure chest <strong><em>is unlocked by<\/em><\/strong> the bronze key.<\/code><\/li>\n<li><code>The green hat <strong><em>is in<\/em><\/strong> the treasure chest.<\/code><\/li>\n<li><code>The green hat <strong><em>is contained by<\/em><\/strong> the treasure chest.<\/code><\/li>\n<li><code>The treasure chest <strong>contains<\/strong> the green hat.<\/code><\/li>\n<\/ol>\n<p>Links von dem Beziehungswort steht die Beschreibung eines Objekts (x), rechts davon auch (y), und das Beziehungswort dazwischen (R) gibt die Art der Beziehung an: xRy. Dabei dr\u00fccken die S\u00e4tze 1 und 2 dieselbe wear-Beziehung aus (nur mit anderem Vokabular), ebenso die S\u00e4tze 3 und 4 beziehungsweise 5 und 6. Auch die S\u00e4tze 7-9 dr\u00fccken dieselbe Enth\u00e4lt-Beziehung aus. Wir sehen also: eine Beziehung kann durch verschiedene W\u00f6rter beschrieben werden.<\/p>\n<p>Diese Beziehungen sind nichts anderes als Relationen. Die meisten mitgelieferten Relationen sind vom Typ 1:n.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen1.jpg\" alt=\"\" title=\"Relationen1\" width=\"500\" height=\"592\" class=\"alignnone size-full wp-image-212\" srcset=\"https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen1.jpg 500w, https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen1-253x300.jpg 253w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>Andere sind vom Typ n:m. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen2.jpg\" alt=\"\" title=\"Relationen2\" width=\"500\" height=\"469\" class=\"alignnone size-full wp-image-213\" srcset=\"https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen2.jpg 500w, https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen2-300x281.jpg 300w, https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen2-319x300.jpg 319w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>Und wieder andere sind vom Typ 1:1. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen3.jpg\" alt=\"\" title=\"Relationen3\" width=\"500\" height=\"439\" class=\"alignnone size-full wp-image-214\" srcset=\"https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen3.jpg 500w, https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen3-300x263.jpg 300w, https:\/\/herr-rau.de\/blogs\/inform\/files\/Relationen3-341x300.jpg 341w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>Die Ist-verheiratet-mit Relation liefert Inform 7 allerdings nicht mit; die muss man sich selber definieren. Das geht so:<\/p>\n<pre class=\"brush: inform7; title: ; notranslate\" title=\"\">Marriage relates one person to another.<\/pre>\n<p>Jemand kann nur mit einer Person verheiratet sein, und diese ist dann wiederum mit dem jemand verheiratet. &#8220;Another&#8221; ist das Schl\u00fcsselwort f\u00fcr eine symmetrische 1:1-Relation. &#8212; D = { Personen }, W = { Personen }.<\/p>\n<pre class=\"brush: inform7; title: ; notranslate\" title=\"\">Knowing relates people to each other.<\/pre>\n<p>Jemand kann beliebig viele Leute kennen, die kennen den dann umgekehrt automatisch auch. &#8220;Each other&#8221; ist das Schl\u00fcsselwort f\u00fcr eine symmetrische n:m-Relation.&#8211; D = { Personen }, W = { Personen }.<\/p>\n<pre class=\"brush: inform7; title: ; notranslate\" title=\"\">Being the headmaster of relates one person to one school.<\/pre>\n<p>Jemand kann Schulleitung einer Schule sein, und jede Schule hat genau eine Schulleitung. &#8212; 1:1, D = { Personen }, W = { Schulen }.<\/p>\n<pre class=\"brush: inform7; title: ; notranslate\" title=\"\">Liking relates various people to various people.<\/pre>\n<p>Jemand kann mehrere andere Leute m\u00f6gen, die m\u00f6gen einen dann aber nicht automatisch auch zur\u00fcck. &#8212; n:m, D = { Personen }, W = { Personen }.<\/p>\n<pre class=\"brush: inform7; title: ; notranslate\" title=\"\">Loving relates various people to one person.<\/pre>\n<p>Jemand kann h\u00f6chstens eine Person lieben (in einem etwas traditionellen Liebesbegriff), die liebt einen nicht automatisch zur\u00fccck &#8211; und kann nat\u00fcrlich von mehreren geliebt werden. &#8212; n:1, D = { Personen }, W = { Personen }.<\/p>\n<pre class=\"brush: inform7; title: ; notranslate\" title=\"\">Being the mother relates one woman to various people.<\/pre>\n<p>Eine Frau kann mehrere Kinder haben, und jedes Kind kann nicht mehr als eine Mutter haben. 1:n, D = { Frauen }, W = { Personen }.<\/p>\n<p>&#8212; Und dann gibt es noch die M\u00f6glichkeit, eine transitive Relation festzulegen:<\/p>\n<pre class=\"brush: inform7; title: ; notranslate\" title=\"\">Kinship relates people to each other in groups.<\/pre>\n<p>Wenn eine Person mit einer anderen verwandt ist, ist sie auch mit allen dessen Verwandten verwandt.<\/p>\n<hr\/>\n<p>Was macht man jetzt mit den Relationen, wenn man sie erst einmal definiert hat? Was man machen m\u00f6chte, ist sp\u00e4ter sagen k\u00f6nnen:<\/p>\n<ul>\n<li>(Now) Pierre is married to Marie.<\/li>\n<li>(Now) Pierre and Marie know Dieter.<\/li>\n<li>(Now) Dieter heads the GRG.<\/li>\n<li>(Now) Pierre likes Marie and Dieter.<\/li>\n<li>(Now) Pierre loves Marie.<\/li>\n<li>(Now) Marie is the mother of Dieter.<\/li>\n<li>(Now) Marie is related to Dieter. Dieter is related to Pierre.<\/li>\n<\/ul>\n<p>Oder sogar:<\/p>\n<ul>\n<li>&#8230;if Marie has been married to Pierre&#8230;<\/li>\n<li>&#8230;if Marie was married to Pierre&#8230;<\/li>\n<li>&#8230;if Dieter knew Pierre&#8230;<\/li>\n<\/ul>\n<p>(Man beachte die verschiedenen Numerus- und Tempora\/Zeitformen des Verbs. Die haben jeweils eine unterschiedliche Bedeutung, die im Moment aber nicht wichtig ist.)<\/p>\n<p>Damit das funktioniert, muss man den Relationen <em>vorher<\/em> Vokabeln zuordnen. Und die verschiedenen nach Numerus oder Tempus flektierten Formen auch, weil nur so Inform sie sp\u00e4ter wiedererkennt, wenn man sie im Code gebraucht. Bei Formen von &#8220;to be&#8221; kann man sich das aber schenken, die kennt Inform auswendig:<\/p>\n<ul>\n<li>The verb to be married to implies the marriage relation.<\/li>\n<li>The verb to know (he knows, they know, he knew) implies the knowing relation.<\/li>\n<li>The verb to head (he heads, they head, he headed) implies the being the headmaster of relation.<\/li>\n<li>The verb to like (he likes, they like, he liked, he is liked) implies the liking relation.<\/li>\n<li>The verb to love (he loves, they love, he loved, he is loved) implies the loving relation. <\/li>\n<li>The verb to be the mother of (she is the mother of) implies the being the mother of relation.<\/li>\n<li>The verb to be related to implies the kinship relation.<\/li>\n<\/ul>\n<p>Im Ganzen sieht das so aus:<\/p>\n<pre class=\"brush: inform7; title: ; notranslate\" title=\"\">&quot;Test&quot;\r\n\r\nChapter 1 - New kinds of things\r\n\r\nA school is a kind of thing.\r\n\r\nChapter 2 - Relations and their verbs\r\n\r\nMarriage relates one person to another.\r\nKnowing relates people to each other.\r\nBeing the headmaster of relates one person to one school.\r\nLiking relates various people to various people.\r\nLoving relates various people to one person.\r\nBeing the mother relates one woman to various people.\r\nKinship relates people to each other in groups.\r\n\r\nThe verb to be married to  implies the marriage relation.\r\nThe verb to know (he knows, they know, he knew) implies the knowing relation.\r\nThe verb to head (he heads, they head, he headed) implies the being the headmaster of relation.\r\nThe verb to like (he likes, they like, he liked, he is liked) implies the liking relation.\r\nThe verb to love (he loves, they love, he loved, he is loved) implies the loving relation. \r\nThe verb to be the mother of  implies the being the mother relation.\r\nThe verb to be related to implies the kinship relation.\r\n\r\nChapter 3 - The objects\r\n\r\nThe World is a room.\r\n\r\nPierre is a man.\r\nMarie is a woman.\r\nDieter is a man.\r\nThe GRG is a school.\r\n\r\nChapter 4 - How they relate\r\n\r\nPierre is married to Marie.\r\nPierre and Marie know Dieter.\r\nDieter heads the GRG.\r\nPierre likes Marie and Dieter.\r\nPierre loves Marie.\r\nMarie is the mother of Dieter.\r\nMarie is related to Dieter. Dieter is related to Pierre.\r\n\r\nTest me with &quot;relations&quot;.<\/pre>\n<p>Wenn man dann in der Entwicklungsumgebung &#8220;test me&#8221; eingibt, wird der Debugging-Befehl &#8220;relations&#8221; aufgerufen, der einen \u00dcberblick \u00fcber alle Relationen zur Zeit gibt:<\/p>\n<pre>\r\nMarriage relates one person to another:\r\n  Pierre  ==  Marie\r\nKnowing relates people to each other:\r\n  Dieter  <=>  Pierre\r\n  Dieter  <=>  Marie\r\nBeing the headmaster of relates one person to one school:\r\n  Dieter  >=>  the GRG\r\nLiking relates various people to various people:\r\n  Pierre  >=>  Marie\r\n  Pierre  >=>  Dieter\r\nLoving relates various people to one person:\r\n  Pierre  >=>  Marie\r\nBeing the mother relates one woman to various people:\r\n  Marie  >=>  Dieter\r\nKinship relates people to each other in groups:\r\n  { Pierre, Marie and Dieter }\r\n  and yourself in a single-member group\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ein St\u00fcck Interactive Fiction besteht aus Objekten, vor allem aus Personen, Gegenst\u00e4nden und R\u00e4umen. Beschreibungen von solchen Objekten k\u00f6nnen so aussehen: Mr Smith the green hat the treasure chest the bronze key Diese Objekte k\u00f6nnen zu einander in verschiedenen Beziehungen &hellip; <a href=\"https:\/\/herr-rau.de\/blogs\/inform\/?page_id=208\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":94,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-208","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herr-rau.de\/blogs\/inform\/index.php?rest_route=\/wp\/v2\/pages\/208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/herr-rau.de\/blogs\/inform\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/herr-rau.de\/blogs\/inform\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/herr-rau.de\/blogs\/inform\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/herr-rau.de\/blogs\/inform\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208"}],"version-history":[{"count":0,"href":"https:\/\/herr-rau.de\/blogs\/inform\/index.php?rest_route=\/wp\/v2\/pages\/208\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/herr-rau.de\/blogs\/inform\/index.php?rest_route=\/wp\/v2\/pages\/94"}],"wp:attachment":[{"href":"https:\/\/herr-rau.de\/blogs\/inform\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}