Example #1
0
        public override object VisitAnswer_set(DLV2Parser.Answer_setContext context)
        {
            answerSets.AddAnswerSet();

            if (context.cost() != null && !context.cost().IsEmpty)
            {
                costs = new Dictionary <int, int>();
                string[] FirstCost = context.cost().COST_LABEL().GetText().Split(' ')[1].Split('@');

                costs[Int32.Parse(FirstCost[1])] = Int32.Parse(FirstCost[0]);
            }

            if (costs != null)
            {
                foreach (KeyValuePair <int, int> entry in costs)
                {
                    answerSets.StoreCost(entry.Key, entry.Value);
                }
            }

            return(VisitChildren(context));
        }
        public override object VisitAnswer_set(ClingoParser.Answer_setContext context)
        {
            answerSets.AddAnswerSet();

            return(VisitChildren(context));
        }
Example #3
0
        public override object VisitModel(DLVHEXParser.ModelContext context)
        {
            answerSets.AddAnswerSet();

            return(VisitChildren(context));
        }