On Sat, Sep 21, 2024 at 06:13:05PM +0800, Qian Yun wrote:
>
> I was looking for an automated process to generate such graph
> from the SPAD DATABASE. If there's no such program, I might
> try to write one.
>
> One reason I want such a visualization graph is that I want
> to see the domains that are not used by other domains,
> (and visualize how certain domains are grouped/related together)
> thus by striping those domains, I can get a "core" of SPAD
> domains. I have no idea how big/small this "core" will be.
There are different kinds of dependencies. One is category inheritance,
domain "depends" on its category which in turn inherit from other
categories. In particular this process gives you list of exported
operations. Another kind of dependency is via types of arguments
or return values, that is types appearing in siganture. Third
kind of dependency is when domain calls functions in other constructors.
The third kind may be somewhat obscured because of inlining.
Then you have practical runtime dependency "domain A needs to
load constructor B".
Inheritace information is contained in databases and used by browser.
In principle extracting inheritance information is should be easy.
But drawing it looks tricky. More precisely, inheritance graph
for a single domain is likely to be sizeable, say 50 to 150 nodes.
Automatiacally drawing such graph so that it is readible requires
some effort.
If you add dependencies via argument types, then graph will be
larger.
Concerning calls to other constructors, currently this is discovered
by looking at compiled code of a domain, more precisely domain
vector. Due to this it misses inlined functions.
Concerning "core" of FriCAS, in my early experiments with bootstap
of algebra (that was in Axiom era) I tried to compile a domain,
when it failed I added domains and categories needed to compile it
and tried again. IIRC I got to few hundreds constructors.
If you look at algebra you will see reasons: any domain is likely
to use someting from really fundamental domains like Boolean or
Integer. Boolean inherits from Finite which brings Integer into
play. Integer has complicated category structure which will bring
into play probably about 100 categories. In particular we get
PolynomialFactorizationExplicit which pulls in polynomials.
As Tim wrote, you can do
)set messages autoload on
and see messages about loading various constructors. Note that
loading is lazy, so this gives only messages about actually
used domains and still simple operations lead to loading of
many domains.
--
Waldek Hebisch