gfeqns - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


combstruct

  

gfeqns

  

find the system of generating function equations associated with a grammar

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

gfeqns(spec, typ, var, tags)

Parameters

spec

-

combinatorial specification

typ

-

labeling type; 'labeled' or 'unlabeled'

var

-

variable to use in the generating functions

tags

-

(optional) list of lists; each list contains a variable tag followed by the Epsilon nonterminal name(s) associated with that tag

Description

• 

The gfeqns function returns a list of the generating function equations which count the objects described in the specification.

  

Each nonterminal has an associated equation which uses the nonterminal name as the name of the equation. For example, Az would be the generating function for A. The equation is in terms of the other nonterminals.

• 

If the objects are labeled, the exponential generating functions are produced. If the objects are unlabeled, ordinary generating functions are used.

• 

Objects can be marked (tagged) by forming the product of the object with a named Epsilon and associating a tag with that Epsilon.

  

If the tag is a variable name, the resulting generating function equations have an extra variable that marks that object. The same tag can be associated with more than one Epsilon name. The tag does not need to be a variable.

• 

For information on how to write specifications, see combstruct and combstruct[specification]

Examples

withcombstruct:

An example of a labeled binary tree.

treeL=Atom,N=Atom,T=UnionL,ProdN,T,T:

gfeqnstree,labeled,z

Lz=z,Nz=z,Tz=z+zTz2

(1)

Mark the leaf nodes of an unlabeled general tree.

tree1L=Prodleaf,Atom,N=Atom,T=UnionL,ProdN,SetT,leaf=Ε:

gfeqnstree1,unlabeled,z,u,leaf

Lz,u=uz,Nz,u=z,Tz,u=Lz,u+zⅇj1=1Tzj1,uj1j1,leafz,u=u

(2)

Associate the value 2 with the leaves in this labeled general tree.

gfeqnstree1,labeled,z,2,leaf

Lz=2z,Nz=z,Tz=Lz+zⅇTz,leafz=2

(3)

See Also

combstruct

combstruct[gfseries]

combstruct[gfsolve]

combstruct[specification]