format(st.sort.name)) syms.append(st) instantiations.append(list(st.sort.domain())) cardinality *= len(instantiations[-1]) return cardinality, syms, instantiations if __name__ == "__main__" : reader = FstripsReader(raise_on_error=True, theories=None) ### Uncomment this for PARCPRINTER test """ problem = reader.read_problem("parcprinter_p01-domain.pddl","parcprinter_p01.pddl") problem.init.function_extensions = dict() for _,action in problem.actions.items(): new_effects = [] for effect in action.effects: if not isinstance(effect, FunctionalEffect): new_effects.append(effect) action.effects = new_effects """ ### Uncomment this for FLOORTILE TEST #problem = reader.read_problem("floortile_domain.pddl","floortile_p01-4-3-2.pddl") # Comment this problem = reader.read_problem("tidybot_domain.pddl","tidybot_p02.pddl") grounding = LPGroundingStrategy(problem) actions = grounding.ground_actions() actions = grounding.ground_state_variables() print(actions) print("Tests passed")
def parse_problem_with_tarski(domain_file, inst_file): reader = FstripsReader(raise_on_error=True, theories=None, strict_with_requirements=False) return reader.read_problem(domain_file, inst_file)