Tools

sage.combinat.tools.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.

EXAMPLES:

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]

Previous topic

Low-level multichoose

Next topic

Generators

This Page