adding cs236
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#ifndef __RULE_H__
|
||||
#define __RULE_H__
|
||||
|
||||
#include "predicate.h"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class rule {
|
||||
public:
|
||||
predicate head;
|
||||
vector<predicate> pred_rule;
|
||||
string toString() {
|
||||
stringstream s;
|
||||
s << head.toString(1) << " :- ";
|
||||
for(unsigned int i = 0; i < pred_rule.size(); i++) {
|
||||
s << pred_rule[i].toString(1);
|
||||
if(i < pred_rule.size()-1) {
|
||||
s << ",";
|
||||
}
|
||||
}
|
||||
s << ".\n";
|
||||
return s.str();
|
||||
}
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user