Currently, FriCAS allows fricas (1) -> (1/x)::UP(x,
Type: UnivariatePolynomial(x,
and fricas (1/x)::UP(x,
Type: UnivariatePolynomial(x,
Bill Page thinks that this is calling for trouble, see issue #270. There are two ways to fix this:
More precisely: For any polynomial (or series) domain that has a specified list of variables, I (Bill Page) want that FriCAS ensures that any coefficient of a member does not contain one of these variables. Examples: (1/x)::UP(x, EXPR INT) x*2^x::UP(x, EXPR INT) (1/x)::UP(x, FRAC POLY INT) (1/x)::UTS(FRAC POLY INT,x,0) all produce an error x*2^y::UP(x, EXPR INT) would be ok. More generally, the "outermost" domain should "take" all the variables: To achieve this, we need to be able to test wether a given element of a given ring contains a specific variable. Unfortunately, this is not as easy as it seems. For example, However for our purposes something rather primitive is sufficient: All domains that contain variables need to export a function if S has variables2: S -> List Symbol then variables2: % -> List Symbol variables2 f == merge(variables2(numer(f)), variables2(denom(f))) and add the following to if R has variables2: R -> List Symbol then coerce(r:R):% == if member?(x, variables2(r)) then error "coefficient contains variable" else coerce(r)$Rep |