Domain

Cord language elements defined here are Domains and the ways of embedding code expressed in C#.

Syntax Definition

Domain ::= Domain + Domain | EmbeddedCode | instances Type | { [ ElementList ] } | CollectionBySizeDomain .
CollectionBySizeDomain = Type [ Literal [ .. Literal ] ] .
ElementList ::= Element { , Element } .
Element ::= Expression [ .. Expression ] .
EmbeddedCode ::= (. CSharpExpr .) | {. CSharpStm .} .

Remarks

Domains in Cord are sets of values of a type. Domains can be unions of other domains (joined by the + operator), embedded C# code (returning an object that implements the IEnumerable interface), a CollectionBySizeDomain, or a list of elements (extensive enumerations or value ranges). Domains for object types can be created only with keyword instances, which are defined as all instances of a class returned in a previous action, or null. Constructor actions must be used to build instances in a model. Domains should be provided only for types used in the implementation. CollectionBySizeDomain denotes a set of collections whose sizes are in the specified range and whose contents are fresh symbolic elements.

There are two notations for Embeddedcode. The (. .) symbols enclose C# expressions; the {. .} symbols enclose C# statements.

See Also

Reference

CordScript
Expression
Type

Concepts

Cord Syntax Definition

Other Resources

Cord Scripting Language