Microsoft.Z3.Context.ParseSMTLIBFile C# (CSharp) Méthode

ParseSMTLIBFile() public méthode

Parse the given file using the SMT-LIB parser.
public ParseSMTLIBFile ( string fileName, Symbol sortNames = null, Microsoft.Z3.Sort sorts = null, Symbol declNames = null, FuncDecl decls = null ) : void
fileName string
sortNames Symbol
sorts Microsoft.Z3.Sort
declNames Symbol
decls FuncDecl
Résultat void
        public void ParseSMTLIBFile(string fileName, Symbol[] sortNames = null, Sort[] sorts = null, Symbol[] declNames = null, FuncDecl[] decls = null)
        {
            uint csn = Symbol.ArrayLength(sortNames);
            uint cs = Sort.ArrayLength(sorts);
            uint cdn = Symbol.ArrayLength(declNames);
            uint cd = AST.ArrayLength(decls);
            if (csn != cs || cdn != cd)
                throw new Z3Exception("Argument size mismatch");
            Native.Z3_parse_smtlib_file(nCtx, fileName,
                AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts),
                AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls));
        }

Usage Example

Exemple #1
0
        /// <summary>
        /// Shows how to read an SMT1 file.
        /// </summary>
        static void SMT1FileTest(string filename)
        {
            Console.Write("SMT File test ");

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

                BoolExpr a = ctx.MkAnd(ctx.SMTLIBFormulas);
                Console.WriteLine("read formula: " + a);
            }
        }
Context