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

Edit detail for SandBoxLeftFreeModule revision 4 of 5

1 2 3 4 5
Editor: Bill Page
Time: 2008/05/25 11:37:06 GMT-7
Note: Gaby's example


        

spad
)abbrev domain LFREEMOD LeftFreeModule
LeftFreeModule(R: Ring, S: OrderedSet):
    Join(LeftModule R, IndexedDirectProductCategory(R,S)) with
      linearCombination: List Pair(S,R) -> %
 == IndexedDirectProductAbelianGroup(R,S) add
   Rep == List Pair(S,R)
   linearCombination x ==
     per [u for u in x | second u ~= 0$R ]
   if R has EntireRing then
     (r: R) * (x: %) ==
       r = 0$R => 0$%
       r = 1$R => x
       messagePrint("from LeftFreeModule")$OutputForm
       per [pair(first u, r * second u) for u in rep x]
   else
     (r: R) * (x: %) ==
       r = 0$R => 0$%
       r = 1$R => x
       messagePrint("from LeftFreeModule")$OutputForm
       per [pair(first u,c) for u in rep x | (c := r *second u) ~= 0$R]
   coerce(x: %): OutputForm ==
     x' := rep x
     null x' => 0$R :: OutputForm
     res : List OutputForm := nil
     for u in reverse x' repeat
       second u = 1$R => res := cons(first(u)::OutputForm, res)
       res := cons(second(u)::OutputForm * first(u)::OutputForm, res)
     reduce("+",res)
spad
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/833505762114505642-25px001.spad
      using old system compiler.
   LFREEMOD abbreviates domain LeftFreeModule 
------------------------------------------------------------------------
   initializing NRLIB LFREEMOD for LeftFreeModule 
   compiling into NRLIB LFREEMOD 
****** comp fails at level 1 with expression: ******
((|IndexedDirectProductAbelianGroup| R S))
****** level 1  ******
$x:= (IndexedDirectProductAbelianGroup R S)
$m:= $EmptyMode
$f:=
((((~= #) (= #) (|coerce| #) (|hash| #) ...)))
>> Apparent user error: cannot compile (IndexedDirectProductAbelianGroup R S)

There is no from LeftFreeModule? printed out.

axiom
x := 'x::OrderedVariableList ['x,'y]

\label{eq1}x(1)
Type: OrderedVariableList?([x,y])
axiom
x := 'y::OrderedVariableList ['x,'y]

\label{eq2}y(2)
Type: OrderedVariableList?([x,y])
axiom
2 * linearCombination([pair(x,2), pair(y,3)])$LeftFreeModule(Integer,OrderedVariableList ['x,'y])
LeftFreeModule is an unknown constructor and so is unavailable. Did you mean to use -> but type something different instead? Integer has EntireRing

\label{eq3} \mbox{\rm true} (3)
Type: Boolean
axiom
(2 * linearCombination([pair(x,2), pair(y,3)])$LeftFreeModule(Integer,OrderedVariableList ['x,'y]))$LeftFreeModule(Integer,OrderedVariableList ['x,'y])
LeftFreeModule is an unknown constructor and so is unavailable. Did you mean to use -> but type something different instead?