Пример #1
0
        private AbstractPredicate GetAbstractPredicate(PlanningParser.AtomicFormulaTermContext context)
        {
            string            abstractPredName = GetFullName(context);
            AbstractPredicate result           = _abstractPredDict[abstractPredName];

            return(result);
        }
Пример #2
0
        private Tuple <AbstractPredicate, bool> GetAbstractLiteral(PlanningParser.LiteralTermContext context)
        {
            AbstractPredicate abstractPredicate = GetAbstractPredicate(context.atomicFormulaTerm());
            bool isPositive = context.NOT() == null;

            return(new Tuple <AbstractPredicate, bool>(abstractPredicate, isPositive));
        }
Пример #3
0
        private CUDDNode GetCuddNode(PlanningParser.AtomicFormulaTermContext context)
        {
            AbstractPredicate abstractPredicate = GetAbstractPredicate(context);
            int      index  = abstractPredicate.CuddIndex;
            CUDDNode result = CUDD.Var(index);

            return(result);
        }
Пример #4
0
        private AbstractPredicate CreateAbstractPredicate(PlanningParser.AtomicFormulaTermContext context, IReadOnlyDictionary <string, Predicate> predDict)
        {
            List <string> constantList = new List <string>();

            for (int i = 0; i < context.term().Count; i++)
            {
                constantList.Add(context.term()[i].GetText());
            }

            AbstractPredicate abstractPredicate = new AbstractPredicate(constantList);

            abstractPredicate.Predicate = predDict[context.predicate().GetText()];
            return(abstractPredicate);
        }