<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DerivationInfo</code></td><td class="tdright">( info class )</td></tr></table></div>
<p>Info class for derivations.</p>
<p>A derivation object describes a derived method. It contains information about which operation the derived method implements, and which other operations it relies on.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CreateDerivation</code>( <var class="Arg">target_op_name</var>, <var class="Arg">description</var>, <var class="Arg">used_ops_with_multiples</var>, <var class="Arg">func</var>, <var class="Arg">weight</var>, <var class="Arg">category_filter</var>, <var class="Arg">loop_multiplier</var>, <var class="Arg">category_getters</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Creates a new derivation object. The argument <var class="Arg">target_op_name</var> is the name of the operation which the derived method implements. The argument <var class="Arg">description</var> should describe the derivation. The argument <var class="Arg">used_ops_with_multiples</var> contains</p>
<ul>
<li><p>the name of each operation used by the derived method,</p>
</li>
<li><p>together with a positive integer specifying how many times that operation is used and</p>
</li>
<li><p>either a category getter or <code class="code">fail</code>.</p>
</li>
</ul>
<p>This is given as a list of lists, where each sublist has as first entry the name of an operation, as second entry an integer and as third entry either a function or <code class="code">fail</code>. This function should accept the category for which this derivation will be installed, and return a category for which the operation in the first entry must be installed for the derivation to be considered applicable. The argument <var class="Arg">func</var> contains the actual implementation of the derived method. The argument <var class="Arg">weight</var> is an additional number to add when calculating the resulting weight of the target operation using this derivation. Unless there is any particular reason to regard the derivation as exceedingly expensive, this number should be <code class="code">1</code>. The argument <var class="Arg">category_filter</var> is a filter (or function) describing which categories the derivation is valid for. If it is valid for all categories, then this argument should have the value <code class="code">IsCapCategory</code>. The output of <var class="Arg">category_filter</var> must not change during the installation of operations. In particular, it must not rely on <code class="code">CanCompute</code> to check conditions.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsApplicableToCategory</code>( <var class="Arg">d</var>, <var class="Arg">C</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: <code class="code">true</code> if the category <var class="Arg">C</var> is known to satisfy the category filter of the derivation <var class="Arg">d</var>.</p>
<p>Checks if the derivation is known to be valid for a given category.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TargetOperation</code>( <var class="Arg">d</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: The name (as a string) of the operation implemented by the derivation <var class="Arg">d</var></p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ UsedOperationsWithMultiplesAndCategoryGetters</code>( <var class="Arg">d</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: The names of the operations used by the derivation <var class="Arg">d</var>, together with their multiplicities and category getters. The result is a list consisting of lists of the form <code class="code">[op_name, mult, getter]</code>, where <code class="code">op_name</code> is a string, <code class="code">mult</code> a positive integer and <code class="code">getter</code> is a function or <code class="code">fail</code>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InstallDerivationForCategory</code>( <var class="Arg">d</var>, <var class="Arg">weight</var>, <var class="Arg">C</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Install the derived method <var class="Arg">d</var> for the category <var class="Arg">C</var>. The integer <var class="Arg">weight</var> is the computed weight of the operation implemented by this derivation.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FunctionCalledBeforeInstallation</code>( <var class="Arg">d</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Input is a derived method. Output is a unary function that takes as an input a category and does not output anything. This function is always called before the installation of the derived method for a concrete instance of a category.</p>
<p>A derivation graph consists of a set of operations and a set of derivations specifying how some operations can be implemented in terms of other operations.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MakeDerivationGraph</code>( <var class="Arg">operations</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Make a derivation graph containing the given set of operations and no derivations. The argument <var class="Arg">operations</var> should be a list of strings, the names of the operations. The set of operations is fixed once the graph is created. Derivations can be added to the graph by calling <code class="code">AddDerivation</code>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AddOperationsToDerivationGraph</code>( <var class="Arg">graph</var>, <var class="Arg">operations</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Adds a list of operation names <var class="Arg">operations</var> to a given derivation graph <varclass="Arg">graph</var>. This is used in extensions of CAP which want to have their own basic operations, but do not want to pollute the CAP kernel any more. Please use it with caution. If a weight list/category was created before it will not be aware of the operations.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Operations</code>( <var class="Arg">G</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Gives the operations in the graph <var class="Arg">G</var>, as a list of strings.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DerivationsUsingOperation</code>( <var class="Arg">G</var>, <var class="Arg">op_name</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Finds all the derivations in the graph <var class="Arg">G</var> that use the operation named <var class="Arg">op_name</var>, and returns them as a list.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DerivationsOfOperation</code>( <var class="Arg">G</var>, <var class="Arg">op_name</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Finds all the derivations in the graph <var class="Arg">G</var> targeting the operation named <var class="Arg">op_name</var> (that is, the derivations that provide implementations of this operation), and returns them as a list.</p>
<p>An operation weight list manages the use of derivations in a single category <span class="Math">C</span>. For every operation, it keeps a weight value which indicates how costly it is to perform that operation in the category <span class="Math">C</span>. Whenever a new operation is implemented in <span class="Math">C</span>, the operation weight list should be notified about this and given a weight to assign to this operation. It will then automatically install all possible derived methods for <span class="Math">C</span> in such a way that every operation has the smallest possible weight (the weight of a derived method is computed by using the weights of the operations it uses).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MakeOperationWeightList</code>( <var class="Arg">C</var>, <var class="Arg">G</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Create the operation weight list for a category. This should only be done once for every category, and the category should afterwards remember the returned object. The argument <var class="Arg">C</var> is the CAP category this operation weight list is associated to, and the argument <var class="Arg">G</var> is a derivation graph containing operation names and derivations.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DerivationGraph</code>( <var class="Arg">owl</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns the derivation graph used by the operation weight list <var class="Arg">owl</var>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CategoryOfOperationWeightList</code>( <var class="Arg">owl</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns the CAP category associated to the operation weight list <var class="Arg">owl</var>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CurrentOperationWeight</code>( <var class="Arg">owl</var>, <var class="Arg">op_name</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns the current weight of the operation named <var class="Arg">op_name</var>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ OperationWeightUsingDerivation</code>( <var class="Arg">owl</var>, <var class="Arg">d</var> )</td><tdclass="tdright">( operation )</td></tr></table></div>
<p>Finds out what the weight of the operation implemented by the derivation <var class="Arg">d</var> would be if we had used that derivation.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DerivationOfOperation</code>( <var class="Arg">owl</var>, <var class="Arg">op_name</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns the derivation which is currently used to implement the operation named <var class="Arg">op_name</var>. If the operation is not implemented by a derivation (that is, either implemented directly or not implemented at all), then <code class="code">fail</code> is returned.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TriggerDerivationsUsingOperation</code>( <var class="Arg">owl</var>, <var class="Arg">op_name</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Performs a search from the operation <var class="Arg">op_name</var>, and triggers all derivations that give improvements over the current state. This is used internally by <code class="code">InstallDerivations</code> and <code class="code">Reevaluate</code>. It should normally not be necessary to call this function directly.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Reevaluate</code>( <var class="Arg">owl</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Reevaluate the installed derivations, installing better derivations if possible. This should be called if new derivations become available for the category, either because the category has acquired more knowledge about itself (e.g. it is told that it is abelian) or because new derivations have been added to the graph.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Saturate</code>( <var class="Arg">owl</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Saturates the derivation graph, i.e., calls reevaluate until no more changes in the derivation graph occur.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ PrintDerivationTree</code>( <var class="Arg">owl</var>, <var class="Arg">op_name</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Print a tree representation of the way the operation named <var class="Arg">op_name</var> is implemented in the category of the operation weight list <var class="Arg">owl</var>.</p>
¤ 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.0.22Bemerkung:
¤
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.