예제 #1
0
 public OrIterator(LogExpr logExpr, Agent ag, Unifier un)
 {
     this.logExpr = logExpr;
     this.ag      = ag;
     this.un      = un;
     ileft        = (OrIterator <Unifier>)logExpr.GetLHS().LogicalConsequence(ag, un);
 }
예제 #2
0
 private InternalActionLiteral CheckInternalActionsInContext(ILogicalFormula f, Agent ag)
 {
     if (f != null)
     {
         if (f.GetType() == typeof(InternalActionLiteral))
         {
             InternalActionLiteral ial = (InternalActionLiteral)f;
             if (!ial.GetIA(ag).CanBeUsedInContext())
             {
                 return(ial);
             }
         }
         else if (f.GetType() == typeof(LogExpr))
         {
             LogExpr le = (LogExpr)f;
             InternalActionLiteral ial = CheckInternalActionsInContext(le.GetLHS(), ag);
             if (ial != null)
             {
                 return(ial);
             }
             if (!le.IsUnary())
             {
                 return(CheckInternalActionsInContext(le.GetRHS(), ag));
             }
         }
     }
     return(null);
 }