/// <summary> /// Converts a given bek program to an STb by using the given solver. /// </summary> /// <param name="solver">given solver</param> /// <param name="pgm">given bek program</param> /// <returns>STb encoding of the bek program</returns> public static STbModel BekToSTb(IContext <FuncDecl, Expr, Sort> solver, BekProgram pgm) { var conv = BekConverter.MkBekToSTbConverter(solver, pgm.ast.funcs, pgm.ast.name); var st = conv.Convert(pgm); return(st); }
/// <summary> /// Converts a given bek program to an ST by using the given solver. /// </summary> /// <param name="solver">given solver</param> /// <param name="bek">given bek program</param> /// <returns>ST encoding of the bek program</returns> public static STModel BekToST(IContext <FuncDecl, Expr, Sort> solver, BekProgram bek) { //use the STb converter to support ite and exception rules var conv = BekConverter.MkBekToSTbConverter(solver, bek.ast.funcs, bek.ast.name); var st = conv.Convert(bek); return(st.ToST()); //flatten the STb rules }
/// <summary> /// Converts a given bek program (given as a string) to an STb by using the given solver. /// </summary> /// <param name="solver">given solver</param> /// <param name="bek">given bek program as a string</param> /// <returns>STb encoding of the bek program</returns> public static STbModel BekToSTb(IContext <FuncDecl, Expr, Sort> solver, string bek) { var pgm = BekParser.BekFromString(bek); var conv = BekConverter.MkBekToSTbConverter(solver, pgm.ast.funcs, pgm.ast.name); var st = conv.Convert(pgm); return(st); }
/// <summary> /// Converts a given bek program (given as a string) to an ST by using the given solver. /// </summary> /// <param name="solver">given solver</param> /// <param name="bek">given bek program</param> /// <returns>ST encoding of the bek program</returns> public static STModel BekToST(IContext <FuncDecl, Expr, Sort> solver, string bek) { var pgm = BekParser.BekFromString(bek); //use the STb converter so that exceptions and ite rules are supported var conv = BekConverter.MkBekToSTbConverter(solver, pgm.ast.funcs, pgm.ast.name); var stb = conv.Convert(pgm); return(stb.ToST()); }