login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit
fricas
-- FreeMonoid(S: SetCategory)
S can be almost anything
X:=FreeMonoid(Symbol)

\label{eq1}\hbox{\axiomType{FreeMonoid}\ } (\hbox{\axiomType{Symbol}\ })(1)
Type: Type
fricas
e:=[e[i]::X for i in 1..5]

\label{eq2}\left[{e_{1}}, \:{e_{2}}, \:{e_{3}}, \:{e_{4}}, \:{e_{5}}\right](2)
Type: List(FreeMonoid(Symbol))
fricas
-- Some terms
t1:= e.1*e.2

\label{eq3}{e_{1}}\ {e_{2}}(3)
Type: FreeMonoid(Symbol)
fricas
t2:= t1^3

\label{eq4}{e_{1}}\ {e_{2}}\ {e_{1}}\ {e_{2}}\ {e_{1}}\ {e_{2}}(4)
Type: FreeMonoid(Symbol)
fricas
-- Equality
eq1:=t1=e.2*e.1

\label{eq5}{{e_{1}}\ {e_{2}}}={{e_{2}}\ {e_{1}}}(5)
Type: Equation(FreeMonoid(Symbol))
fricas
test(eq1)

\label{eq6} \mbox{\rm false} (6)
Type: Boolean
fricas
eq2:=t2=t1*t1*t1

\label{eq7}{{e_{1}}\ {e_{2}}\ {e_{1}}\ {e_{2}}\ {e_{1}}\ {e_{2}}}={{e_{1}}\ {e_{2}}\ {e_{1}}\ {e_{2}}\ {e_{1}}\ {e_{2}}}(7)
Type: Equation(FreeMonoid(Symbol))
fricas
test(eq2)

\label{eq8} \mbox{\rm true} (8)
Type: Boolean
fricas
-- Any symbol admissible ;)
s::X

\label{eq9}s(9)
Type: FreeMonoid(Symbol)
fricas
s*t1

\label{eq10}s \ {e_{1}}\ {e_{2}}(10)
Type: FreeMonoid(Symbol)
fricas
a*%

\label{eq11}a \  s \ {e_{1}}\ {e_{2}}(11)
Type: FreeMonoid(Symbol)
fricas
first %

\label{eq12}a(12)
Type: Symbol
fricas
-- Methods
varList t1

\label{eq13}\left[{e_{1}}, \:{e_{2}}\right](13)
Type: List(Symbol)
fricas
varList t2

\label{eq14}\left[{e_{1}}, \:{e_{2}}\right](14)
Type: List(Symbol)
fricas
retractIfCan t1

\label{eq15}\verb#"failed"#(15)
Type: Union("failed",...)
fricas
retract e.1

\label{eq16}e_{1}(16)
Type: Symbol
fricas
length t1

\label{eq17}2(17)
Type: PositiveInteger?
fricas
length t2

\label{eq18}6(18)
Type: PositiveInteger?
fricas
size t2

\label{eq19}6(19)
Type: PositiveInteger?
fricas
factors t2

\label{eq20}\begin{array}{@{}l}
\displaystyle
\left[{\left[{gen ={e_{1}}}, \:{exp = 1}\right]}, \:{\left[{gen ={e_{2}}}, \:{exp = 1}\right]}, \:{\left[{gen ={e_{1}}}, \:{exp = 1}\right]}, \right.
\
\
\displaystyle
\left.\:{\left[{gen ={e_{2}}}, \:{exp = 1}\right]}, \:{\left[{gen ={e_{1}}}, \:{exp = 1}\right]}, \:{\left[{gen ={e_{2}}}, \:{exp = 1}\right]}\right] 
(20)
Type: List(Record(gen: Symbol,exp: NonNegativeInteger?))
fricas
-- etc.
-- Restrict to b_1, b_2, b_3. B:=OrderedVariableList [b[i] for i in 1..3]

\label{eq21}\hbox{\axiomType{OrderedVariableList}\ } ([ b [ 1 ] , b [ 2 ] , b [ 3 ] ])(21)
Type: Type
fricas
Y:=FreeMonoid(B)

\label{eq22}\hbox{\axiomType{FreeMonoid}\ } (\hbox{\axiomType{OrderedVariableList}\ } ([ b [ 1 ] , b [ 2 ] , b [ 3 ] ]))(22)
Type: Type
fricas
b:=[x::Y for x in enumerate()$B]

\label{eq23}\left[{b_{1}}, \:{b_{2}}, \:{b_{3}}\right](23)
Type: List(FreeMonoid(OrderedVariableList([b[1],b[2],b[3]])))
fricas
t3:=b.1*b.2*b.3*b.1

\label{eq24}{b_{1}}\ {b_{2}}\ {b_{3}}\ {b_{1}}(24)
Type: FreeMonoid(OrderedVariableList([b[1],b[2],b[3]]))
fricas
factors t3

\label{eq25}\begin{array}{@{}l}
\displaystyle
\left[{\left[{gen ={b_{1}}}, \:{exp = 1}\right]}, \:{\left[{gen ={b_{2}}}, \:{exp = 1}\right]}, \:{\left[{gen ={b_{3}}}, \:{exp = 1}\right]}, \right.
\
\
\displaystyle
\left.\:{\left[{gen ={b_{1}}}, \:{exp = 1}\right]}\right] 
(25)
Type: List(Record(gen: OrderedVariableList([b[1],b[2],b[3]]),exp: NonNegativeInteger?))
fricas
t3*b.1  -- note exps

\label{eq26}{b_{1}}\ {b_{2}}\ {b_{3}}\ {{b_{1}}^{2}}(26)
Type: FreeMonoid(OrderedVariableList([b[1],b[2],b[3]]))
fricas
test(b.1*b.2=b.2*b.1)

\label{eq27} \mbox{\rm false} (27)
Type: Boolean
fricas
--  FreeModule(R: Join(SemiRng,AbelianMonoid),S: SetCategory) 
--  combine
R:=Expression Integer

\label{eq28}\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ })(28)
Type: Type
fricas
Z:=FreeModule(R,Y)

\label{eq29}\hbox{\axiomType{FreeModule}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }) , \hbox{\axiomType{FreeMonoid}\ } (\hbox{\axiomType{OrderedVariableList}\ } ([ b [ 1 ] , b [ 2 ] , b [ 3 ] ])))(29)
Type: Type
fricas
bb:=[x::Z for x in b]

\label{eq30}\left[{b_{1}}, \:{b_{2}}, \:{b_{3}}\right](30)
Type: List(FreeModule(Expression(Integer),FreeMonoid(OrderedVariableList([b[1],b[2],b[3]]))))
fricas
t4:=bb.1 + t3::Z

\label{eq31}{{b_{1}}\ {b_{2}}\ {b_{3}}\ {b_{1}}}+{b_{1}}(31)
Type: FreeModule(Expression(Integer),FreeMonoid(OrderedVariableList([b[1],b[2],b[3]])))
fricas
t5:=sin(x*y)*t4+z^k*bb.2

\label{eq32}{{\sin \left({x \  y}\right)}\ {b_{1}}\ {b_{2}}\ {b_{3}}\ {b_{1}}}+{{\sin \left({x \  y}\right)}\ {b_{1}}}+{{{z}^{k}}\ {b_{2}}}(32)
Type: FreeModule(Expression(Integer),FreeMonoid(OrderedVariableList([b[1],b[2],b[3]])))




  Subject:   Be Bold !!
  ( 15 subscribers )  
Please rate this page: