Exemplo n.º 1
0
 public void Bool(string name, Dictionary <string, RDElement> dict, object factPool, Rule rule, Action <int> callBack, int callBackID)
 {
     dict[name] = new RDBool(false);
     callBack.Invoke(callBackID);
     dict[name] = new RDBool(true);
     callBack.Invoke(callBackID);
     dict.Remove(name);
 }
Exemplo n.º 2
0
 public RDBool Or(RDBool lhs, RDBool rhs, object factPool)
 {
     if (lhs.Data)
     {
         return(lhs);
     }
     else
     {
         return(rhs);
     }
 }
Exemplo n.º 3
0
 public virtual bool IsConstant(Formula formula, out RDElement result)
 {
     if (formula.Parameters == null)
     {
         int res = 0;
         if (formula.OperationName == "TRUE")
         {
             result = new RDBool(true);
             return(true);
         }
         if (formula.OperationName == "FALSE")
         {
             result = new RDBool(false);
             return(true);
         }
         if (int.TryParse(formula.OperationName, out res))
         {
             result = new RDNumber(res);
             return(true);
         }
     }
     result = null;
     return(false);
 }
Exemplo n.º 4
0
 public RDBool And(RDBool rhs)
 {
     return(new RDBool(Data && rhs.Data));
 }
Exemplo n.º 5
0
 public RDBool Or(RDBool rhs)
 {
     return(new RDBool(Data || rhs.Data));
 }
Exemplo n.º 6
0
 public RDBool Not(RDBool rhs, object factPool)
 {
     return(rhs.Not());
 }