4 bool AlloyBoolSig::encodeAbs = true;
5 bool AlloySetSig::encodeAbs = true;
6 bool AlloyElementSig::encodeAbs = true;
8 AlloyBoolSig::AlloyBoolSig(uint id) :
13 string AlloyBoolSig::toString() const {
14 return "Boolean" + to_string(id) + ".value";
17 string AlloyBoolSig::getSignature() const {
21 str += getAbsSignature();
23 str += "one sig Boolean" + to_string(id) + " extends AbsBool {}";
27 string AlloyBoolSig::getAbsSignature() const {
29 if (AlloySetSig::encodeAbs) {
30 AlloySetSig::encodeAbs = false;
31 str += "abstract sig AbsSet {\
35 str += "one sig BooleanSet extends AbsSet {}{\n\
38 abstract sig AbsBool {\
41 value in BooleanSet.domain\n\
46 AlloyElementSig::AlloyElementSig(uint id, Signature *_ssig) :
52 string AlloyElementSig::toString() const {
53 return "Element" + to_string(id) + ".value";
56 string AlloyElementSig::getSignature() const {
60 str += getAbsSignature();
62 str += "one sig Element" + to_string(id) + " extends AbsElement {}{\n\
63 value in " + *ssig + "\n\
68 string AlloyElementSig::getAbsSignature() const {
69 return "abstract sig AbsElement {\n\
75 AlloySetSig::AlloySetSig(uint id, Set *set) : Signature(id) {
76 ASSERT(set->getSize() > 0);
77 domain = to_string(set->getElement(0));
78 for (uint i = 1; i < set->getSize(); i++) {
79 domain += " + " + to_string(set->getElement(i));
83 string AlloySetSig::toString() const {
84 return "Set" + to_string(id) + ".domain";
87 string AlloySetSig::getSignature() const {
91 str += getAbsSignature();
93 str += "one sig Set" + to_string(id) + " extends AbsSet {}{\n\
94 domain = " + domain + "\n\
99 string AlloySetSig::getAbsSignature() const {
100 return "abstract sig AbsSet {\n\