Class ACSet

An acset consists of a collection of tables, one for every object in the schema.

The rows of the tables are called "parts", and the cells of the rows are called "subparts".

One can get all of the parts corresponding to an object, add parts, get the subparts, and set the subparts. Removing parts is currently unsupported.

Hierarchy

  • ACSet

Constructors

  • Initialize a new ACSet.

    Parameters

    • name: string

      The name of the ACSset.

    • schema: Schema

      The schema of the ACSet.

    Returns ACSet

Properties

_parts: Map<Ob, number>
_subparts: Map<Property, Map<number, any>>
name: string
schema: Schema

Methods

  • Add a single part to an object in the ACSet

    Parameters

    • ob: Ob

      The object in the ACSet to add a part to.

    Returns number

    The index of the new part added to the object.

  • Add n parts to an object in the ACset.

    Parameters

    • ob: Ob

      The object in the ACSet to add parts to.

    • n: number

      The number of parts to be added.

    Returns [number, number]

    A range of the indexes of the new parts added to the object.

  • Parameters

    • ob: Ob
    • i: number

    Returns ExportedPart

  • Checks whether a certain part exists in the ACSet

    Parameters

    • ob: Ob
    • i: number

    Returns boolean

  • Check if a property exists for a given row in a table of the ACSset.

    Parameters

    • i: number

      The row index for the property mapping to be added to.

    • f: Property

      The Hom or Attr to check for.

    Returns boolean

  • Parameters

    • ob: Ob
    • exported: ExportedPart

    Returns void

  • Get all of the subparts incident to a part in the ACset.

    Parameters

    • x: any

      The subpart to look for.

    • f: Property

      The Hom or Attr mapping to search.

    Returns number[]

    A list indexes.

  • Get the number of rows in a given table of the ACSet.

    Parameters

    • ob: Ob

      The object in the ACSet.

    Returns number

    The number of rows in ob.

  • Parameters

    Returns number[]

  • Get all of the row indexes in a given table of the ACSet.

    Parameters

    • ob: Ob

      The object in the ACSet.

    Returns [number, number]

    The range of all of the rows in ob.

  • Modify a morphism or attribute for a row in a table of the ACSet.

    Parameters

    • i: number

      The row index for the property mapping to be added to.

    • f: Property

      The Hom or Attr to modify.

    • x: any

      A valid type for the given Hom or Attr to set the value or None to delete the property.

    Returns void

  • Get the subpart of a part in an ACSet

    Parameters

    • i: number

      The part that you are indexing.

    • f: Property

      The Hom or Attr to retrieve.

    Returns any

    The subpart of the ACset.

  • Deserialize a JSON object to an ACSet with a given Schema.

    Parameters

    • name: string

      The name of the ACSset.

    • schema: Schema

      The Schema of the ACSet that is defined in the given JSON.

    • exported: ExportedACSet

    Returns ACSet

    The deserialized ACSet object.

Generated using TypeDoc