Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  chap12.html   Sprache: HTML

 
 products/sources/formale Sprachen/GAP/pkg/cap/doc/chap12.html


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (CAP) - Chapter 12: Reinterpretations of categories</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap12"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chap13.html">13</a>  <a href="chap14.html">14</a>  <a href="chap15.html">15</a>  <a href="chap16.html">16</a>  <a href="chap17.html">17</a>  <a href="chap18.html">18</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap11.html">[Previous Chapter]</a>    <a href="chap13.html">[Next Chapter]</a>   </div>

<p id="mathjaxlink" class="pcenter"><a href="chap12_mj.html">[MathJax on]</a></p>
<p><a id="X786E618B7E5FA5FA" name="X786E618B7E5FA5FA"></a></p>
<div class="ChapSects"><a href="chap12.html#X786E618B7E5FA5FA">12 <span class="Heading">Reinterpretations of categories</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap12.html#X7DFB63A97E67C0A1">12.1 <span class="Heading">Introduction</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap12.html#X81932F777898AD72">12.2 <span class="Heading">Tutorial</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap12.html#X7AB84A0B83B2C1F1">12.3 <span class="Heading">Implementation details</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap12.html#X856FF3B57FF7C2FD">12.4 <span class="Heading">Relation to <code class="code">CompilerForCAP</code></span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap12.html#X7C701DBF7BAE649A">12.5 <span class="Heading">Attributes</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap12.html#X811A167F7DABD0F9">12.5-1 ModelingCategory</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap12.html#X86EC0F0A78ECBC10">12.6 <span class="Heading">Constructors</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap12.html#X81D06FCA7ECE38C4">12.6-1 ReinterpretationOfCategory</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap12.html#X7ACECA6387E9F29D">12.6-2 ReinterpretationFunctor</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap12.html#X7D2C2C3D7A342007">12.6-3 ModelingObject</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap12.html#X79C8914E86186004">12.6-4 ReinterpretationOfObject</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap12.html#X7C8C515B7E679556">12.6-5 ModelingMorphism</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap12.html#X85D9773186C8969A">12.6-6 ReinterpretationOfMorphism</a></span>
</div></div>
</div>

<h3>12 <span class="Heading">Reinterpretations of categories</span></h3>

<p><a id="X7DFB63A97E67C0A1" name="X7DFB63A97E67C0A1"></a></p>

<h4>12.1 <span class="Heading">Introduction</span></h4>

<p>The support for building towers of category constructors is one of the main design features of CAP. Many categories that appear in the various applications can be modeled by towers of multiple category constructors. The category constructor <code class="func">ReinterpretationOfCategory</code> (<a href="chap12.html#X81D06FCA7ECE38C4"><span class="RefLink">12.6-1</span></a>) allows adding one last layer on top which allows expressing the desired (re)interpretation of such a modeling tower. In particular, this category constructor allows specifying the name of the category together with customized methods for the operations</p>


<ul>
<li><p>ObjectConstructor</p>

</li>
<li><p>MorphismConstructor</p>

</li>
<li><p>ObjectDatum</p>

</li>
<li><p>MorphismDatum</p>

</li>
</ul>
<p>in order to reflect the desired (re)interpretation with a user-interface that is independent of the modeling tower (see below for details). Note that the same tower might have multiple interpretations.</p>

<div class="pcenter"><table class="GAPDocTable">
<caption class="GAPDocTable"><b>Table: </b>A tower of categories modeling the category <code class="code">R</code></caption>
<tr>
<td class="tdcenter"><code class="code">R := ReinterpretationOfCategory( cat_n )</code></td>
</tr>
<tr>
<td class="tdcenter"><code class="code">cat_n := CategoryConstructor_n( cat_{n-1} )</code></td>
</tr>
<tr>
<td class="tdcenter">...</td>
</tr>
<tr>
<td class="tdcenter"><code class="code">cat_1 := CategoryConstructor_1( non_categorical_input )</code></td>
</tr>
</table><br />
</div>

<p>The reinterpretation <code class="code">R</code> is isomorphic to the top category <code class="code">cat_n</code> in the tower. In practice, the word <q>tower</q> stands more generally for a finite poset with a greatest element.</p>

<p><a id="X81932F777898AD72" name="X81932F777898AD72"></a></p>

<h4>12.2 <span class="Heading">Tutorial</span></h4>

<p>We will show how one can reinterpret a category with the following guiding example: We reinterpret <code class="code">Opposite( CategoryOfRows( R ) )</code> as <code class="code">CategoryOfColumns( R )</code> using <code class="func">ReinterpretationOfCategory</code> (<a href="chap12.html#X81D06FCA7ECE38C4"><span class="RefLink">12.6-1</span></a>) with the options described in the following (see <code class="code">CategoryOfColumns_as_Opposite_CategoryOfRows.gi</code> in <code class="code">AdditiveClosuresForCAP</code> for a full implementation).</p>

<ol>
<li><p>Set the options <code class="code">category_filter</code>, <code class="code">category_object_filter</code>, and <code class="code">category_morphism_filter</code> to the filters corresponding to the data structure of the desired reinterpretation, e.g. <code class="code">IsCategoryOfColumns</code>, <code class="code">IsCategoryOfColumsObject</code>, and <code class="code">IsCategoryOfColumsMorphism</code>.</p>

</li>
<li><p>Set <code class="code">object_constructor</code>, <code class="code">object_datum</code>, <code class="code">morphism_constructor</code>, and <code class="code">morphism_datum</code> to the functions one would write for <code class="code">ObjectConstructor</code> and so on for a primitive implementation of the desired reinterpretation. In our example, <code class="code">object_constructor</code> takes the reinterpretation <code class="code">R</code> (which lies in <code class="code">IsCategoryOfColumns</code> due to the filter set in the first step) and an integer, and returns a CAP object in the category with attribute <code class="code">RankOfObject</code> set to the integer, just like a primitive implementation of <code class="code">CategoryOfColumns</code> would do.</p>

</li>
<li><p>Set <code class="code">modeling_tower_object_constructor</code>, <code class="code">modeling_tower_object_datum</code>, <code class="code">modeling_tower_morphism_constructor</code>, and <code class="code">modeling_tower_morphism_datum</code>: <code class="code">modeling_tower_object_constructor</code> gets the same input as <code class="code">object_constructor</code> but must return the corresponding object in the tower <code class="code">cat_n</code>. <code class="code">modeling_tower_object_datum</code> has the same output as <code class="code">object_datum</code> but gets the reinterpretation <code class="code">R</code> and an object in the tower <code class="code">cat_n</code> as an input. In our example, <code class="code">modeling_tower_object_constructor</code> gets the reinterpretation <code class="code">R</code> and an integer as in step 2 and wraps the integer as a <code class="code">CategoryOfRowsObject</code> and the result as an object in the opposite category. <code class="code">modeling_tower_object_datum</code> gets the reinterpretation <code class="code">R</code> and an object in <code class="code">Opposite( CategoryOfRows( R ) )</code> (that is, an integer boxed as a category of rows object boxed as an object in the opposite category) and returns the underlying integer. <code class="code">modeling_tower_morphism_constructor</code> and <code class="code">modeling_tower_morphism_datum</code> are given analogously.</p>

</li>
</ol>
<p>By composing <code class="code">modeling_tower_object_datum</code> with <code class="code">object_constructor</code> and <code class="code">modeling_tower_morphism_datum</code> with <code class="code">morphism_constructor</code> (with suitable source and range), <code class="code">ReinterpretationOfCategory</code> defines a functor "Reinterpretation" from <code class="code">cat_n</code> to <code class="code">R</code>. Similarly, it defines a functor "Model" from <code class="code">R</code> to <code class="code">cat_n</code> by composing <code class="code">object_datum</code> with <code class="code">modeling_tower_object_constructor</code> and <code class="code">morphism_datum</code> with <code class="code">modeling_tower_morphism_constructor</code> (with suitable source and range). "Reinterpretation" should be an isomorphism of categories with inverse "Model". More precisely, one has to take care of the following things:</p>


<ul>
<li><p>Since <code class="code">R</code> should just be a reinterpretation of <code class="code">cat_n</code> with a nicer data structure, we certainly want "Reinterpretation" to be an equivalence of categories with pseudo-inverse "Model".</p>

</li>
<li><p><code class="code">ReinterpretationOfCategory</code> copies all properties from <code class="code">cat_n</code> to <code class="code">R</code>, including properties like <code class="code">IsSkeletalCategory</code> which are not necessarily preserved by mere equivalences.</p>

</li>
<li><p>To fulfill the specification of WithGiven operations, reinterpreting a WithGiven object <code class="code">A</code> in <code class="code">cat_n</code> as an object in <code class="code">R</code> and taking its model again must give an object equal to <code class="code">A</code>. So we require applying "Reinterpretation" and then "Model" to give the identity. Conversely, let <code class="code">B_1</code> be an object in <code class="code">R</code>. We take its model and reinterpret this again to form an object <code class="code">B_2</code>. By construction of <code class="code">R</code>, <code class="code">B_1</code> and <code class="code">B_2</code> are equal if and only if their models are equal. But since applying "Reinterpretation" and then "Model" gives the identity, taking the model of <code class="code">B_2</code> simply gives an object equal to the model of <code class="code">B_1</code>. Thus, also <code class="code">B_1</code> and <code class="code">B_2</code> are equal. Hence, "Reinterpretation" has to be an equivalence which is a bijection on objects, and hence an isomorphism (although "Model" is not necessarily its inverse). Note: Alternatively, one can make sure that WithGiven operations in <code class="code">cat_n</code> are only called via the corresponding non-WithGiven operation in <code class="code">cat_n</code>. This can be achieved by reinterpreting all operations of <code class="code">cat_n</code> (i.e. creating <code class="code">R</code> with <code class="code">only_primitive_operations := false</code>), disabling redirect functions (i.e. creating <code class="code">R</code> with the option <code class="code">overhead := false</code>) and not calling WithGiven operations of <code class="code">R</code> manually.</p>

</li>
</ul>
<p><a id="X7AB84A0B83B2C1F1" name="X7AB84A0B83B2C1F1"></a></p>

<h4>12.3 <span class="Heading">Implementation details</span></h4>

<p>Operations in <code class="code">ReinterpretationOfCategory</code> are implemented as follows:</p>

<ol>
<li><p>Apply <code class="code">object_datum</code> and <code class="code">morphism_datum</code> to the input to get the underlying data.</p>

</li>
<li><p>Apply <code class="code">modeling_tower_object_constructor</code> and <code class="code">modeling_tower_morphism_constructor</code> to the underlying data to get objects and morphisms in the tower <code class="code">cat_n</code>.</p>

</li>
<li><p>Apply the operation of the tower <code class="code">cat_n</code>.</p>

</li>
<li><p>Apply <code class="code">modeling_tower_object_datum</code> or <code class="code">modeling_tower_morphism_datum</code> to the result to get the underlying data.</p>

</li>
<li><p>Apply <code class="code">object_constructor</code> or <code class="code">morphism_constructor</code> to the underlying data to get an object or a morphism in the reinterpretation <code class="code">R</code>.</p>

</li>
</ol>
<p>The first two steps define the functor "Model" and the last two steps define the functor "Reinterpretation""Reinterpretation" on objects and morphisms is called <code class="code">ReinterpretationOfObject</code> and <code class="code">ReinterpretationOfMorphism</code> in the code"Model" on objects and morphisms is called <code class="code">ModelingObject</code> and <code class="code">ModelingMorphism</code> in the code.</p>

<p><a id="X856FF3B57FF7C2FD" name="X856FF3B57FF7C2FD"></a></p>

<h4>12.4 <span class="Heading">Relation to <code class="code">CompilerForCAP</code></span></h4>

<p>The operation of the tower <code class="code">cat_n</code> (step 3 above) usually unboxes objects and morphisms, operates on the underlying data, and boxes the result. The unboxing usually cancels with step 2 above, and boxing the result usually cancels with step 4 above. If one now compiles the operations of the reinterpretation <code class="code">R</code>, only the following steps remain:</p>

<ol>
<li><p>Apply <code class="code">object_datum</code> and <code class="code">morphism_datum</code> to the input to get the underlying data.</p>

</li>
<li><p>Operate on the underlying data. (previously part of step 3)</p>

</li>
<li><p>Apply <code class="code">object_constructor</code> or <code class="code">morphism_constructor</code> to the underlying data to get an object or a morphism in the reinterpretation <code class="code">R</code>. (previously step 5)</p>

</li>
</ol>
<p>This is exactly what a primitive implementation would look like. Thus, in many cases compiling a reinterpretation immediately gives a primitive implementation with no remaining references to the tower <code class="code">cat_n</code>.</p>

<p><a id="X7C701DBF7BAE649A" name="X7C701DBF7BAE649A"></a></p>

<h4>12.5 <span class="Heading">Attributes</span></h4>

<p><a id="X811A167F7DABD0F9" name="X811A167F7DABD0F9"></a></p>

<h5>12.5-1 ModelingCategory</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ModelingCategory</code>( <var class="Arg">R</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: a category</p>

<p>The tower <code class="code">cat_n</code> modeling the reinterpretation <var class="Arg">R</var>.</p>

<p><a id="X86EC0F0A78ECBC10" name="X86EC0F0A78ECBC10"></a></p>

<h4>12.6 <span class="Heading">Constructors</span></h4>

<p><a id="X81D06FCA7ECE38C4" name="X81D06FCA7ECE38C4"></a></p>

<h5>12.6-1 ReinterpretationOfCategory</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ReinterpretationOfCategory</code>( <var class="Arg">category</var>, <var class="Arg">options</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: a category</p>

<p>Reinterprets a category <var class="Arg">category</var> (the "modeling category") to form a new category <code class="code">R</code> (the "reinterpretation") subject to the options given via <var class="Arg">options</var>, which is a record with the following keys:</p>


<ul>
<li><p><code class="code">name</code>: the name of the reinterpretation <code class="code">R</code>,</p>

</li>
<li><p><code class="code">category_filter</code>, <code class="code">category_object_filter</code>, <code class="code">category_morphism_filter</code>, <code class="code">object_datum_type</code>, <code class="code">morphism_datum_type</code>, <code class="code">object_constructor</code>, <code class="code">object_datum</code>, <code class="code">morphism_constructor</code>, <code class="code">morphism_datum</code>: same meaning as for <code class="func">CategoryConstructor</code> (<a href="chap11.html#X8070F8B48111E8A7"><span class="RefLink">11.2-1</span></a>), which is used to create the reinterpretation <code class="code">R</code>,</p>

</li>
<li><p><code class="code">modeling_tower_object_constructor</code>: a function which gets the reinterpretation <code class="code">R</code> and an object datum (in the sense of <code class="code">object_datum</code>) and returns the corresponding modeling object in the modeling category,</p>

</li>
<li><p><code class="code">modeling_tower_object_datum</code>: a function which gets the reinterpretation <code class="code">R</code> and an object in the modeling category and returns the corresponding object datum (in the sense of <code class="code">object_datum</code>),</p>

</li>
<li><p><code class="code">modeling_tower_morphism_constructor</code>: a function which gets the reinterpretation <code class="code">R</code>, a source in the modeling category, a morphism datum (in the sense of <code class="code">morphism_datum</code>), and a range in the modeling category and returns the corresponding modeling morphism in the modeling category,</p>

</li>
<li><p><code class="code">modeling_tower_morphism_datum</code>: a function which gets the reinterpretation <code class="code">R</code> and a morphism in the modeling category and returns the corresponding morphism datum (in the sense of <code class="code">morphism_datum</code>),</p>

</li>
<li><p><code class="code">only_primitive_operations</code> (optional, default <code class="code">false</code>): whether to only reinterpret primitive operations or all operations.</p>

</li>
</ul>
<p><a id="X7ACECA6387E9F29D" name="X7ACECA6387E9F29D"></a></p>

<h5>12.6-2 ReinterpretationFunctor</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ReinterpretationFunctor</code>( <var class="Arg">R</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: a functor</p>

<p>Returns the functor from the modeling category <code class="code">ModelingCategory</code>(<var class="Arg">R</var>) to the reinterpretation <var class="Arg">R</var> which maps each object/morphism to its reinterpretation.</p>

<p><a id="X7D2C2C3D7A342007" name="X7D2C2C3D7A342007"></a></p>

<h5>12.6-3 ModelingObject</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ModelingObject</code>( <var class="Arg">R</var>, <var class="Arg">obj</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: a CAP category object</p>

<p>Returns the object in <code class="code">ModelingCategory</code>(<var class="Arg">R</var>) modeling the object <var class="Arg">obj</var> in the reinterpretation <var class="Arg">R</var>.</p>

<p><a id="X79C8914E86186004" name="X79C8914E86186004"></a></p>

<h5>12.6-4 ReinterpretationOfObject</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ReinterpretationOfObject</code>( <var class="Arg">R</var>, <var class="Arg">obj</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: a CAP category object</p>

<p>Returns the reinterpretation in <code class="code">R</code> of an object <var class="Arg">obj</var> in <code class="code">ModelingCategory</code>(<var class="Arg">R</var>).</p>

<p><a id="X7C8C515B7E679556" name="X7C8C515B7E679556"></a></p>

<h5>12.6-5 ModelingMorphism</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ModelingMorphism</code>( <var class="Arg">R</var>, <var class="Arg">mor</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: a CAP category morphism</p>

<p>Returns the morphism in <code class="code">ModelingCategory</code>(<var class="Arg">R</var>) modeling the morphism <var class="Arg">mor</var> in the reinterpretation <var class="Arg">R</var>.</p>

<p><a id="X85D9773186C8969A" name="X85D9773186C8969A"></a></p>

<h5>12.6-6 ReinterpretationOfMorphism</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ReinterpretationOfMorphism</code>( <var class="Arg">R</var>, <var class="Arg">source</var>, <var class="Arg">mor</var>, <var class="Arg">range</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: a CAP category morphism</p>

<p>Returns the reinterpretation in <code class="code">R</code> with given source and range in <code class="code">R</code> of a morphism <var class="Arg">mor</var> in <code class="code">ModelingCategory</code>(<var class="Arg">R</var>).</p>


<div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap11.html">[Previous Chapter]</a>    <a href="chap13.html">[Next Chapter]</a>   </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chap13.html">13</a>  <a href="chap14.html">14</a>  <a href="chap15.html">15</a>  <a href="chap16.html">16</a>  <a href="chap17.html">17</a>  <a href="chap18.html">18</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>

98%


¤ Dauer der Verarbeitung: 0.19 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge