Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » what a class is » ancestor(Type,Type)
next | previous | forward | backward | up | index | toc

# ancestor(Type,Type) -- whether one type is an ancestor of another

- Function: ancestor
- Usage:
    `ancestor(x,y)`
- Inputs:
  - x, a type
  - y, a type
- Outputs:
  - a Boolean value, whether x is an ancestor of y

## Description

The ancestors of y are y, parent y, parent parent y, and so on.

If x is an ancestor of y, then we also say that y is a specialization of x.

    i1 : parent String

    o1 = Net

    o1 : Type

    i2 : parent parent String

    o2 = Thing

    o2 : Type

    i3 : parent parent parent String

    o3 = Thing

    o3 : Type

## See also

- ancestors -- the ancestors of something

## Ways to use this method:

- ancestor(Type,Type) -- whether one type is an ancestor of another

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_types.m2:478:0.