Exemplo n.º 1
0
 def _get_ground_fluent(self, fluent: FNode,
                        assignments: Dict[Expression, Expression]) -> FNode:
     assert fluent.is_fluent_exp()
     new_args = []
     for p in fluent.args:
         new_args.append(self._subs_simplify(p, assignments))
     return self.manager.FluentExp(fluent.fluent(), tuple(new_args))
Exemplo n.º 2
0
 def walk_fluent_exp(
     self, expression: FNode,
     args: List['unified_planning.model.types.Type']
 ) -> Optional['unified_planning.model.types.Type']:
     assert expression.is_fluent_exp()
     f = expression.fluent()
     if len(args) != len(f.signature):
         return None
     for (arg, param) in zip(args, f.signature):
         if not self.is_compatible_type(arg, param.type):
             return None
     return f.type
Exemplo n.º 3
0
 def walk_all_types(self, expression: FNode,
                    args: List[Set[FNode]]) -> Set[FNode]:
     res = set(x for y in args for x in y)
     if expression.is_fluent_exp():
         res = res | {expression}
     return res