Formulae for Scalable Chain; some fixes and improvements

This commit is contained in:
Artur Meski
2017-03-15 23:30:29 +01:00
parent 56d4d8fde8
commit 59cd3af3e1
4 changed files with 143 additions and 17 deletions

View File

@@ -3,8 +3,7 @@ from enum import Enum
from logics.bags import *
rsLTL_form_type = Enum('rsLTL_form_type', 'bag l_and l_or l_not t_globally t_finally t_next t_until t_release')
rsLTL_form_type = Enum('rsLTL_form_type', 'bag l_and l_or l_not l_implies t_globally t_finally t_next t_until t_release')
class Formula_rsLTL(object):
@@ -35,6 +34,8 @@ class Formula_rsLTL(object):
return "( " + repr(self.left_operand) + " & " + repr(self.right_operand) + " )"
if self.f_type == rsLTL_form_type.l_or:
return "( " + repr(self.left_operand) + " | " + repr(self.right_operand) + " )"
if self.f_type == rsLTL_form_type.l_implies:
return "( " + repr(self.left_operand) + " => " + repr(self.right_operand) + " )"
if self.f_type == rsLTL_form_type.t_until:
return "( " + repr(self.left_operand) + " U[" + repr(self.sub_operand) + "]" + repr(self.right_operand) + " )"
if self.f_type == rsLTL_form_type.t_release:
@@ -68,6 +69,10 @@ class Formula_rsLTL(object):
def f_R(cls, sub, arg_L, arg_R):
return cls(rsLTL_form_type.t_release, L_oper = arg_L, R_oper = arg_R, sub_oper = sub)
@classmethod
def f_Implies(cls, arg_L, arg_R):
return cls(rsLTL_form_type.l_implies, L_oper = arg_L, R_oper = arg_R)
def __and__(self, other):
return Formula_rsLTL(rsLTL_form_type.l_and, L_oper = self, R_oper = other)