Ejemplo n.º 1
0
        public static Model getModel(String file)
        {
            //test class Model and class Z3Checker.
            Model model = new Model(2, 2);

            model.addEvent("e0 Bool true");
            model.addEvent("e1 Bool false");
            model.addStatu("s0 Bool true");
            model.addStatu("s1 Bool false");
            model.addOther("v0 Int 0");
            model.addOther("v1 Int 0");
            model.addOther("v2 Int 0");

            model.cells = new Cell[4];

            Cell tempCell0 = new Cell("s0", "e0");
            PS   p0        = new PS(model.getVarName());

            p0.addThen("= v0 100");
            p0.addThen("= v1 0");
            p0.addThen("= v2 0");
            p0.addThen("= e0 true");
            p0.addThen("= e1 false");
            p0.addThen("= s0 false");
            p0.addThen("= s1 true");
            tempCell0.addProcess(p0);
            model.cells[0] = tempCell0;

            Cell tempCell1 = new Cell("s0", "e1");
            PS   p1        = new PS(model.getVarName());

            p1.addThen("= v1 (+ v1 v2)");
            p1.addThen("= v0 (- v0 v2)");
            p1.addThen("= e0 true");
            p1.addThen("= e1 false");
            p1.addThen("= s0 false");
            p1.addThen("= s1 true");

            tempCell1.addProcess(p1);
            model.cells[1] = tempCell1;

            Cell tempCell2 = new Cell("s1", "e0");
            PS   p2        = new PS(model.getVarName());

            p2.addThen("= v1 10");
            p2.addThen("= v2 (+ v2 1)");
            p2.addThen("= v0 (- v0 v1)");
            p2.addThen("= e0 false");
            p2.addThen("= e1 true");
            p2.addThen("= s0 false");
            p2.addThen("= s1 true");
            tempCell2.addProcess(p2);
            model.cells[2] = tempCell2;

            Cell tempCell3 = new Cell("s1", "e1");
            PS   p3        = new PS(model.getVarName());

            p3.addThen("= v1 (- v1 1)");
            p3.addThen("= e0 false");
            p3.addThen("= e1 true");
            p3.addThen("= s0 true");
            p3.addThen("= s1 false");
            tempCell3.addProcess(p3);
            model.cells[3] = tempCell3;



            return(model);
        }
Ejemplo n.º 2
0
 public void addProcess(PS p)
 {
     this.p = p;
 }