def parse(domain_file, problem_file): domain_line = parse_nested_list(file(domain_file)) problem_line = parse_nested_list(file(problem_file)) domain = tasks.parse_domain(domain_line) problem = tasks.parse_task(problem_line) task = ground.ground(domain, problem) return task
return elif token == "(": yield list(parse_list_helper(tokenstream)) else: yield token if __name__ == "__main__": import strips import ground domain_file = 'domain.pddl' task_file = 'p0.pddl' domain_line = parse_nested_list(file(domain_file)) task_line = parse_nested_list(file(task_file)) domain = tasks.parse_domain(domain_line) predicates, actions = domain task = tasks.parse_task(task_line) [problem_name, objects, init, goal] = task print "Problem Name: " + problem_name #print "Predicates:" #for e in predicates: # print '\t', e, '\n' #print "Actions:" #for e in actions: # print '\t', e, '\n' statics = ground.get_static_predicates(predicates, actions) #print "Statics Predicate:"