[Avida-SVN] r2287 - branches/uml/source/main
hjg at myxo.css.msu.edu
hjg at myxo.css.msu.edu
Tue Jan 29 10:17:44 PST 2008
Author: hjg
Date: 2008-01-29 13:17:43 -0500 (Tue, 29 Jan 2008)
New Revision: 2287
Modified:
branches/uml/source/main/cMDEAbsenceProperty.cc
branches/uml/source/main/cMDEAbsenceProperty.h
branches/uml/source/main/cMDEExistenceProperty.cc
branches/uml/source/main/cMDEExistenceProperty.h
branches/uml/source/main/cMDEPrecedenceProperty.cc
branches/uml/source/main/cMDEPrecedenceProperty.h
branches/uml/source/main/cMDEProperty.cc
branches/uml/source/main/cMDEProperty.h
branches/uml/source/main/cMDEResponseProperty.cc
branches/uml/source/main/cMDEResponseProperty.h
branches/uml/source/main/cMDEUniversalProperty.cc
branches/uml/source/main/cMDEUniversalProperty.h
Log:
Print the properties in English.
Modified: branches/uml/source/main/cMDEAbsenceProperty.cc
===================================================================
--- branches/uml/source/main/cMDEAbsenceProperty.cc 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEAbsenceProperty.cc 2008-01-29 18:17:43 UTC (rev 2287)
@@ -70,9 +70,23 @@
// if this property passed, then save it to a file
if (verify_reward) {
- cmd = "cat property >> " + work_prop;
+ cmd = "cat english-property >> " + work_prop;
system(cmd.c_str());
}
_reward = verify_reward;
}
+
+
+void cMDEAbsenceProperty::printInEnglish() {
+
+ std::ofstream outfile;
+ std::string file_name = "english-property";
+ outfile.open (file_name.c_str());
+ assert(outfile.is_open());
+
+ outfile << "Globally, it is never the case that " << _expr_p << " holds." << std::endl << std::endl;
+
+ outfile.close();
+
+}
\ No newline at end of file
Modified: branches/uml/source/main/cMDEAbsenceProperty.h
===================================================================
--- branches/uml/source/main/cMDEAbsenceProperty.h 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEAbsenceProperty.h 2008-01-29 18:17:43 UTC (rev 2287)
@@ -26,6 +26,7 @@
virtual ~cMDEAbsenceProperty() {}
void print(); // { std::cout << _scope << " " << _expr_p << std::endl; }
void printWitness(); // { std::cout << _scope << " " << _expr_p << std::endl; }
+ void printInEnglish();
void evaluate();
std::string getPropertyType() { return "Absence"; }
std::string getPropertyParameters() { return _expr_p; }
Modified: branches/uml/source/main/cMDEExistenceProperty.cc
===================================================================
--- branches/uml/source/main/cMDEExistenceProperty.cc 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEExistenceProperty.cc 2008-01-29 18:17:43 UTC (rev 2287)
@@ -50,3 +50,15 @@
}
+void cMDEExistenceProperty::printInEnglish() {
+
+ std::ofstream outfile;
+ std::string file_name = "english-property";
+ outfile.open (file_name.c_str());
+ assert(outfile.is_open());
+
+ outfile << "Globally, " << _expr_p << " eventually holds." << std::endl<< std::endl;
+
+ outfile.close();
+
+}
\ No newline at end of file
Modified: branches/uml/source/main/cMDEExistenceProperty.h
===================================================================
--- branches/uml/source/main/cMDEExistenceProperty.h 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEExistenceProperty.h 2008-01-29 18:17:43 UTC (rev 2287)
@@ -29,6 +29,7 @@
void print(); // { std::cout << _scope << " " << _expr_p << std::endl; }
void printWitness(); // { std::cout << _scope << " " << _expr_p << std::endl; }
+ void printInEnglish();
std::string getPropertyType() { return "Existence"; }
std::string getPropertyParameters() { return _expr_p; }
Modified: branches/uml/source/main/cMDEPrecedenceProperty.cc
===================================================================
--- branches/uml/source/main/cMDEPrecedenceProperty.cc 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEPrecedenceProperty.cc 2008-01-29 18:17:43 UTC (rev 2287)
@@ -77,3 +77,17 @@
}
+void cMDEPrecedenceProperty::printInEnglish() {
+
+ std::ofstream outfile;
+ std::string file_name = "english-property";
+ outfile.open (file_name.c_str());
+ assert(outfile.is_open());
+
+ outfile << "Globally, it is always the case that if " << _expr_p << " holds, ";
+ outfile << "then "<< _expr_q << " previously held." << std::endl << std::endl;
+
+ outfile.close();
+
+}
+
Modified: branches/uml/source/main/cMDEPrecedenceProperty.h
===================================================================
--- branches/uml/source/main/cMDEPrecedenceProperty.h 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEPrecedenceProperty.h 2008-01-29 18:17:43 UTC (rev 2287)
@@ -32,6 +32,7 @@
void print();
void printWitness();
+ void printInEnglish();
std::string getPropertyType() { return "Precedence"; }
std::string getPropertyParameters() { return (_expr_p + " " + _expr_q); }
Modified: branches/uml/source/main/cMDEProperty.cc
===================================================================
--- branches/uml/source/main/cMDEProperty.cc 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEProperty.cc 2008-01-29 18:17:43 UTC (rev 2287)
@@ -82,8 +82,9 @@
// if this property passed, then save it to a file
if (verify_reward) {
+ printInEnglish();
// cmd = "cat " + _name + " >> " + work_prop;
- cmd = "cat property >> " + work_prop;
+ cmd = "cat english-property >> " + work_prop;
system(cmd.c_str());
}
Modified: branches/uml/source/main/cMDEProperty.h
===================================================================
--- branches/uml/source/main/cMDEProperty.h 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEProperty.h 2008-01-29 18:17:43 UTC (rev 2287)
@@ -21,6 +21,7 @@
// A function that prints the property to a file.
virtual void print() = 0;
virtual void printWitness() = 0;
+ virtual void printInEnglish() =0;
virtual std::string getPropertyType() = 0;
virtual std::string getPropertyParameters() { return ""; }
Modified: branches/uml/source/main/cMDEResponseProperty.cc
===================================================================
--- branches/uml/source/main/cMDEResponseProperty.cc 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEResponseProperty.cc 2008-01-29 18:17:43 UTC (rev 2287)
@@ -63,3 +63,17 @@
}
+
+void cMDEResponseProperty::printInEnglish() {
+
+ std::ofstream outfile;
+ std::string file_name = "english-property";
+ outfile.open (file_name.c_str());
+ assert(outfile.is_open());
+
+ outfile << "Globally, it is always the case that if " << _expr_p << " holds, ";
+ outfile << "then "<< _expr_q << " eventually holds." << std::endl << std::endl;
+
+ outfile.close();
+
+}
Modified: branches/uml/source/main/cMDEResponseProperty.h
===================================================================
--- branches/uml/source/main/cMDEResponseProperty.h 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEResponseProperty.h 2008-01-29 18:17:43 UTC (rev 2287)
@@ -32,6 +32,7 @@
void print();
void printWitness();
+ void printInEnglish();
std::string getPropertyType() { return "Response"; }
std::string getPropertyParameters() { return (_expr_p + " " + _expr_q); }
Modified: branches/uml/source/main/cMDEUniversalProperty.cc
===================================================================
--- branches/uml/source/main/cMDEUniversalProperty.cc 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEUniversalProperty.cc 2008-01-29 18:17:43 UTC (rev 2287)
@@ -69,7 +69,7 @@
// if this property passed, then save it to a file
if (verify_reward) {
// cmd = "cat " + _name + " >> " + work_prop;
- cmd = "cat property >> " + work_prop;
+ cmd = "cat english-property >> " + work_prop;
system(cmd.c_str());
}
@@ -78,3 +78,15 @@
+void cMDEUniversalProperty::printInEnglish() {
+
+ std::ofstream outfile;
+ std::string file_name = "english-property";
+ outfile.open (file_name.c_str());
+ assert(outfile.is_open());
+
+ outfile << "Globally, it is always the case that " << _expr_p << " holds." << std::endl << std::endl;
+
+ outfile.close();
+
+}
\ No newline at end of file
Modified: branches/uml/source/main/cMDEUniversalProperty.h
===================================================================
--- branches/uml/source/main/cMDEUniversalProperty.h 2008-01-29 14:41:47 UTC (rev 2286)
+++ branches/uml/source/main/cMDEUniversalProperty.h 2008-01-29 18:17:43 UTC (rev 2287)
@@ -26,6 +26,7 @@
virtual ~cMDEUniversalProperty() {}
void print(); // { std::cout << _scope << " " << _expr_p << std::endl; }
void printWitness(); // { std::cout << _scope << " " << _expr_p << std::endl; }
+ void printInEnglish();
void evaluate();
std::string getPropertyType() { return "Universal"; }
std::string getPropertyParameters() { return _expr_p; }
More information about the Avida-cvs
mailing list