Evaluating a polynomial using the computer algebra system Singular

157 Views Asked by At

I recently started learning the computer algebra system Singular. Working through some early exercises of the book "A Singular introduction to Commutative Algebra" by Gert-Martin Greuel and Gerhard Pfister I wasn't able to find way to actually evaluate a polynomial defined in a arbitrary ring.
Using the online manual as well as looking through some Singular-libraries wasn't helpfull at all for me finding any procedure or way to evaluate a polynomial.

It seems that's either impossible or it is so obvious that there is no hint in the book and the manual how to do this.

I'm sure there must be a way to do such things in a computer algebra system like Singular?


An example what I'm aiming to do:

After defining a ring, such as

ring A = 0,(x,y),dp;
poly f = x2 + y;

Now calling

f(1,2);

leads to

? `f(1)` is undefined
? error occurred in or before STDIN line 3: `f(1,2);`

Any usual/intuitive way of setting values to the variables x and y like

x := 1; 

with or without the dots causes the error:

? error occurred in or before STDIN line 4: `x:=1;`
skipping text from `1`
1

There are 1 best solutions below

0
On BEST ANSWER

I think I figured it out. The way to go is using the function subst like this:

ring A = 0,(x,y), dp;
poly f = x2 + y; 
subst(f,x,1,y,2);

which will result in

3