Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00038 package theoremprover;
00039
00040 import java.lang.*;
00041 import java.util.*;
00042 import theoremprover.*;
00043
00044
00045 public class LSentence extends LObject
00046 {
00047
00048
00049 public ArrayList rules;
00050
00051
00052
00053 public LSentence()
00054 {
00055 rules = new ArrayList();
00056 }
00057
00058 public LSentence(ArrayList v)
00059 {
00060 rules = v;
00061 }
00062
00063 public void addRules(ArrayList newRules) {
00064 this.rules.addAll(newRules);
00065 }
00066
00067 public void addRules(LSentence new_sentence) {
00068 this.rules.addAll(new_sentence.rules);
00069 }
00070
00071
00072
00073 public String toString()
00074 {
00075 StringBuffer str = new StringBuffer();
00076 Iterator e = rules.iterator();
00077 while (e.hasNext()) {
00078 str.append((e.next()).toString());
00079 str.append("\n\r");
00080 }
00081 return str.toString();
00082 }
00083
00084 public PropositionalTheoremProver asPropositionalSentence()
00085 {
00086 PropositionalTheoremProver tp = new PropositionalTheoremProver();
00087 Hashtable pd = new Hashtable();
00088
00089 Iterator e = rules.iterator();
00090 while (e.hasNext()) {
00091 ((theoremprover.LObject)(e.next())).asPropositionalSentence(tp,pd);
00092 }
00093 return tp;
00094 }
00095
00096
00097 public ABTheoremProver asABPropositionalSentence(ABTheoremProver tp)
00098 {
00099 Hashtable pd = new Hashtable();
00100
00101 Iterator e = rules.iterator();
00102 while (e.hasNext()) {
00103 if (((theoremprover.LObject)(e.next())).asABPropositionalSentence(tp,pd) == null) {
00104 return null;
00105 }
00106 }
00107 return tp;
00108 }
00109
00110
00111
00112 public ArrayList allPredicates(String str)
00113 {
00114 return allPredicates(str,1);
00115 }
00116
00117
00118 public ArrayList allPredicates(String str, int i)
00119 {
00120 ArrayList v = new ArrayList();
00121 Iterator e = rules.iterator();
00122 while (e.hasNext()) {
00123 v = ((theoremprover.LObject)(e.next())).allPredicates(str,i,v);
00124 }
00125 return v;
00126 }
00127
00128 }