Ejemplo n.º 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));
        }