Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AlloyInstance

In Alloy, when you run a predicate or check an assertion, the analyzer searches for an instance of an analysis constraint: an assignment of values to the variables of the constraint for which the constraint evaluates to true [Jackson 2012].

Hierarchy

  • AlloyInstance

Index

Constructors

constructor

  • Create a new Alloy instance. If no text is provided, an empty instance is created.

    Parameters

    • Optional text: string

      A string containing the XML output from an Alloy instance

    Returns AlloyInstance

Methods

atom

  • Get an atom by ID.

    Parameters

    • id: string

      The atom ID

    Returns null | AlloyAtom

    An atom or null if there is no atom with the specified ID

atoms

bitwidth

  • bitwidth(): number

clone

command

  • command(): string

field

  • Get a field by ID.

    Parameters

    • id: string

      The field ID

    Returns null | AlloyField

    A field or null if there is no field with the specified ID

fields

filename

  • filename(): string
  • Get the full path of the model used to generate the instance.

    Returns string

project

  • Project the instance over the specified atoms. There may be a maximum of one atom per signature that is a direct descendant of the univ signature.

    throws

    Error if there is more than one atom provided for any signature that is a direct descendant of the univ signature.

    Parameters

    • atoms: AlloyAtom[]

      The list of atoms over which to project the instance.

    Returns AlloyInstance

    A clone of the instance with the projection applied.

projections

signature

  • Get a signature by ID

    Parameters

    • id: string

      The signature ID

    Returns null | AlloySignature

    A signature or null if there is no signature with the specified ID

signatures

skolem

  • Get a skolem by ID

    Parameters

    • id: string

      The skolem ID

    Returns null | AlloySkolem

    A skolem or null if there is no skolem with the specified ID

skolems

sources

  • sources(): Map<string, string>
  • Get all source files that define the model from which this instance was created.

    Returns Map<string, string>

    A Map object with key-value pairs mapping full path names to file contents

toCytoscape

  • toCytoscape(compound?: boolean): CytoscapeOptions

univ