But it works.

(1) -> gf2 := PrimeField 2

   (1)  PrimeField(2)
          Type: Type
(2) -> gf16 := FiniteFieldExtensionByPolynomial(gf2, x**4 + x + 1)

   (2)  FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)
          Type: Type
(3) -> a := index(2)$gf16

   (3)  %A
          Type: FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)
(4) -> P := Polynomial(gf16)

   (4)  Polynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
          Type: Type
(5) -> p:P := x^2 + 1

         2
   (5)  x  + 1
Type: Polynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
(6) -> eval(p, x::P=a)

          2
   (6)  %A  + 1
Type: Polynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))

The problem is rather that eval requires an element of type Equation(%) as the second argument.

(7) -> )sh P
 [-- snip --]
 eval : (%,List(Equation(%))) -> %
eval : (%,List(Symbol),List(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))) -> %
 eval : (%,List(Symbol),List(%)) -> %
 eval : (%,List(%),List(%)) -> %
eval : (%,Symbol,FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)) -> %
 [-- snap --]

Obviously, if one works over Integer, the FriCAS interpreter is able to lift, But not in the case of gf16.

(7) -> x=1

   (7)  x= 1
             Type: Equation(Polynomial(Integer))
(8) -> x=a
   There are 3 exposed and 0 unexposed library operations named
      equation having 2 argument(s) but none was determined to be
      applicable. Use HyperDoc Browse, or issue
                            )display op equation
      to learn more about the available operations. Perhaps
      package-calling the operation or using coercions on the arguments
      will allow you to apply the operation.

   Cannot find a definition or applicable library operation named
      equation with argument type(s)
                                 Variable(x)
           FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)

      Perhaps you should use "@" to indicate the required return type,
      or "$" to specify which version of the function you need.

Some experiments brought me to the conclusion that the x is the problem.
But, in fact, both work

(8) -> x=a::P

   (8)  x= %A
Type: Equation(Polynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)))
(9) -> x::P=a

   (9)  x= %A
Type: Equation(Polynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1

The 3-argument eval is different. It wants a symbol as the second parameter and explicitly an element of gf16 as the third argument (see last eval signature above). Still the result will live in P not gf16, so Bill's coerce is necessary depending on what result type Paul actually wants.

Ralf

--
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