Example #1
0
        public void NelsonOppenExample1()
        {
            SepProver.out_form f =
                SepProver.out_form.Pred("==",
                                        Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                            SepProver.out_term.Fun("f",
                                                                   Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                       SepProver.out_term.String("(i4,i4)i4"),
                                                                       Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                           SepProver.out_term.PVar("i4:a"),
                                                                           Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                               SepProver.out_term.PVar("i4:b"),
                                                                               Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty)))),
                                            Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                SepProver.out_term.PVar("i4:a"),
                                                Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty)));

            Microsoft.FSharp.Collections.List <SepProver.out_term> ts =
                Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                    SepProver.out_term.PVar("i4:a"),
                    Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                        SepProver.out_term.PVar("i4:b"),
                        Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                            SepProver.out_term.Fun("f",
                                                   Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                       SepProver.out_term.String("(i4,i4)i4"),
                                                       Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                           SepProver.out_term.PVar("i4:a"),
                                                           Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                               SepProver.out_term.PVar("i4:b"),
                                                               Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty)))),
                            Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                SepProver.out_term.Fun("f",
                                                       Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                           SepProver.out_term.String("(i4,i4)i4"),
                                                           Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                               SepProver.out_term.Fun("f",
                                                                                      Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                                          SepProver.out_term.String("(i4,i4)i4"),
                                                                                          Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                                              SepProver.out_term.PVar("i4:a"),
                                                                                              Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                                                  SepProver.out_term.PVar("i4:b"),
                                                                                                  Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty)))),
                                                               Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                   SepProver.out_term.PVar("i4:b"),
                                                                   Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty)))),
                                Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty))));

            PureProver.debug = true;
            var result = PureProver.congruence_closure(f, ts);
        }
Example #2
0
        public void TestConstantsAddition1()
        {
            var form = SepProver.out_form.EQ(
                SepProver.out_term.Fun("+",
                                       Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                           mkInt("1"),
                                           Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                               mkInt("1"),
                                               Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty))),
                mkInt("2"));
            bool result = PureProver.implies(mkBool("true"), form);

            Assert.AreEqual(true, result);
        }
Example #3
0
        public void TestVariablesAdditionNoTypes()
        {
            var addForm = SepProver.out_form.EQ(
                SepProver.out_term.Fun("+",
                                       Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                           SepProver.out_term.PVar("x"),
                                           Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                               SepProver.out_term.PVar("y"),
                                               Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty))),
                SepProver.out_term.PVar("z"));
            var valForm = SepProver.out_form.And(
                SepProver.out_form.EQ(SepProver.out_term.PVar("x"), mkInt("1")),
                SepProver.out_form.And(
                    SepProver.out_form.EQ(SepProver.out_term.PVar("y"), mkInt("1")),
                    SepProver.out_form.EQ(SepProver.out_term.PVar("z"), mkInt("2"))));
            var  form   = SepProver.out_form.And(addForm, valForm);
            bool result = PureProver.implies(mkBool("true"), form);

            Assert.AreEqual(true, result);
        }
Example #4
0
        public void ArithmeticExample1()
        {
            SepProver.out_form f =
                SepProver.out_form.TT;

            Microsoft.FSharp.Collections.List <SepProver.out_term> ts =
                Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                    SepProver.out_term.Fun("+",
                                           Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                               SepProver.out_term.PVar("i4:x"),
                                               Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                   SepProver.out_term.Fun("*",
                                                                          Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                              SepProver.out_term.Fun("int",
                                                                                                     Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                                                         SepProver.out_term.String("2"),
                                                                                                         Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty)),
                                                                              Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                                  SepProver.out_term.Fun("int",
                                                                                                         Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                                                             SepProver.out_term.String("4"),
                                                                                                             Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty)),
                                                                                  Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty))),
                                                   Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty))),
                    Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                        SepProver.out_term.Fun("+",
                                               Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                   SepProver.out_term.Fun("int",
                                                                          Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                                              SepProver.out_term.String("8"),
                                                                              Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty)),
                                                   Microsoft.FSharp.Collections.List <SepProver.out_term> .Cons(
                                                       SepProver.out_term.PVar("i4:x"),
                                                       Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty))),
                        Microsoft.FSharp.Collections.List <SepProver.out_term> .Empty));

            PureProver.debug = true;
            var result = PureProver.congruence_closure(f, ts);
        }
Example #5
0
        public void TestTrueImpliesTrue()
        {
            bool result = PureProver.implies(mkBool("true"), mkBool("true"));

            Assert.AreEqual(true, result);
        }