fricas (1) -> <spad> fricas )abbrev package SYMINT SymbolInteger ++ Date Created: Fri Sep 02 01:11:15 CEST 2022 ++ Description: _[-]d+ ; symbols as integers ++ SymbolInteger(T:Type) : Exports == Implementation where fricas Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/6963949273566260192-25px001.spad using old system compiler. SYMINT abbreviates package SymbolInteger ------------------------------------------------------------------------ initializing NRLIB SYMINT for SymbolInteger compiling into NRLIB SYMINT ****** Domain: T$ already in scope augmenting T$: (ConvertibleTo (InputForm)) ****** Domain: T$ already in scope augmenting T$: (CoercibleFrom (Symbol)) compiling exported integerSymbol? : T$ -> Boolean Time: 0.03 SEC. fricas SPI:=SYMINT(POLY INT)
Type: Type
fricas SEI:=SYMINT(EXPR INT)
Type: Type
fricas SSY:=SYMINT(Symbol)
Type: Type
fricas integerSymbol?(_344::POLY(INT)) --> true
Type: Boolean
fricas integerSymbol?(_344::EXPR(INT)) --> true
Type: Boolean
fricas --integerSymbol?(_344::Symbol) --> true / not after adding CFS
Type: Boolean
fricas integerSymbol?(_122222222222222229888::POLY INT) --> true
Type: Boolean
fricas integerSymbol?(m::POLY INT) --> false
Type: Boolean
fricas sym2int(_1234567890::POLY INT) --> 1234567890
Type: PositiveInteger?
fricas sym2int(_-1234567890::POLY INT) --> - 1234567890
Type: Integer
fricas sym2int(_1234567890::EXPR INT)
Type: PositiveInteger?
fricas sym2int(_-1234567890::EXPR INT)
Type: Integer
fricas int2sym(1234567890)$SYMINT(POLY INT) --> _1234567890 Polynomial(Integer)
Type: Polynomial(Integer)
fricas int2sym(-1234567890)$SYMINT(POLY INT) --> _-1234567890
Type: Polynomial(Integer)
fricas int2sym(-1234567890)$SYMINT(EXPR INT) --> _-1234567890
Type: Expression(Integer)
fricas T:=POLY INT
Type: Type
fricas sum(x:List T):T == f:=(t:T):T+->if integerSymbol? t then sym2int t else t b:=map(f, Type: Void
fricas sum [_1::T, fricas Compiling function sum with type List(Polynomial(Integer)) -> Polynomial(Integer)
Type: Polynomial(Integer)
fricas sum [_1::T,
Type: Polynomial(Integer)
fricas T:=EXPR INT
Type: Type
fricas prod(x:List T):T == f:=(t:T):T+->if integerSymbol? t then sym2int t else t b:=map(f, Type: Void
fricas p1:=prod [_2::T, fricas Compiling function prod with type List(Expression(Integer)) -> Expression(Integer)
Type: Expression(Integer)
fricas p2:=prod [_-2::T,
Type: Expression(Integer)
fricas q1:=int2sym(p1)$SEI
Type: Expression(Integer)
fricas q2:=int2sym(p2)$SEI
Type: Expression(Integer)
fricas prod [q1,
Type: Expression(Integer)
fricas --- why not???? Symbol has CoercibleFrom Symbol
Type: Boolean
fricas --- Clue from Waldek,
Type: SExpression?
fricas PRETTYPRINT(q1::Polynomial(Integer))$Lisp
Type: SExpression?
|