Contains the source code from the course work throughout my undergraduate Computer Engineering degree at Brigham Young University. There is a mixture of Go, Python, C, C++, Java, VHDL, Verilog, Matlab, Bash, Assembly, etc..
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rule.h 601B

123456789101112131415161718192021222324252627
  1. #ifndef __RULE_H__
  2. #define __RULE_H__
  3. #include "predicate.h"
  4. #include <vector>
  5. #include <iostream>
  6. using namespace std;
  7. class rule {
  8. public:
  9. predicate head;
  10. vector<predicate> pred_rule;
  11. string toString() {
  12. stringstream s;
  13. s << head.toString(1) << " :- ";
  14. for(unsigned int i = 0; i < pred_rule.size(); i++) {
  15. s << pred_rule[i].toString(1);
  16. if(i < pred_rule.size()-1) {
  17. s << ",";
  18. }
  19. }
  20. s << ".\n";
  21. return s.str();
  22. }
  23. };
  24. #endif