# which parent class for C-finite sequences?

Hello, I would like to embed a structure (C-finite sequences) in the Sage ring hierarchy. Fortunately, C-finite sequences are equivalent to the fractions of Laurent polynomials, any fraction is an ordinary generating function for a sequence, and it's a bijection. Now, I'm a bit confused as to the implementation procedure:

Can I just subclass the "right" ring class (FractionField?), and override the members. But which class? Can I create a specific ring class for Laurent polynomial fractions and just call it CFiniteSequenceRing? Maybe I don't even need a new ring, just a class for the elements? If so, is there a way to declare the bijection?

Given that there are P-finite sequences, a superset of the above, what should be done to ensure that they fit into the scheme?

Any hint would be welcome.

**Update:** It turned out that, in order to support combinatorial generating functions as well as multivariate generating functions, the ring of C-Finite Sequences should not be restricted, and the information which generator is associated with the ring element should be in the element. This makes the ring undistinguishable from an abstract fraction field. However, the elements are different from fraction field elements in that they contain more (and in the multivar case mandatory) information.