예제 #1
0
파일: test_utils.py 프로젝트: bluepine/pysv
 def test_options(self):
     env = utils.Options(["--verify", "--lang", "smt2"])
     self.assertEquals(True, env.verify)
     self.assertEquals("smt2", env.lang)
     env = utils.Options("--verify --lang smt2")
     self.assertEquals(True, env.verify)
     self.assertEquals("smt2", env.lang)
예제 #2
0
    def test_solver_result_assignment(self):
        raw_result = """sat
        (model
          (define-fun |trigger''| () Bool
            false)
          (define-fun newAcc () Int
            1)
          (define-fun |newAcc''| (sth) Int
            2)
          (define-fun trigger (sth) Bool
            true)
        )
        ((A4 false) (A1 true) (A2 false) (A3 true))
        (error "line 35 column 15: unsat core is not available")
        """
        # Option for producing assignments is not set.
        env = utils.Options(['--solver_interactive_mode', 0])
        res = solvers.SolverResult(raw_result, env)
        self.assertEquals({}, res.assignments)

        # Option for producing assignments is set.
        env = utils.Options(
            ['--solver_interactive_mode', 0, '--produce_assignments', 1])
        res = solvers.SolverResult(raw_result, env)
        self.assertEquals(
            {
                'A4': 'false',
                'A1': 'true',
                'A2': 'false',
                'A3': 'true'
            }, res.assignments)

        # Option for producing assignments is not set.
        env = utils.Options(['--solver_interactive_mode', 1])
        res = solvers.SolverResult(raw_result, env)
        self.assertEquals({}, res.assignments)

        # Option for producing assignments is set.
        env = utils.Options(
            ['--solver_interactive_mode', 1, '--produce_assignments', 1])
        res = solvers.SolverResult(raw_result, env)
        self.assertEquals(
            {
                'A4': 'false',
                'A1': 'true',
                'A2': 'false',
                'A3': 'true'
            }, res.assignments)
예제 #3
0
 def test_synthesis_simple(self):
     grammar = templates.load_gramar_from_SYGUS_spec("((Start Int (x y)))")
     h = smt_synthesis.HoleDecl('H0', grammar, None, True, 2)
     code = "(= res (* 2 (+ H0 y)))"
     env = utils.Options({
         '--solver': 'z3',
         '--logic': 'NIA',
         '--silent': 1,
         '--lang': 'smt2',
         '--output_data': 'holes_content',
         '--solver_timeout': '2000'
     })
     vars = ProgramVars({'x': 'Int', 'y': 'Int'}, {'res': 'Int'})
     # Trivial case with the postcondition being always true.
     res = smt_synthesis.synthesize(code, 'true', 'true', vars, env, [h])
     self.assertEquals('sat', res.decision)
     # Slightly less trivial case.
     res = smt_synthesis.synthesize(code, 'true',
                                    '(= res (+ (* 2 x) (* 2 y)))', vars,
                                    env, [h])
     self.assertEquals('sat', res.decision)
     self.assertEquals('0', res.model['H0Start0_r0'])
     self.assertEquals('x', res.holes_content['H0'])
     self.assertEquals("{'H0': 'x'}", res.str_formatted())
     # Case for which UNSAT is the expected answer.
     res = smt_synthesis.synthesize(code, 'true', '(= res 0)', vars, env,
                                    [h])
     self.assertEquals('unsat', res.decision)
예제 #4
0
 def test_synthesis_optimize_passed_tests_for_complex_expr(self):
     """If this test fails with 'unknown' answer for z3, then you perhaps should update your z3 version. This test originally began as the unknown test, but z3 was improved and now this problem is solved quickly."""
     prog = "(= res (* (ite (<= (- x y) (+ x constInt0)) constInt1 y) (- (- constInt2 (ite constBool0 y constInt3)) constInt4)))"
     pre = "true"
     post = "true"
     input_vars = {'x': 'Int', 'y': 'Int'}
     local_vars = {
         'res': 'Int',
         'constInt0': 'Int',
         'constInt1': 'Int',
         'constInt2': 'Int',
         'constInt3': 'Int',
         'constInt4': 'Int',
         'constBool0': 'Bool'
     }
     free_vars = [
         'constInt0', 'constInt1', 'constInt2', 'constInt3', 'constInt4',
         'constBool0'
     ]
     program_vars = ProgramVars(input_vars, local_vars)
     tests = TestCases.from_str(
         "([([0, 0], [0]), ([1, 1], [4]), ([1, 2], [6]), ([1, 0], [2]), ([2, 2], [8])], ['x', 'y'], ['res'])"
     )
     env = utils.Options(
         "--logic NIA --lang smt2 --synth_mode max --produce_assignments 1 --solver_timeout 2000"
     )
     res = smt_synthesis.synthesize_tc(tests,
                                       prog,
                                       pre,
                                       post,
                                       program_vars,
                                       env,
                                       free_vars=free_vars)
     self.assertEquals('sat', res.decision)
     self.assertEquals('3', res.model['fitness'])
예제 #5
0
def get_synthesizer():
    code = """a = HOLE"""
    vars = contract.ProgramVars({'x': 'Int', 'y': 'Int'}, {'a': 'Int'})
    code_pre = 'x >= 1 and y >= 1'
    code_post = 'a == 6*x + y'

    sygus_grammar = """
    (
        ( Start Int
            ( ( Constant Int ) x y (+ Start Start) (* ( Constant Int ) Start) )
        )
    )
    """ #(- Start Start)
    grammar = templates.load_gramar_from_SYGUS_spec(sygus_grammar)
    hole = smt_synthesis.HoleDecl('HOLE',
                                  grammar, {
                                      'x': 'Int',
                                      'y': 'Int'
                                  },
                                  is_expression_hole=True,
                                  max_depth=3)
    env = utils.Options({
        '--solver': 'z3',
        '--logic': 'NIA',
        '--produce_proofs': True,
        '--silent': True
    })
    return smt_synthesis.SynthesizerSMT(code, code_pre, code_post, vars, env,
                                        [hole])
예제 #6
0
 def test_synthesis_minimize_sum_tc(self):
     prog = "(= res constInt)"
     pre = "true"
     post = "true"
     program_vars = ProgramVars({
         'x': 'Int',
         'y': 'Int'
     }, {
         'res': 'Int',
         'constInt': 'Int'
     })
     env = utils.Options(
         "--logic LIA --lang smt2 --synth_mode min --produce_assignments 1 --solver_interactive_mode 0"
     )
     res = smt_synthesis.synthesize_tc(
         TestsSynthesis.tests_and,
         prog,
         pre,
         post,
         program_vars,
         env,
         free_vars=["constInt"],
         assertions=['(assert (or (= constInt 0) (= constInt 1)))'])
     self.assertEquals('sat', res.decision)
     self.assertEquals('1', res.model['constInt'])
     self.assertEquals('1', res.model['fitness'])
     self.assertEquals('false', res.assignments['pass_itest0'])
     self.assertEquals('false', res.assignments['pass_itest1'])
     self.assertEquals('false', res.assignments['pass_itest2'])
     self.assertEquals('true', res.assignments['pass_itest3'])
예제 #7
0
 def test_solver_result_1(self):
     raw_result = """sat
     (model
       (define-fun |trigger''| () Bool
         false)
       (define-fun newAcc () Int
         1)
       (define-fun |newAcc''| (sth) Int
         2)
       (define-fun trigger (sth () sth) Bool
         true)
     )
     (QS PS QPR)
     """
     env = utils.Options(
         ['--solver_interactive_mode', 0, '--produce_unsat_core', 1])
     res = solvers.SolverResult(raw_result, env)
     self.assertEquals('sat', res.decision)
     self.assertEquals('false', res["|trigger''|"])
     self.assertEquals('1', res['newAcc'])
     self.assertEquals('2', res["|newAcc''|"])
     self.assertEquals('true', res['trigger'])
     self.assertEquals(
         {
             "|trigger''|": 'false',
             "newAcc": '1',
             "|newAcc''|": '2',
             "trigger": 'true'
         }, res.model)
     self.assertEquals([], res.unsat_core)
예제 #8
0
 def test_synthesis_minimize_L0_tc(self):
     prog = "(= res constInt)"
     pre = "true"
     post = "true"
     program_vars = ProgramVars({
         'x': 'Int',
         'y': 'Int'
     }, {
         'res': 'Int',
         'constInt': 'Int'
     })
     env = utils.Options(
         "--logic LIA --lang smt2 --synth_mode min --produce_assignments 1 --solver_interactive_mode 0 --tc_fitness_mode L1"
     )
     res = smt_synthesis.synthesize_tc(
         TestsSynthesis.tests_and,
         prog,
         pre,
         post,
         program_vars,
         env,
         free_vars=["constInt"],
         assertions=['(assert (or (= constInt 0) (= constInt 1)))'])
     self.assertEquals('sat', res.decision)
     self.assertEquals(
         '0', res.model['constInt']
     )  # constInt set to 0 minimizes sum of errors while maximizing passed test cases.
     self.assertEquals('1', res.model['fitness'])
예제 #9
0
def test_10():
    from pysv import runner
    env = utils.Options([
        "--synthesize", "--pre", "true", "--post", "(> x 5)", "--program",
        "true", "--input_vars", "x:Int", "--silent", 1, "--lang", "smt2",
        "--output_data", "decision", "model"
    ])
    runner.run_from_options(env)
예제 #10
0
 def test_solver_result_3(self):
     raw_result = """unsat
     (error "line 34 column 10: model is not available")
     """ # this is testing what happens, if solver ends work on the first error.
     env = utils.Options(
         ['--solver_interactive_mode', 0, '--produce_unsat_core', 1])
     res = solvers.SolverResult(raw_result, env)
     self.assertEquals('unsat', res.decision)
     self.assertEquals({}, res.model)
     self.assertEquals([], res.unsat_core)
예제 #11
0
    def test_synthesis_min_passed_tests(self):
        prog = "(= res constInt)"
        pre = "true"
        post = "true"
        program_vars = ProgramVars({
            'x': 'Int',
            'y': 'Int'
        }, {
            'res': 'Int',
            'constInt': 'Int'
        })
        # SAT case
        env = utils.Options(
            "--logic LIA --lang smt2 --synth_mode min --produce_assignments 1 --synth_min_passed_tests 3"
        )
        res = smt_synthesis.synthesize_tc(
            TestsSynthesis.tests_and,
            prog,
            pre,
            post,
            program_vars,
            env,
            free_vars=["constInt"],
            assertions=['(assert (or (= constInt 0) (= constInt 2)))'])
        self.assertEquals('sat', res.decision)
        self.assertEquals('0', res.model['constInt'])
        self.assertEquals('3', res.model['fitness'])

        # UNSAT case
        env = utils.Options(
            "--logic LIA --lang smt2 --synth_mode min --produce_assignments 1 --synth_min_passed_tests 4"
        )
        res = smt_synthesis.synthesize_tc(
            TestsSynthesis.tests_and,
            prog,
            pre,
            post,
            program_vars,
            env,
            free_vars=["constInt"],
            assertions=['(assert (or (= constInt 0) (= constInt 2)))'])
        self.assertEquals('unsat', res.decision)
예제 #12
0
    def test_solver_result_unsat_core(self):
        raw_result1 = """unsat
        (error "line 35 column 10: model is not available")
        (error "line 36 column 15: model is not available")
        (A2 A3 A4 A5)
        """
        raw_result2 = """unsat
        (A2 A3 A4 A5)
        """

        # Option for producing unsat core is not set.
        env = utils.Options([
            '--solver_interactive_mode', 0, '--produce_unsat_core', 0,
            '--produce_assignments', 1
        ])
        res = solvers.SolverResult(raw_result1, env)
        self.assertEquals([], res.unsat_core)

        # Option for producing unsat core is not set.
        env = utils.Options([
            '--solver_interactive_mode', 0, '--produce_unsat_core', 1,
            '--produce_assignments', 1
        ])
        res = solvers.SolverResult(raw_result1, env)
        self.assertEquals(['A2', 'A3', 'A4', 'A5'], res.unsat_core)

        # Option for producing unsat core is not set.
        env = utils.Options([
            '--solver_interactive_mode', 1, '--produce_unsat_core', 0,
            '--produce_assignments', 1
        ])
        res = solvers.SolverResult(raw_result2, env)
        self.assertEquals([], res.unsat_core)

        # Option for producing unsat core is not set.
        env = utils.Options([
            '--solver_interactive_mode', 1, '--produce_unsat_core', 1,
            '--produce_assignments', 1
        ])
        res = solvers.SolverResult(raw_result2, env)
        self.assertEquals(['A2', 'A3', 'A4', 'A5'], res.unsat_core)
예제 #13
0
 def test_solver_result_2(self):
     raw_result = """unsat
     (error
     "line 34 column 10: model is not available")
     (VER_FORMULA)
     """
     env = utils.Options(
         ['--solver_interactive_mode', 0, '--produce_unsat_core', 1])
     res = solvers.SolverResult(raw_result, env)
     self.assertEquals('unsat', res.decision)
     self.assertEquals({}, res.model)
     self.assertEquals(['VER_FORMULA'], res.unsat_core)
예제 #14
0
def are_semantically_equal(f1, f2):
    env = utils.Options("--silent 1")
    s = solvers.SolverBinaries(env)
    constrs = []
    def decl_var(name):
        constrs.append('(declare-fun ' + name + '() Real)')
    def helper(code):
        expr = ast_utils.py_to_interm_expr(code)
        constrs.append('(assert ' + expr.to_smt2(env).src + ')')

    constrs.append('(set-logic NRA)')
    decl_var('a')
    decl_var('b')
    decl_var('c')
    decl_var('d')
    helper(f1 + ' != ' + f2)
    # All constraints below are because of possible exception of dividing by 0. Expressions can be
    # parsed to detect which of these constraints are necessary, but we omitted this for simplicity.
    helper("a > 0")
    helper("b > 0")
    helper("c > 0")
    helper("d > 0")
    helper("a + b > 0")
    helper("a + c > 0")
    helper("a + d > 0")
    helper("b + c > 0")
    helper("b + d > 0")
    helper("c + d > 0")
    helper("b + c + d > 0")
    helper("a + c + d > 0")
    helper("a + b + d > 0")
    helper("a + b + c > 0")
    helper("a + b + c + d == 1")
    constrs.append('(check-sat)')

    res = s.apply('\n'.join(constrs)) # Executing solver for asserted constraints.
    if res.decision == solvers.SAT:
        print('Semantically different!')
        print('Differentiating values: ' + str(res.model))
        return False
    elif res.decision == solvers.UNSAT:
        # Model was not found, so solution are semantically equal.
        print('Equal! Removing ' + f2)
        return True
    elif res.decision == solvers.UNKNOWN:
        print('Solver returned *unknown*.')
        return False
    else:
        raise Exception('Not recognized response of the solver!')
예제 #15
0
    def test_result_str_formatted(self):
        text = """sat
        (model
          (define-fun newAcc () Int
            1)
        )"""
        env = utils.Options(
            ['--output_data', 'decision', 'model', '--silent', 1])
        res = solvers.SolverResult(text, env)
        exp =\
"""sat
{'newAcc': '1'}
"""
        self.assertEquals(exp, res.str_formatted())

        env = utils.Options(['--output_data', 'decision', '--silent', 0])
        res = solvers.SolverResult(text, env)
        exp =\
"""----------------------------------------------
SOLVER RESULT
----------------------------------------------
sat
"""
        self.assertEquals(exp, res.str_formatted())
예제 #16
0
 def test_synthesis_instruction_hole(self):
     code = "H0"
     grammar = templates.load_gramar_from_SYGUS_spec("((Start Int (x y)))")
     h = smt_synthesis.HoleDecl('H0', grammar, None, True, 2)
     env = utils.Options({
         '--logic': 'NIA',
         '--silent': 1,
         '--lang': 'python',
         '--output_data': 'holes_content'
     })
     vars = ProgramVars({'x': 'Int', 'y': 'Int'}, {'res': 'Int'})
     with self.assertRaises(Exception) as context:
         smt_synthesis.synthesize(code, 'True', 'True', vars, env, [h])
     self.assertEquals("Instruction holes are currently not supported!",
                       str(context.exception))
예제 #17
0
 def test_verify_smt2_minimize(self):
     prog = "true"
     pre = "true"
     post = "(and (< res 0) (<= res 0) (= res 0) (= res 0))"
     program_vars = contract.ProgramVars({'res': 'Int'}, {})
     env = utils.Options([
         "--lang", "smt2", "--ver_mode", "min", "--post_in_cnf", 1,
         "--ver_annotate_post", 1, "--logic", "LIA",
         "--produce_assignments", 1
     ])
     res = smt_verifier.verify(prog, pre, post, program_vars, env)
     self.assertEquals('sat', res.decision)
     self.assertEquals(True, int(res.model['res']) > 0)
     self.assertEquals('false', res.assignments['post_0'])
     self.assertEquals('false', res.assignments['post_1'])
     self.assertEquals('false', res.assignments['post_2'])
     self.assertEquals('false', res.assignments['post_3'])
예제 #18
0
    def test_verify_smt2_simple_program(self):
        prog = "(= res (ite (= x 5) -1 1))"
        pre = "true"
        post = "(> res 0)"
        program_vars = contract.ProgramVars({'x': 'Int'}, {'res': 'Int'})
        env = utils.Options(["--lang", "smt2"])
        res = smt_verifier.verify(prog, pre, post, program_vars, env)

        self.assertEquals('sat', res.decision)
        self.assertEquals('5', res.model['x'])
        self.assertEquals({'x': '5'}, res.witness)

        post = "(>= res -1)"
        res = smt_verifier.verify(prog, pre, post, program_vars, env)
        self.assertEquals('unsat', res.decision)
        self.assertEquals({}, res.model)
        self.assertEquals({}, res.witness)
예제 #19
0
파일: synth_max.py 프로젝트: bluepine/pysv
def synthesize_max():
    code = """
if H1:
    res = H2
else:
    res = H3
    """
    code_pre = 'True'
    code_post = 'res >= x and res >= y and (res == x or res == y)'

    # Specification of the hole's template in the form of the grammar in SYGUS format.
    sygus_grammar_hole1 = """
    (
        ( Start Bool
            ( (Constant Bool) (> TermInt TermInt) (>= TermInt TermInt) (= TermInt TermInt) (<= TermInt TermInt) (< TermInt TermInt)
            )
        )
        ( TermInt Int
            ( (Constant Int) x y )
        )
    )
    """
    sygus_grammar_hole23 = """
    (
        ( Start Int
            ( (Constant Int) x y (+ x y) (- x y) (- y x) (+ x ( Constant Int )) (+ y ( Constant Int )) )
        )
    )
    """
    grammar1 = templates.load_gramar_from_SYGUS_spec(sygus_grammar_hole1)
    grammar23 = templates.load_gramar_from_SYGUS_spec(sygus_grammar_hole23)
    pv = contract.ProgramVars({'x': 'Int', 'y': 'Int'}, {'res': 'Int'})
    h1 = smt_synthesis.HoleDecl('H1', grammar1, pv, True, 2)
    h2 = smt_synthesis.HoleDecl('H2', grammar23, pv, True, 2)
    h3 = smt_synthesis.HoleDecl('H3', grammar23, pv, True, 2)
    hole_decls = [h1, h2, h3]

    # The result is currently only a raw output from the solver, but one can verify from the model
    # that synthesized program is correct.
    env = utils.Options(['--solver', 'z3', '--logic', 'NIA'])
    res = smt_synthesis.synthesize(code, code_pre, code_post, pv, env,
                                   hole_decls)
    return res
예제 #20
0
def synthesize_keijzer12():
    smtgp_nia_grammar = """
    (
        ( Start Int
            ( x y (Constant Int) (+ Start Start) (- Start Start) (* Start Start) (div Start Start) (ite SBool Start Start) )
        )
        ( SBool Bool
            ( (> Start Start) (>= Start Start) (< Start Start) (<= Start Start) (= Start Start) (= SBool SBool) )
        )
    )
    """
    vars = contract.ProgramVars({'x': 'Int', 'y': 'Int'}, {'res': 'Int'})
    code = """(= res H1)"""
    code_pre = 'true'
    code_post = 'true'
    grammar = templates.load_gramar_from_SYGUS_spec(smtgp_nia_grammar)
    h1 = smt_synthesis.HoleDecl('H1', grammar, {'x': 'Int', 'y': 'Int'}, True, 6)
    hole_decls = [h1]
    tc = contract.TestCases.from_csv(csv_keijzer12)
    env = utils.Options(['--solver', 'z3', '--logic', 'NIA', "--lang", "smt2"])
    res = smt_synthesis.synthesize_tc(tc, code, code_pre, code_post, vars, env, hole_decls)
    return res
예제 #21
0
    def test_synthesis_recursive_grammar(self):
        code = """
if x > y:
    res = HOLE2
else:
    res = HOLE3
        """
        vars = ProgramVars({'x': 'Int', 'y': 'Int'}, {'res': 'Int'})
        code_pre = 'True'
        code_post = 'res >= x and res >= y and (res == x or res == y)'
        sygus_grammar_hole23 = """
        (
            ( Start Int
                ( ( Constant Int ) x y (+ Start Start) (- Start Start) (- y x) (+ x ( Constant Int )) (* Start Start)
                )
            )
        )
        """
        grammar23 = templates.load_gramar_from_SYGUS_spec(sygus_grammar_hole23)
        h2 = smt_synthesis.HoleDecl('HOLE2', grammar23, None, True, 2)
        h3 = smt_synthesis.HoleDecl('HOLE3', grammar23, None, True, 2)
        hole_decls = [h2, h3]
        assertions = []  #['(assert (= HOLE3_r0 3))']
        env = utils.Options({
            '--solver': 'z3',
            '--solver_interactive_mode': 0,
            '--logic': 'NIA',
            '--silent': 0,
            '--solver_timeout': '2000'
        })
        res = smt_synthesis.synthesize(code, code_pre, code_post, vars, env,
                                       hole_decls, assertions)
        print('[test_synthesis_recursive_grammar] RES:')
        print(res.text)
        print('[test_synthesis_recursive_grammar] SYNTHESIZED CODE:')
        print(res.final_code)
        self.assertTrue(res.decision == 'sat' or res.decision == "unknown")
예제 #22
0
def verify_code(code, precondition, postcondition, variables):

    # Running verifier
    env = utils.Options([
        '--logic', 'LIA', '--silent', 0, '--produce_assignments', 1,
        '--post_in_cnf', 1, '--solver_interactive_mode', 1,
        '--produce_unsat_core', 1, '--ver_annotate_post', 1,
        '--ver_flat_formula', 1
    ])
    res = smt_verifier.verify(code, precondition, postcondition, variables,
                              env)

    # Printing result
    print('\n')
    print('----------------------------------------------')
    print('                SOLVER RESULT                 ')
    print('----------------------------------------------')
    if res.decision == 'unsat':
        print('Counterexample not found! Program is correct.')
    elif res.decision == 'sat':
        print(res.witness)
        print('Counterexample found! Program is incorrect.')
    print('----------------------------------------------\n\n')
    return res
예제 #23
0

def validate_options(env):
    if env.pre is None:
        print("Precondition was not specified! Use: --pre PRE.")
        exit()
    if env.program is None:
        print("Precondition was not specified! Use: --program PROGRAM.")
        exit()
    if env.post is None:
        print("Postcondition was not specified! Use: --post POST.")
        exit()
    if not env.verify and not env.synthesize and not env.example:
        print("Choose the task with --verify or --synthesize!")
        exit()
    if env.synth_min_passed_tests is not None and env.synth_mode != 'max':
        print(
            "--synth_min_passed_tests option requires the --synth_mode to be set to 'max'!"
        )
        exit()


if __name__ == "__main__":
    # Examples:
    # ./main.py --verify --pre "x>=0" --post "res>0" --program "res=y+x+5" --local_vars res:Int --input_vars y:Int x:Int
    # ./main.py --example --pre "x>=0" --post "res>0" --program "res=y+x+5" --local_vars res:Int --input_vars y:Int x:Int

    env = utils.Options()
    validate_options(env)
    runner.run_from_options(env)
예제 #24
0
 def test_old_name(self):
     synth = SynthesisConstrTestCases(contract.TestCases(), utils.Options())
     self.assertEquals("x", synth.old_name("x_T1"))
     self.assertEquals("xxy", synth.old_name("xxy_T12"))
     self.assertEquals("|x'|", synth.old_name("|x_T4'|"))
     self.assertEquals("|xyz'''|", synth.old_name("|xyz_T44'''|"))
예제 #25
0
                                True,
                                max_depth=4)
    return [h1]


if __name__ == "__main__":
    if len(sys.argv) == 1 or "-h" in sys.argv or "--help" in sys.argv:
        print("Usage: ./get_final_code.py [raw output from SMT solver]")
        exit()

    result = sys.argv[1]

    # Original source code (fixed for this prettifier instance).
    original_code = get_original_code()

    # Hole declarations (fixed for this prettifier instance).
    holes_decls = get_hole_declarations(
        contract.ProgramVars(input_vars={
            "x": "Int",
            "y": "Int",
            "z": "Int"
        }))

    # Options (fixed for this prettifier instance).
    env = utils.Options(merge_with_vargs=False)

    res = smt_synthesis.SynthesisResult(result, original_code, holes_decls,
                                        env)
    print("FINAL CODE:")
    print(res.final_code)