public void PL1_Setup()
        {
            BivalenceWorld world     = new BivalenceWorld();
            WorldParameter parameter = CreateBiggerParameter();

            world.Check(parameter);

            PL1Structure structure = world.GetPl1Structure();

            _predDictionary  = structure.GetPredicates();
            _constDictionary = structure.GetConsts();
            _funcDictionary  = structure.GetFunctions();
        }
示例#2
0
        public void PL1_Constants_True()
        {
            BivalenceWorld world     = new BivalenceWorld();
            WorldParameter parameter = CreateTestParmeter();

            world.Check(parameter);

            PL1Structure structure = world.GetPl1Structure();

            ConstDictionary     consts = structure.GetConsts();
            PredicateDictionary preds  = structure.GetPredicates();

            Assert.AreEqual(consts["a"], "u0");
            Assert.AreEqual(consts["c"], "u0");
            Assert.AreEqual(consts["b"], "u1");
            Assert.AreEqual(consts["d"], "u2");
        }
示例#3
0
        public void PL1_NoConstants()
        {
            List <WorldObject> worldObjects = new List <WorldObject>
            {
                new WorldObject(new List <string> {
                }, new List <string> {
                    BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE
                }, null),
                new WorldObject(new List <string> {
                    ""
                }, new List <string> {
                    BivalenceWorldDataFields.TET, BivalenceWorldDataFields.SMALL
                }, null),
                new WorldObject(new List <string> {
                }, new List <string> {
                    BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE
                }, null),
                new WorldObject(new List <string> {
                }, new List <string> {
                    BivalenceWorldDataFields.CUBE
                }, null)
            };


            BivalenceWorld world = new BivalenceWorld();

            world.Check(new WorldParameter(worldObjects, null));

            PL1Structure        structure = world.GetPl1Structure();
            ConstDictionary     consts    = structure.GetConsts();
            PredicateDictionary preds     = structure.GetPredicates();

            Assert.AreEqual(consts["n0"], "u0");
            Assert.AreEqual(consts["n1"], "u1");
            Assert.AreEqual(consts["n2"], "u2");
            Assert.AreEqual(consts["n3"], "u3");
        }
 public PL1DataStructure(ConstDictionary @const, PredicateDictionary predicates, FunctionDictionary functions)
 {
     _const      = @const;
     _predicates = predicates;
     _functions  = functions;
 }