PrintWarning() private method

private PrintWarning ( string formatString ) : void
formatString string
return void
Ejemplo n.º 1
0
        private void WalkGoal(KnowledgeBase kb, KnowledgeBaseRule rule, object goal)
        {
            goal = Term.Deref(goal);
            var atom = goal as Symbol;

            if (atom != null)
            {
                var p = new PredicateIndicator(atom, 0);
                if (PrologPrimitives.IsDefined(p))
                {
                    return;
                }
                var predicate = kb.CheckForPredicateInfo(p);
                if (predicate == null)
                {
                    rule.PrintWarning("undefined predicate {0}", p);
                }
                else
                {
                    MarkReferenced(predicate);
                }
            }
            else
            {
                var s = goal as Structure;
                if (s != null)
                {
                    WalkGoal(kb, rule, s);
                }
                else if (!(goal is LogicVariable) && !(goal is bool))
                {
                    rule.PrintWarning("malformed goal: {0}", goal);
                }
            }
        }
Ejemplo n.º 2
0
 void ReallyCheck()
 {
     WalkKB(KnowledgeBase.Global);
     foreach (var component in UnityEngine.Object.FindObjectsOfType <KB>())
     {
         WalkKB(component.KnowledgeBase);
     }
     foreach (var pair in checkerInfoTable)
     {
         var checkerInfo = pair.Value;
         if (!checkerInfo.Referenced)
         {
             KnowledgeBaseRule rule   = checkerInfo.DefiningRule;
             PredicateInfo     global = KnowledgeBase.Global.CheckForPredicateInfo(new PredicateIndicator(rule.HeadFunctor, rule.HeadArity));
             if (global == null || !global.External)
             {
                 rule.PrintWarning("{0}/{1} is never used.", rule.HeadFunctor, rule.HeadArity);
             }
         }
     }
 }
Ejemplo n.º 3
0
 private void WalkGoal(KnowledgeBase kb, KnowledgeBaseRule rule, object goal)
 {
     goal = Term.Deref(goal);
     var atom = goal as Symbol;
     if (atom != null)
     {
         var p = new PredicateIndicator(atom, 0);
         if (PrologPrimitives.IsDefined(p))
             return;
         var predicate = kb.CheckForPredicateInfo(p);
         if (predicate == null)
             rule.PrintWarning("undefined predicate {0}", p);
         else
             MarkReferenced(predicate);
     }
     else
     {
         var s = goal as Structure;
         if (s != null)
             WalkGoal(kb, rule, s);
         else if (!(goal is LogicVariable) && !(goal is bool))
             rule.PrintWarning("malformed goal: {0}", goal);
     }
 }
Ejemplo n.º 4
0
 private void WarnUndefined(KnowledgeBaseRule rule,Symbol functor,int arity)
 {
     rule.PrintWarning("{0}/{1} undefined", functor, arity);
 }
Ejemplo n.º 5
0
 private void WarnUndefined(KnowledgeBaseRule rule, Symbol functor, int arity)
 {
     rule.PrintWarning("{0}/{1} undefined", functor, arity);
 }