Beispiel #1
0
        public void TestTwoLevelExcept()
        {
            var input  = @"
				declare goal [ pg ] 
					except [ o1 ] cm1
					except [ o2 ] cm2
					refinedby sg1, sg2
				end
				declare goal [ sg1 ] obstructedby o1 end
				declare goal [ sg2 ] obstructedby o2 end
				declare goal [ cm1 ] obstructedby o3 end
				declare goal [ cm2 ] 
					except [ o4 ] cm4 
					obstructedby o4
				end
				
				declare obstacle [ o1 ] esr .1 end
				declare obstacle [ o2 ] esr .2 end
				declare obstacle [ o3 ] esr .3 end
				declare obstacle [ o4 ] esr .4 end
			"            ;
            var parser = new ModelBuilder();
            var model  = parser.Parse(input);
            var pg     = model.Goal("pg");

            var p0 = new ObstructionSuperset(pg);

            Console.WriteLine(p0.ToDot());

            var p1 = new ObstructionResolutionSuperset(pg);

            Console.WriteLine(p1.ToDot());

            Console.WriteLine("---");
            //var p2 = new BDDBasedPropagator(model);
            //Console.WriteLine(p2.GetESR(pg));

            var p3 = new BDDBasedResolutionPropagator(model);

            Console.WriteLine(p3.GetESR(pg));

            foreach (var e in GetAllCombinations(model.goalRepository.GetGoalExceptions().ToList()))
            {
                Console.Write(string.Join(",", e.Select(x => x.ResolvingGoalIdentifier)) + ": ");
                Console.WriteLine(p3.GetESR(pg, e));
            }
        }
Beispiel #2
0
        public void TestSingleExcept()
        {
            var input  = @"
				declare goal [ pg ] 
					except [ o2 ] cm
					refinedby sg1, sg2
				end
				declare goal [ sg1 ] obstructedby o1 end
				declare goal [ sg2 ] obstructedby o2 end
				declare goal [ cm ] obstructedby o3 end
			"            ;
            var parser = new ModelBuilder();
            var model  = parser.Parse(input);
            var pg     = model.Goal("pg");

            var p1 = new ObstructionResolutionSuperset(pg);

            Console.WriteLine(p1.ToDot());
        }