コード例 #1
0
ファイル: formula_building.py プロジェクト: pyvypr/VyPR
 def _in(self, interval):
     """
     Generates an atom.
     """
     if type(interval) is list and len(interval) == 2:
         return formula_tree.StateValueLengthInInterval(
             self._state, self._name, interval)
     elif type(interval) is tuple and len(interval) == 2:
         return formula_tree.StateValueLengthInOpenInterval(
             self._state, self._name, interval)
     else:
         raise Exception(
             "Value of type %s given to _in comparison with %s('%s').length() is not supported."
             % (interval.__class__.__name__, self._state, self._name))
コード例 #2
0
ファイル: formula_building.py プロジェクト: pyvypr/VyPR
 def __le__(self, value):
     """
     Generates an atom.
     """
     if type(value) is int:
         return formula_tree.StateValueLengthInInterval(
             self._state, self._name, [0, value])
     elif type(value) is StateValueLength:
         return formula_tree.StateValueLengthLessThanEqualStateValueLengthMixed(
             self._state, self._name, value._state, value._name)
     else:
         raise Exception(
             "Value of type %s given to _in comparison with %s('%s').length() is not supported."
             % (value.__class__.__name__, self._state, self._name))
コード例 #3
0
 def _in(self, interval):
     """
     Generates an atom.
     """
     return formula_tree.StateValueLengthInInterval(self._state, self._name,
                                                    interval)