//化为子句集的九步法演示 //作者:RanchoChan //时间:2010.12.15 //有bug #include #include #include #include using namespace std; //一些函数的定义 void initString(string &ini);//初始化 string del_inlclue(string temp);//消去蕴涵符号 string dec_neg_rand(string temp);//减少否定符号的辖域 string standard_var(string temp);//对变量标准化 string del_exists(string temp);//消去存在量词 string convert_to_front(string temp);//化为前束形 string convert_to_and(string temp);//把母式化为合取范式 string del_all(string temp);//消去全称量词 string del_and(string temp);//消去连接符号合取% string change_name(string temp);//更换变量名称 //辅助函数定义 bool isAlbum(char temp);//是字母 string del_null_bracket(string temp);//删除多余的括号 string del_blank(string temp);//删除多余的空格 void checkLegal(string temp);//检查合法性 char numAfectChar(int temp);//数字显示为字符 //主函数 void main() { cout<<"------------------求子句集九步法演示-----------------------"<P)"; //orign = "~ (#x)y(x)"; //orign = "~ ((@x)x!b(x))"; //orign = "~ (x!y)"; //orign = "~ (~ a(b))"; string orign,temp; char command,command0,command1,command2,command3,command4,command5, command6,command7,command8,command9,command10; //============================================================================= cout<<"请输入(Y/y)初始化谓词演算公式"<>command; if(command == 'y' || command == 'Y') initString(orign); else exit(0); //============================================================================= cout<<"请输入(Y/y)消除空格"<>command0; if(command0 == 'y' || command0 == 'Y') { //del_blank(orign);//undone cout<<"消除空格后是"<