The Create method may only be invoked within the
context of an action method.
GetSort()
The sort (abstract type) of T. Sorts are used to match types across model programs.
Initialize()
Each subtype T of LabeledInstance
must override the Initialize method.
This method resets all of the instance fields of the current object to their initial
values.
Properties
AsTerm
Returns the term representation of this value.
Label
Sort
Returns the sort (abstract type) of this value.
Remarks
You must use a type T that is a subtype of LabeledInstance to program with
objects in NModel. See Chapter 15.
A.3 Action terms
This section explains howto construct and access the terms used to represent actions.
Appendices 307
The Action data type is derived from the underlying data type CompoundTerm that
is derived from Term. It represents an immutable type whose values are actions.
The main methods used to create and access actions are the following. The same
methods can also be used for the CompoundTerm type but are most relevant when
manipulating actions.
Create(string, params IComparable[])
Static method that creates an action with the given string name and an array of
.NET values. Values that are not terms are converted into terms.
For example, Action.Create("A", 5, new Set("c", "b")) creates the
action A(5,Set("c","b")).
Parse(string)
Static method that parses the given string into an action.
Pages:
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395