
## References 47

<instance>
<presentation name="ExampleWCSP" format="XCSP 2.1" type="WCSP">
This is a WCSP instance.

</presentation> <domains nbDomains="1">
<domain name="D0" nbValues="3">0..2</domain>
</domains>
<variables nbVariables="4">
<variable name="V0" domain="D0"/>
<variable name="V1" domain="D0"/> <variable name="V2" domain="D0"/>
<variable name="V3" domain="D0"/>
</variables>
<relations nbRelations="6">
<relation name="R0" arity="2" nbTuples="10" semantics="soft" defaultCost="0">
5:0 0|0 1|1 0|1 1|1 2|2 1|2 2|2 3|3 2|3 3
</relation>
<relation name="R1" arity="1" nbTuples="2" semantics="soft" defaultCost="0">
1:1|3
</relation> <relation name="R2" arity="1" nbTuples="2" semantics="soft" defaultCost="0">
1:1|2
</relation> <relation name="R3" arity="1" nbTuples="2" semantics="soft" defaultCost="0">
1:0|2
</relation>
</relations>
<functions nbFunctions="2">
<function name="F0" return="int">
<parameters> int X int Y </parameters>
<expression>
<functional> if(eq(X,Y),0,5) </functional>
</expression>
</function>
<function name="F1" return="int">
<parameters> int X int Y int Z </parameters> <expression>
<functional> if(gt(mul(add(X,Y),Z),5),0,2) </functional>
</expression>
</function>
</functions>
<constraints nbConstraints="7" initialCost="0" maximalCost="5">
<constraint name="C0" arity="2" scope="V0 V1" reference="R0" />
<constraint name="C1" arity="2" scope="V0 V2" reference="F0 /> <constraint name="C2" arity="3" scope="V1 V2 V3" reference="F1" />
<constraint name="C3" arity="1" scope="V0" reference="R1" />
<constraint name="C4" arity="1" scope="V1" reference="R2" /> <constraint name="C5" arity="1" scope="V2" reference="R3" />
</constraints>
</instance>
Figure 12: A WCSP instance