18.36 Tools

Module: sage.combinat.tools

Tools

Module-level Functions

transitive_ideal( f, x)

Given an initial value x and a successor function f, return a list containing x and all of its successors. The successor function should return a list of all the successors of f.

Note that if x has an infinite number of successors, transitive_ideal won't return.

sage: f = lambda x: [x-1] if x > 0 else []
sage: sage.combinat.tools.transitive_ideal(f, 10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

See About this document... for information on suggesting changes.