[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] 20090129.01.mxr.patch (i-funsel.boot document mmCost)
From: |
daly |
Subject: |
[Axiom-developer] 20090129.01.mxr.patch (i-funsel.boot document mmCost) |
Date: |
Fri, 30 Jan 2009 04:20:57 -0600 |
Martin Rubey has posted further documentation on mmCost.
This has been added to the sources.
=======================================================================
diff --git a/changelog b/changelog
index 69b9825..e960397 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20090129 tpd src/axiom-website/patches.html 20090129.01.mxr.patch
+20090129 mxr src/interp/i-funsel.boot document mmCost
20090128 tpd src/axiom-website/patches.html 20090128.01.tpd.patch
20090128 tpd src/algebra/Makefile remove spad files
20090128 tpd src/algebra/funcpkgs.spad removed
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 94f28f0..2897cdd 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -913,5 +913,7 @@ bookvol10.4 add packages<br/>
bookvol10.4 add packages<br/>
<a href="patches/20090128.01.tpd.patch">20090128.01.tpd.patch</a>
bookvol10.4 add packages<br/>
+<a href="patches/20090129.01.mxr.patch">20090129.01.mxr.patch</a>
+i-funsel.boot document mmCost<br/>
</body>
</html>
diff --git a/src/interp/i-funsel.boot.pamphlet
b/src/interp/i-funsel.boot.pamphlet
index e06d684..b388591 100644
--- a/src/interp/i-funsel.boot.pamphlet
+++ b/src/interp/i-funsel.boot.pamphlet
@@ -631,6 +631,31 @@ getLocalMms(name,types,tar) ==
mmS := [mm,:mmS]
nreverse mmS
+@
+mmCost assigns a penalty to each signature according to the following
+formula:
+\begin{verbatim}
+ 10000*n + 1000*domainDepth(res) + hitListOfTargets(res)
+\end{verbatim}
+where:
+\begin{itemize}
+\item {\bf n} is a penalty taking into account the number of coercions
+necessary to coerce the types of the given arguments to those of the
+signature under consideration.
+\item {\bf res} is the codomain of the signature
+\item {\bf hitListOfTarget} assigns a penalty between 1 and 1600 using
+a short list of constructors: Polynomial (300), List (400), 500 is the
+default, UniversalSegment (501), RationalFunction (900), Matrix (910),
+Union (999), Expression (1600). Note that RationalFunction is actually
+not a domain, so it should never happen.
+\item {\bf domainDepth} calculates the maximal depth of the type
+\item {\bf finally} the preference order of PI, NNI, and DFLOAT as
+targets is done at the very end.
+\end{itemize}
+In particular, note that if we have two signatures taking types A and B,
+and the given argument does not match exactly but has to be coerced, then
+the types A and B themselves are not sorted by preference.
+<<*>>=
mmCost(name, sig,cond,tar,args1,args2) ==
cost := mmCost0(name, sig,cond,tar,args1,args2)
res := CADR sig
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Axiom-developer] 20090129.01.mxr.patch (i-funsel.boot document mmCost),
daly <=