def __init__(self, guarantees: List[str], assumptions: List[str] = None): guarantees_obj = set() from typescogomo.variables import extract_variable for g in guarantees: guarantees_obj.add(LTL(g, extract_variable(g))) guarantees_obj = LTL(cnf=guarantees_obj) if assumptions is None: assumptions_obj = LTL() else: assumptions_obj = set() for a in assumptions: assumptions_obj.add(LTL(a, extract_variable(a))) assumptions_obj = LTL(cnf=assumptions_obj) guarantees_obj.saturate_with(assumptions_obj) super().__init__(assumptions=assumptions_obj, guarantees=guarantees_obj)
def __init__(self, assumptions_str: List[str], guarantees_str: List[str]): assumptions = set() guarantees = set() for a in assumptions_str: assumptions.add(LTL(a, Variables({Boolean(a)}))) for g in guarantees_str: guarantees.add(LTL(g, Variables({Boolean(g)}))) assumptions = LTL(cnf=assumptions) guarantees = LTL(cnf=guarantees) guarantees.saturate_with(assumptions) super().__init__(assumptions=assumptions, guarantees=guarantees)