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()
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.")
def reset_env(): """Overload reset_env to use the new push_env().""" pop_env() push_env() return get_env()
def reset_env(): pop_env() push_env() return get_env()