예제 #1
0
    def __init__(self,
                 key_domain: Type[KeyWrapper],
                 precursory: FularaState,
                 scalar_vars: Set[VariableIdentifier] = None,
                 map_vars: Set[VariableIdentifier] = None,
                 k_pre_k_conv: Callable[[KeyWrapper],
                                        KeyWrapper] = lambda x: x):
        """
        :param key_domain: domain for abstraction of dictionary keys,
            ranges over the scalar variables and the special key variable v_k,
            should support backward assignments with _substitute
        :param precursory: Forward analysis (Fulara analysis) result above the current statement
        :param scalar_vars: list of scalar variables, whose liveness should be abstracted
        :param map_vars: list of map variables, whose usage should be abstracted
        :param k_pre_k_conv: Conversion function to convert from key domain elements of the
                             precursory analysis to key domain elements of this analysis
                             (if the domains differ)"""

        arguments = {
            'key_domain': key_domain,
            'scalar_vars': scalar_vars,
            'map_vars': map_vars
        }
        super().__init__(FularaUsageLattice, arguments)  # Stack
        State.__init__(self, precursory)

        # self._s_vars = scalar_vars
        self._k_pre_k_conv = k_pre_k_conv
예제 #2
0
    def __init__(self, variables: Set[VariableIdentifier], precursory: State = None):
        """Map each program variable to its liveness status.

        :param variables: set of program variables
        """
        lattices = defaultdict(lambda: LivenessLattice)
        super().__init__(variables, lattices)
        State.__init__(self, precursory)
예제 #3
0
    def __init__(self, variables: Set[VariableIdentifier], precursory: State = None):
        """Map each program variable to the interval representing its value.

        :param variables: set of program variables
        """
        lattices = defaultdict(lambda: IntervalLattice)
        super().__init__(variables, lattices)
        State.__init__(self, precursory)
예제 #4
0
    def __init__(self,
                 key_domain: Type[KeyWrapper],
                 scalar_vars: Set[VariableIdentifier] = None,
                 dict_vars: Set[VariableIdentifier] = None,
                 k_k_pre_conv: Callable[[KeyWrapper],
                                        KeyWrapper] = lambda x: x,
                 k_pre_k_conv: Callable[[KeyWrapper],
                                        KeyWrapper] = lambda x: x,
                 precursory: FularaState = None):
        arguments = {
            'key_domain': key_domain,
            'scalar_vars': scalar_vars,
            'dict_vars': dict_vars
        }
        super().__init__(FularaUsageLattice, arguments)  # Stack
        State.__init__(self, precursory)

        # self._s_vars = scalar_vars
        self._k_k_pre_conv = k_k_pre_conv
        self._k_pre_k_conv = k_pre_k_conv

        self._loop_flag = False
예제 #5
0
 def __init__(self, precursory: State = None):
     super().__init__(AssumptionState.InputStack.InputLattice, dict())
     State.__init__(self, precursory)
     self._scopes = list()  # stack of scope types
예제 #6
0
 def __init__(self,
              variables: Set[VariableIdentifier],
              precursory: State = None):
     super().__init__(SimpleUsageStore, {'variables': variables})
     State.__init__(self, precursory)
예제 #7
0
 def __init__(self,
              variables: Set[VariableIdentifier],
              precursory: State = None):
     lattices = defaultdict(lambda: CharacterLattice)
     super().__init__(variables, lattices)
     State.__init__(self, precursory)