Exemplo n.º 1
0
    /// <summary>
    /// Tests garbage collection by repeatedly allocating and freeing random expressions.
    /// </summary>

    public void Run()
    {
        System.DateTime before = System.DateTime.Now;

        Console.Write("Memory test ");
        System.GC.Collect();

        Context ctx = new Context(new Dictionary <string, string>()
        {
            { "MODEL", "true" }
        });

        System.Random rng = new System.Random(0);

        for (uint i = 0; i < 10000; i++)
        {
            BoolExpr q = MkRandomExpr(ctx, rng);

            q = (BoolExpr)q.Simplify();

            //Goal g = ctx.MkGoal(true);
            //g.Assert(q);
            //Tactic t = ctx.MkTactic("simplify");
            //ApplyResult res = t.Apply(g);

            System.GC.Collect();
            if ((i % 1000) == 0)
            {
                Console.Write(".");
            }
        }

        Console.WriteLine();

        System.DateTime after = System.DateTime.Now;

        // Console.WriteLine("Memory test took " + (after - before).TotalSeconds + " sec");
    }
Exemplo n.º 2
0
 // <summary>
 // Initialize a new normal form node representing the given expression. Caller must
 // ensure the expression is logically equivalent to the node.
 // </summary>
 // <param name="expr"> Expression logically equivalent to this node. </param>
 protected NormalFormNode(BoolExpr <T_Identifier> expr)
 {
     _expr = expr.Simplify();
 }