login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandBoxSpeciesCategory revision 1 of 4

1 2 3 4
Editor: Bill Page
Time: 2008/11/11 19:34:25 GMT-8
Note: use retract instead of coerce

changed:
-
\begin{spad}
)abb category SPECCAT SpeciesCategory
SpeciesCategory(L: SetCategory): Category == SetCategory with
       structures: Set L -> List %
       name: () -> String

)abb domain CHARSPEC CharacteristicSpecies
CharacteristicSpecies(L: SetCategory, n: Integer): SpeciesCategory L
   == add
       Rep := Set L

       coerce(t: %): OutputForm == coerce(t)$Rep

       structures s == if #s = n then [s] else []

       name () == concat ["CharacteristicSpecies(", string n, ")"]

)abb domain SPECIES Species
Species(L: SetCategory): Ring with
       retract: % -> SpeciesCategory L
 == add
   Rep := SpeciesCategory L

   coerce(s: %): OutputForm ==
       S := s pretend SpeciesCategory(L)
       name()$S::OutputForm

   retract(s: %): SpeciesCategory L == s pretend SpeciesCategory(L)

   0 == CharacteristicSpecies(L, 0) pretend Rep
   1 == CharacteristicSpecies(L, 1) pretend Rep
\end{spad}

\begin{axiom}
S1 := 1$Species INT
S2 := retract(S1)
structures([1])$S2
structures([1,2,3])$S2
\end{axiom}

spad
)abb category SPECCAT SpeciesCategory
SpeciesCategory(L: SetCategory): Category == SetCategory with
       structures: Set L -> List %
       name: () -> String
)abb domain CHARSPEC CharacteristicSpecies CharacteristicSpecies(L: SetCategory, n: Integer): SpeciesCategory L == add Rep := Set L
coerce(t: %): OutputForm == coerce(t)$Rep
structures s == if #s = n then [s] else []
name () == concat ["CharacteristicSpecies(", string n, ")"]
)abb domain SPECIES Species Species(L: SetCategory): Ring with retract: % -> SpeciesCategory L == add Rep := SpeciesCategory L
coerce(s: %): OutputForm == S := s pretend SpeciesCategory(L) name()$S::OutputForm
retract(s: %): SpeciesCategory L == s pretend SpeciesCategory(L)
0 == CharacteristicSpecies(L, 0) pretend Rep 1 == CharacteristicSpecies(L, 1) pretend Rep
spad
   Compiling OpenAxiom source code from file 
      /var/zope2/var/LatexWiki/8506520483086001901-25px001.spad using 
      Spad compiler.
   SPECCAT abbreviates category SpeciesCategory 
------------------------------------------------------------------------
   initializing NRLIB SPECCAT for SpeciesCategory 
   compiling into NRLIB SPECCAT 
Time: 0 SEC.
finalizing NRLIB SPECCAT Processing SpeciesCategory for Browser database: --->-->SpeciesCategory((structures ((List %) (Set L)))): Not documented!!!! --->-->SpeciesCategory((name ((String)))): Not documented!!!! --->-->SpeciesCategory(constructor): Not documented!!!! --->-->SpeciesCategory(): Missing Description ------------------------------------------------------------------------ SpeciesCategory is now explicitly exposed in frame initial SpeciesCategory will be automatically loaded when needed from /var/zope2/var/LatexWiki/SPECCAT.NRLIB/code.o
CHARSPEC abbreviates domain CharacteristicSpecies Adding Integer modemaps ------------------------------------------------------------------------ initializing NRLIB CHARSPEC for CharacteristicSpecies compiling into NRLIB CHARSPEC Adding $ modemaps Adding L modemaps Adding Rep modemaps Adding OutputForm modemaps compiling exported coerce : % -> OutputForm Time: 0.08 SEC.
Adding List $ modemaps Adding Set L modemaps compiling exported structures : Set L -> List % Adding Boolean modemaps Time: 0.01 SEC.
Adding String modemaps compiling exported name : () -> String Adding List String modemaps Time: 0.01 SEC.
(time taken in buildFunctor: 0) Time: 0.01 SEC.
Cumulative Statistics for Constructor CharacteristicSpecies Time: 0.11 seconds
finalizing NRLIB CHARSPEC Processing CharacteristicSpecies for Browser database: --->-->CharacteristicSpecies(): Missing Description ------------------------------------------------------------------------ CharacteristicSpecies is now explicitly exposed in frame initial CharacteristicSpecies will be automatically loaded when needed from /var/zope2/var/LatexWiki/CHARSPEC.NRLIB/code.o
SPECIES abbreviates domain Species ------------------------------------------------------------------------ initializing NRLIB SPECIES for Species compiling into NRLIB SPECIES Adding $ modemaps Adding L modemaps Adding OutputForm modemaps compiling exported coerce : % -> OutputForm Adding S modemaps Adding String modemaps Time: 0.08 SEC.
compiling exported retract : % -> SpeciesCategory L SPECIES;retract;$Sc;2 is replaced by s Time: 0 SEC.
compiling exported Zero : () -> % Adding Rep modemaps Adding Integer modemaps Time: 0 SEC.
compiling exported One : () -> % Adding Rep modemaps Adding Integer modemaps Time: 0 SEC.
(time taken in buildFunctor: 0) Time: 0.01 SEC.
Warnings: [1] Zero: pretend Rep -- should replace by @ [2] One: pretend Rep -- should replace by @
Cumulative Statistics for Constructor Species Time: 0.09 seconds
finalizing NRLIB SPECIES Processing Species for Browser database: --->-->Species((retract ((SpeciesCategory L) %))): Not documented!!!! --->-->Species(constructor): Not documented!!!! --->-->Species(): Missing Description ------------------------------------------------------------------------ Species is now explicitly exposed in frame initial Species will be automatically loaded when needed from /var/zope2/var/LatexWiki/SPECIES.NRLIB/code.o

axiom
S1 := 1$Species INT
LatexWiki Image(1)
Type: Species Integer
axiom
S2 := retract(S1)
LatexWiki Image(2)
Type: SpeciesCategory? Integer
axiom
structures([1])$S2
LatexWiki Image(3)
Type: List CharacteristicSpecies?(Integer,1)
axiom
structures([1,2,3])$S2
LatexWiki Image(4)
Type: List CharacteristicSpecies?(Integer,1)