Next: Grammar record, Previous: IL syntax, Up: Compiler
In this section, we describe how to transform Intermediate Language (IL) expressions into Solver Language (SL) expressions which are used in the XDK solver.
Here is the syntax of IL feature paths:
elem(tag: featurepath root: RootA dimension: VIL dimension_idref: IDA aspect: AspectA fields: FieldCILs)
RootA
is an Oz atom corresponding to the root variable,
VIL
is an IL variable corresponding to the dimension variable,
IDA
is an Oz atom corresponding to the dimension identifier,
AspectA
is an Oz atom corresponding to the aspect, and
FieldCILs
is a list of IL constants corresponding to the fields
of the feature path.
And here is the corresponding SL expression:
featurepath(root: RootA dimension: DVA dimension_idref: IDA aspect: AspectA fields: FieldAs)
RootA
, IDA
and AspectA
stay the same. DVA
is an Oz atom corresponding to VIL
, and FieldAs
is a
list of Oz atoms corresponding to FieldCILs
.
Here is the syntax of IL cardinalities:
elem(tag: 'card.wild' arg: IL) elem(tag: 'card.set' args: IILs) elem(tag: 'card.interval' arg1: IIL1 arg2: IIL2)
And here is the corresponding SL expression:
M
where M
is the Oz finite set encoding the cardinality.
Here is the syntax of IL constants:
elem(tag: constant data: A)
A
is an Oz atom corresponding to the constant itself.
And here is the corresponding SL expression:
I
I
is an Oz integer encoding A
.
Here is the syntax of IL integers:
elem(tag: integer data: I)
I
is an Oz integer corresponding to the integer.
And here is the corresponding SL expression:
I
I
stays the same.
Here is the syntax of IL lists:
elem(tag: list args: ILs)
ILs
is an Oz list of IL expressions.
And here is the corresponding SL expression:
SLs
SLs
is an Oz list of SL expressions encoding ILs
.
Here is the syntax of IL records:
elem(tag: record args: [CIL1#IL1 ... CILn#ILn])
The value of the args
feature is a list of pairs
CILi#ILi
of an IL constant and an IL expression
(1<=i<=n
).
And here is the corresponding SL expression:
o(A1:SL1 ... An:SLn)
Ai
is the Oz atom encoding CILi
, and SLi
the SL
expression encoding ILi
(1<=i<=n
).
Here is the syntax of IL sets:
elem(tag: set args: ILs)
ILs
is an Oz list of IL expressions.
The corresponding SL expression is different depending on the type of the domain of the set:
M
M
is an Oz finite set of integers encoding the constants in the set.
SLs
SLs
is an Oz list of SL expressions encoding ILs
.
Here is the syntax of order generators:
elem(tag: order args: ILs)
ILs
is an Oz list of IL expressions.
The corresponding SL expression is the encoding of the set of all tuples
representing the order relation described by ILs
. For instance,
the encoding of:
elem(tag: order args: [elem(tag: constant data: a) elem(tag: constant data: b) elem(tag: constant data: c)])
is:
elem(tag: set args: [elem(tag: list args: [elem(tag: constant data: a) elem(tag: constant data: b)]) elem(tag: list args: [elem(tag: constant data: a) elem(tag: constant data: c)]) elem(tag: list args: [elem(tag: constant data: b) elem(tag: constant data: c)])])
Here is the syntax of IL strings:
elem(tag: constant data: A)
A
is an Oz atom corresponding to the string.
And here is the corresponding SL expression:
A
A
stays the same.
Here is the syntax of concatenation:
elem(tag: concat args: ILs)
ILs
is an Oz list of IL expressions.
The corresponding SL expression is the concatenation of the IL
expressions ILs
. Concatenation is restricted to strings.
Here is the syntax of IL tuples:
elem(tag: list args: ILs)
The corresponding SL expression is different depending on the type of the projections of the tuple:
I
I
is an Oz integer encoding the tuple.
SLs
SLs
is an Oz list of SL expressions encoding ILs
.
The XDK solver can also yield partial solutions in which not all values in the node record are determined; instead some of the values are still undetermined variables. In the following, we show how these variables are represented in the SL.
This is the SL syntax for undetermined cardinality sets (i.e. cardinality set variables) in valencies:
MSpec1#MSpec2#DSpec
MSpec1
is a set specification representing the set of integers
which are already known to be in the cardinality set variable.
MSpec2
is a set specification representing the set of integers
which could still end up in the cardinality set variable.
DSpec
is a domain specification
representing the set of integers which can still be bound to the
integer variable representing the cardinality of the cardinality set
variable.
This is the SL syntax for undetermined constants (i.e. constant variables):
DSpec
DSpec
is a domain specification, representing the set of
constants which can still be bound to the constant variable.
This is the SL syntax for undetermined integers (i.e. integer variables):
DSpec
DSpec
is a domain specification representing the set of integers
which can still be bound to the integer variable.
This is the SL syntax for undetermined lists (i.e. list variables):
_
The SL syntax for undetermined sets (i.e. set variables) differs depending on the domain of the set:
MSpec1#MSpec2#DSpec
MSpec1
is a set specification, representing the set of constants
which are already known to be in the set variable.
MSpec2
is a set specification representing the set of constants
which could still end up in the set variable.
DSpec
is a domain specification representing the set of integers
which can still be bound to the integer variable representing the
cardinality of the set variable.
_
This is the SL syntax for undetermined strings (i.e. string variables):
_
The SL syntax for undetermined tuples (i.e. tuple variables) differs depending on the projections of the tuple:
DSpec
DSpec
is a domain specification representing the set of tuples
which can still be bound to the tuple variable.
2) Below, we show the SL syntax for undetermined tuples where at least one projection is not a finite domain of constants:
_