Beispiel #1
0
		public bool ttCheckAll(Sentence kbSentence, Sentence querySentence,
			ArrayList symbols, Model model) 
		{
			if (symbols.Count == 0) 
			{
				if (model.isTrue(kbSentence)) 
				{
					//System.out.println("#");
					return model.isTrue(querySentence);
				} 
				else 
				{
					//System.out.println("0");
					return true;
				}
			} 
			else 
			{
				Symbol symbol = (Symbol)Util.first(symbols);
				ArrayList rest = Util.rest(symbols);

				Model trueModel = model.extend(new Symbol(symbol.getValue()), true);
				Model falseModel = model.extend(new Symbol(symbol.getValue()),
					false);
				return (ttCheckAll(kbSentence, querySentence, rest, trueModel) && (ttCheckAll(
					kbSentence, querySentence, rest, falseModel)));
			}
		}
Beispiel #2
0
		public Model extend(string s, bool b) 
		{
			Model m = new Model();
			//iterator i = this.h.keySet().iterator();
			//while (i.hasNext()) 
			foreach (string key in this.h.Keys)
			{
				//String key = i.next();
				bool value = (bool)h[key];
				string newKey = new string(((string) key).ToCharArray());
//				if (value == null) 
//				{
//					throw new Exception();
//				}
				m.h.Add(key, value);
			}
			m.h.Add(s, b);
			return m;
		}
Beispiel #3
0
		public Model extend(Symbol symbol, bool b) 
		{
			Model m = new Model();
			return extend(symbol.getValue(),b);
		}