bool AlloySetSig::encodeAbs = true;
bool AlloyElementSig::encodeAbs = true;
-AlloyBoolSig::AlloyBoolSig(uint id):
+AlloyBoolSig::AlloyBoolSig(uint id) :
ValuedSignature(id)
{
}
-string AlloyBoolSig::toString() const{
+string AlloyBoolSig::toString() const {
return "Boolean" + to_string(id) + ".value";
}
-string AlloyBoolSig::getSignature() const{
+string AlloyBoolSig::getSignature() const {
string str;
- if(encodeAbs){
+ if (encodeAbs) {
encodeAbs = false;
str += getAbsSignature();
}
return str;
}
-string AlloyBoolSig::getAbsSignature() const{
+string AlloyBoolSig::getAbsSignature() const {
string str;
- if(AlloySetSig::encodeAbs){
+ if (AlloySetSig::encodeAbs) {
AlloySetSig::encodeAbs = false;
str += "abstract sig AbsSet {\
domain: set Int\
}\n";
}
- str +="one sig BooleanSet extends AbsSet {}{\n\
+ str += "one sig BooleanSet extends AbsSet {}{\n\
domain = 0 + 1 \n\
}\n\
abstract sig AbsBool {\
return str;
}
-AlloyElementSig::AlloyElementSig(uint id, Signature *_ssig):
+AlloyElementSig::AlloyElementSig(uint id, Signature *_ssig) :
ValuedSignature(id),
ssig(_ssig)
{
}
-string AlloyElementSig::toString() const{
+string AlloyElementSig::toString() const {
return "Element" + to_string(id) + ".value";
}
-string AlloyElementSig::getSignature() const{
+string AlloyElementSig::getSignature() const {
string str;
- if(encodeAbs){
+ if (encodeAbs) {
encodeAbs = false;
str += getAbsSignature();
}
return str;
}
-string AlloyElementSig::getAbsSignature() const{
+string AlloyElementSig::getAbsSignature() const {
return "abstract sig AbsElement {\n\
value: Int\n\
}\n";
-
+
}
-AlloySetSig::AlloySetSig(uint id, Set *set): Signature(id){
+AlloySetSig::AlloySetSig(uint id, Set *set) : Signature(id) {
ASSERT(set->getSize() > 0);
domain = to_string(set->getElement(0));
- for(uint i=1; i< set->getSize(); i++){
+ for (uint i = 1; i < set->getSize(); i++) {
domain += " + " + to_string(set->getElement(i));
}
}
-string AlloySetSig::toString() const{
+string AlloySetSig::toString() const {
return "Set" + to_string(id) + ".domain";
}
-string AlloySetSig::getSignature() const{
+string AlloySetSig::getSignature() const {
string str;
- if(encodeAbs){
+ if (encodeAbs) {
encodeAbs = false;
str += getAbsSignature();
}
return str;
}
-string AlloySetSig::getAbsSignature() const{
+string AlloySetSig::getAbsSignature() const {
return "abstract sig AbsSet {\n\
domain: set Int\n\
}\n";
-
+
}