예제 #1
0
    def _generate_abducibles(self, problem):
        log_local_intro('generate abducibles')
        log_local_info(problem)

        push_env()
        try:
            dat = self._read_problem_data(problem)

            decls = self._recover_declarations(dat)

            self._generate_constant_calls_from_functions(decls)
            self._merge_constant_calls(decls)

            abducibles = []
            abducibles.extend(self._generate_boolean_abducibles_list(decls))
            abducibles.extend(self._generate_equalities_abducibles_list(decls))

            self._write_abducible_file(
                self._compute_abducible_filename(problem), abducibles)

            log_local_success()
        except Exception as e:
            if not self.verbose:
                log_local_failure(str(e))
            else:
                log_local_failure(str(e))
                sys.stderr.write(Fore.RED)
                traceback.print_exc(file=sys.stderr)
                sys.stderr.write(Style.RESET_ALL)

        pop_env()
예제 #2
0
    def test_stack_env(self):
        env1 = get_env()
        push_env()
        push_env(env1)

        self.assertEqual(env1, pop_env(), "Pushed environment was ignored.")
        env2  = get_env()
        self.assertIsNotNone(env2)
        self.assertNotEqual(env1, pop_env(), "New environment was not created.")
예제 #3
0
파일: environment.py 프로젝트: pllab/CoSA
def reset_env():
    """Overload reset_env to use the new push_env()."""
    pop_env()
    push_env()
    return get_env()
예제 #4
0
def reset_env():
    pop_env()
    push_env()
    return get_env()
예제 #5
0
파일: ltl.py 프로젝트: mpreiner/pysmt
def reset_env():
    """Overload reset_env to use the new push_env()."""
    pop_env()
    push_env()
    return get_env()