Libraries

A library is a file that contains either the specification of a data type or the specification of a set of functions, referred to as a unit.

These libraries, after being defined, can be imported into the applications specifications. This not only allows the user of the tool to reutilize code but also helps the user understand how different data types impact the coordination that is needed by the application more easily.

Examples of library files can be found in the specifications/library directory present in the Git Hub repository.

Data Types

Units

Notes

Example

This is the specifications/library/set.spec file found in the repository.

@type datatype
@name Set


@content

type Set = <a>[a]bool;

function setAdd<a>(element:a, set: Set, oldSet: Set)returns(bool)
{
    (forall <b> e: b :: 
    ((e != element) ==> (set[e] == oldSet[e])) && 
    ((e == element) ==> (set[element] == true)))
}

function setRemove<a>(element:a, set: Set, oldSet: Set)returns(bool)
{
    (forall <b> e: b :: 
    ((e != element) ==> (set[e] == oldSet[e])) && 
    ((e == element) ==> (set[element] == false)))
}

function setIn<a>(element:a, set: Set)returns(bool)
{
    (set[element])
}

@equals forall <a> e: a :: @this[e] == @other[e];