Ralf Hemmecke wrote:
>
> This contains recent discussion about a patch for the
> fricas-aldor-interface due to changes in the Aldor compiler.
> -----------------
>
> The conditions for the exports can obviously be extracted from the
> database. At least I see these ifs in the .ap file with the ax.boot that
> we currently have.
>
> The main problem is to get the conditions for default implementations.
>
> Since fricas generates lisp, I'm pretty sure that even if they are deep
> in compiled code, at the time a function is needed at runtime, there
> must be some piece of code to actually find which domain (or default
> package) that function actually implements. Unfortunately, I have no
> idea, where this code is how to translate the information into an .ap
> format.
IIUC current code generating interface lies: it says that operations
are unconditional. Pragmatically, it should be good enough to
say that default operation is present when it is exported from
category.
If you want to do better you can look at the domain constructor
for default package. For DIRPCAT the domain constructor is
in DIRPCAT-.NRLIB/DIRPCAT-.lst. The name is 'DirectProductCategory&'.
There are three COND-s at the end containing things like:
(QSETREFV $ 12
(CONS (|dispatchFunction| |DIRPCAT-;coerce;IS;1|) $))
The conditions in COND-s are exactly donditions under which
'coerce' has default implementation. As you can see conditions
are collected in a bit vector. Meaning of bits is in database:
(1) -> )boot GETDATABASE("DirectProductCategory&", 'PREDICATES)
(EVAL-WHEN (EVAL LOAD)
(PROG () (RETURN (GETDATABASE '|DirectProductCategory&| 'PREDICATES))))
Value = ((|HasCategory| |#3| '(|Field|))
(|HasCategory| |#3| '(|OrderedAbelianMonoidSup|))
(|HasCategory| |#3| '(|OrderedSet|))
(|HasCategory| |#3| '(|unitsKnown|))
(|HasCategory| |#3| '(|CommutativeRing|))
(|HasCategory| |#3| '(|Finite|)) (|HasCategory| |#3| '(|SemiGroup|))
(|HasCategory| |#3| '(|SemiRng|)) (|HasCategory| |#3| '(|Monoid|))
(|HasCategory| |#3| '(|AbelianMonoid|)) (|HasCategory| |#3| '(|Ring|))
(|HasCategory| |#3| '(|SetCategory|)))
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.