static bool numGenerations(WExpr program)
        {
            //ProgramGenerator genNone = new ProgramGenerator(program, WEFilter.Filtermode.NONE, VariableCache.ConstraintMode.NONE, ProgramBuilder.FilterMode.Trivial);
            ProgramGenerator genInputs = new ProgramGenerator(program, WEFilter.Filtermode.INPUTS, VariableCache.ConstraintMode.NONE, ProgramBuilder.FilterMode.Trivial);
            WExpr            newprogram;
            //int countNone = 0;
            //while (genNone.GenerateWExpr(out newprogram))
            //{
            //    ++countNone;
            //}
            int countInputs = 0;

            while (genInputs.GenerateWExpr(out newprogram))
            {
                ++countInputs;
            }
            //Console.WriteLine($"None: {countNone}, Inputs: {countInputs}");
            return(true);
        }
        //static bool toTMAndRun(WExpr program)
        //{
        //    TMCB<int, int> M = program.ToTMCB(-1);
        //    foreach (int[][] input in WhileUtilities.NonNegIntTestInputs(program.GetNumVariables(), 4, program.GetUselessVariables().ToArray()))
        //    {
        //        Console.WriteLine("input:");
        //        Console.WriteLine(WhileUtilities.PrintTapes(input, M.blank));
        //        bool dummy;
        //        int[][] output = M.Run(input, out dummy);
        //        Console.WriteLine("output:");
        //        Console.WriteLine(WhileUtilities.PrintTapes(output, M.blank));
        //        string s = Console.ReadLine();
        //        if (s == "exit")
        //        {
        //            return false;
        //        }
        //    }
        //    return true;
        //}

        static bool generate(WExpr program)
        {
            WExpr            newProgram;
            ProgramGenerator gen = new ProgramGenerator(program, WEFilter.Filtermode.INFINITE, VariableCache.ConstraintMode.NONE, ProgramBuilder.FilterMode.Trivial);

            while (gen.GenerateWExpr(out newProgram))
            {
                Console.WriteLine(newProgram.ToString());
                string s = Console.ReadLine();
                if (s == "exit")
                {
                    return(false);
                }
                if (s == "skip")
                {
                    return(true);
                }
            }
            return(true);
        }
        static bool generationBody(WExpr program)
        {
            ProgramGenerator gen = new ProgramGenerator(program, WEFilter.Filtermode.NONE, VariableCache.ConstraintMode.NONE);

            Console.WriteLine("base:");
            Console.WriteLine(program.ToString());
            WExpr  newProgram;
            int    i     = 0;
            string input = "";

            while (true)
            {
                if (gen.GenerateWExpr(out newProgram))
                {
                    Console.WriteLine($"#{i}:");
                    Console.WriteLine(newProgram.ToString());
                    ++i;
                }
                else
                {
                    Console.WriteLine("No more new programs");
                    break;
                }
                input = Console.ReadLine();
                if (input == "exit")
                {
                    return(false);
                }
                if (input == "skip")
                {
                    break;
                }
                if (input == "enter")
                {
                    int x = 0;
                }
            }
            return(true);
        }