Waldek,

My conclusion:

I agree that SubDomain needs to be re-written and that SubsetCategory
should be eliminated. I hope that it will be possible to make
incremental improvements to SubDomain rather than having to completely
re-write it. In particular I would like to make sure that members of
Union are properly treated as sub-domains of the Union,e.g. Float and
String should be recognized as sub-domains of Union(Float,String).

The rest of this message is mostly just a log of my attempt to better
understand what is going on.

On Thu, Dec 4, 2008 at 9:11 PM, you wrote:
> ...
> Actually SubsetCategory has extra argument, so it specifies
> subset which is of specific category.  However, since for
> SubDomain I see no such extra category argument, this
> breaks relation between SubDomain and SubsetCategory
>

I agree. I do not see any direct relationship between relation between
SubsetCategory and SubDomain.

Also earlier I wrote:

>> The implication is that as the *category of subdomains*, this
>> construction does something that is currently very inconvenient
>> to do otherwise in FriCAS - it gives domains that are declared
>> to satisfy this category the same exports as the domain R.

But you objected:

> I do not think SubsetCategory implies that S itself belongs to
> some other category.  Rather, SubsetCategory means that
> elements of S may by coerced to R without executing any
> code.  In other words given element of S you can use it as an
> argument to any function defined for R (and get result in R).

I agree that you are correct. My earlier claim was wrong.

Ralf wrote:

>> more important is that it declares S to be a subset of R

The actual code says:

--% SUBSET CATEGORY

compSubsetCategory(["SubsetCategory",cat,R],m,e) ==
  --1. put "Subsets" property on R to allow directly coercion to subset;
  --   allow automatic coercion from subset to R but not vice versa
  e:= put(R,"Subsets",[[$lhsOfColon,"isFalse"]],e)
  --2. give the subset domain modemaps of cat plus 3 new functions
  comp(["Join",cat,C'],m,e) where
    C'() ==
      substitute($lhsOfColon,"$",C'') where
        C''() ==
          ["CATEGORY","domain",["SIGNATURE","coerce",[R,"$"]],["SIGNATURE",
            "lift",[R,"$"]],["SIGNATURE","reduce",["$",R]]]

---

Is it correct to interpret this as modifying R, as a _side-effect_ of
this declaration of S, by giving domain R some new property named
"Subsets" with value "isFalse"? I do not understand "isFalse" and I do
not see however how S itself is involved in this change to R. But
perhaps the intent was to create a situation in which

    R has Subsets

is be true? The property "Subsets" then being an indication to look
for domains which inherit from the SubDomain(R,...) constructor?

Is this closer to the truth?

Rather than having SubsetCategory force this property at the time
SubsetCategory is used, I think it would make better sense for this to
be done by the compiler when compiling SubDomain.

But I see that for the two uses of SubDomain in the library this
property is already statically set by:

property.lisp:(MAKEPROP '|Integer| '|Subsets|
property.lisp:(MAKEPROP '|NonNegativeInteger| '|Subsets| '(
property.lisp:(MAKEPROP '|NonPositiveInteger| '|Subsets| '(

'NonNegativeInteger' is defined as SubDomain of Integer. And
'PositiveInteger' is defined as s SubDomain of 'NonNegativeInteger'
but so far as I know there actually is no domain 'NonPositiveInteger'
nor any subdomains of it.

But in the current version of FriCAS I get the error:

(1) -> Integer has Subsets

   >> System error:
   newHasTest expects category from

I guess this error message contains a typo: from -> form?

The same message is produced for any token that is not a category.

While in OpenAxiom I get

(1) -> Integer has Subsets

   (1)  false
                                               Type: Boolean

I expected to see true... but I guess OpenAxiom still treats all
tokens that do not match a property or a category as "false".

Maybe this "property" has nothing to do with 'has'?

In 'interp/category.boot' I read:

SourceLevelSubset(a,b) ==
  --true if a is a source-level subset of b
  a=b => true
  $noSubsumption=true => false
  b is ["Union",:blist] and member(a,blist) => true
  BOUNDP '$noSubsets and $noSubsets => false
  atom b and assoc(a,GETL(b,"Subsets")) => true
  a is [a1] and b is [b1] and assoc(a1,GETL(b1,"Subsets")) => true
  nil

--

Was this 'assoc(a,GETL(b,"Subsets"))' actually created from
'property.lisp'? Is this what the code in 'compSubsetCategory'
actually doing?

It makes sense to me that the members of a Union are "Subsets"
(sub-domains) of that Union. But this does not mean that their values
can be coerced without a change of representation!

Regards,
Bill Page.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to