Table of Contents

  1. Requirement
    1. Data Structures
    2. Procedures
    3. Functions
  2. Provides
    1. Procedures
    2. Functions

1 Requirement

Unify.Oz requires a file called "SingleAssignmentStore.oz", which has to provide the following.

1.1 Data Structures

SingleAssignmentStore

A Dictionary of Key#Value tuples.

Keys are numbers.

Values are Oz structures which can be any of:

  • numbers or records.
  • reference(X): used for a reference chain of variables.
  • equivalence(X): represents the value that X is unbound. This has to be guarantee d to be equal for two keys in the same equivalence set.

In addition, the interpreter MUST provide for the environment. Please note that the syntax is now slightly modified: instead of ident(X) for identifiers, we now make it ident(x), the variable now in lower case. The difference between these two is that x is a literal, and hence can be used as a feature of an Oz record. Please see the function SubstituteIdentifiers function in Unify.oz to see how the environment uses the variable name to look up the value.

Environment A record. The features are the variables. The feature values are the SAS keys. (see SubstituteIdentifiers source.)

1.2 Procedures

{BindValueToKeyInSAS Key Val}

If Key is unbound (value is part of an equivalence set) bind Val to a key in the SAS. Should raise an exception alreadyAssigned(Key Val CurrentValue) if the key is bound.

{BindRefToKeyInSAS Key RefKey} If the key is unbound, then bind a reference to another key to a key in the SAS.

1.3 Functions

{AddKeyToSAS} Add a key to the single assignment store. This will return the key that you can associate with your identifier and later assign a value to.
{RetrieveFromSAS Key} Retrieve a value from the single assignment store. This will raise an exception if the key is missing from the SAS. For unbound keys, this will return equivalence(Key) -- this is guaranteed to be the same for two keys in the same equivalence set.

2. Provides

2.1 Procedures

{Unify Expression1 Expression2 Environment}

Unify Expression1 and Expression2 given the mappings in Environment.

Unification Error will raise an incompatibleTypes exception.