6.2. Otorgamiento de Microcrédito
6.1.2. Políticas a cumplir en el Proceso de Microcrédito
For access to the model PINS is used, which provides specific functionality for retrieving certain types of data from the model without having to deal with the underlying language used. The user can choose to start a verification process using a certain language module, after which it is selected as underlying
42
module for handling the transition relation of the model. As indicated earlier, the available language modules are ETF, DVE, SpinJa, NIPS, µCRL and mCRL2.
Access to language-specific operations of reading states and performing transitions from a certain language module is done via the header file spec-greybox.h.
A core feature of PINS is the dependency matrix of the model. This matrix consists of M rows and K
columns, where the rows correspond to the transition groups and the columns to the state slots of the state vector. A matrix cell can be marked with the following symbols:
■ Letter ‘r’: the state slot of the transition group is only read. ■ Letter ‘w’: the state slot of the transition group is only written.
■ Symbol ‘+’: the state slot of the transition group is both read as written. ■ Symbol ‘–’: the state slot of the transition group is not taken into account.
A cell in the matrix which is marked with one of the first three symbols means that a transition group depends on a state slot, so the firing of an event needs to take into account the value of a certain local state value. A cell in the matrix which is marked with a ‘–’ symbol means that a transition group is independent from a certain state slot, where independent means [4]:
■ The affected state slot is not modified when the transition of the given transition group occurs (e.g. no write occurs to this state slot).
■ It does not matter what value the affected state slot has when the transition of the given transition group occurs (e.g. no read occurs from this state slot).
Also the notion of a projected state vector plays a role here and this means that for a given transition group, from a state vector only those state slots are taken into consideration if the corresponding cell in the dependency matrix is marked with a ‘+’, ‘r’ or ‘w’ symbol. So a projected state vector returns a subvector of the state slots of the given state vector for a given transition group. In the implementation each transition group is associated with a certain projection on the state vector (see section 3.3.2). ■ Running example 2 – PINS dependency matrix & projections
The three transition groups of example model 2 are already given in Figure 2.9 and when taking the model description into account, the PINS dependency matrix will be as shown in Figure 3.2.
For each transition group, one can derive the following projected state vectors: ■ Transition group 0: subvector consisting of state slots 1 and 2.
■ Transition group 1: subvector consisting of only state slot 2. ■ Transition group 2: subvector consisting of state slots 1 and 3.
43
The PINS interface contains a number of functions related to the dependency matrix and the transition relation, and the most relevant are given in Table 3.2. These operations are available in the header file greybox.h (with concrete implementation in file greybox.c) and their names are simplified for readability reasons. Concerning the next-state operations, they require a call back function and context information. With this construct one can provide own implementations of how to handle the list of successor states.
PINS operation Input arguments Return value
get_dependency_matrix - model Dependency matrix from given model.
get_initial_state - model Indexed state vector of initial state from
given model.
get_next_states_short - model
- transition group ID
- source state (as projected indexed state vector)
- call back function - context information
For a given model, enumerate the
transitions of the given transition group ID starting from the source state. The call back function together with the context
information is used to return a list of successor states (as a list of projected indexed state vectors).
get_next_states_long - model
- transition group ID
- source state (as indexed state vector) - call back function
- context information
Idem, but now using normal indexed state vectors for the states.
get_next_states_all - model
- source state (as indexed state vector) - call back function
- context information
Idem, but it enumerates the transitions of every transition group.
Table 3.2: Some PINS operations and their arguments as defined in header file greybox.h (simplified).
■ Running example 2 – PINS operations
Imagine that we are at the current source state (1, 2, 0) for vector (x, y, z) of example model 2 and for the next-state operations the transition group with ID number 0 is taken. Then the outcomes are as given below in Table 3.3, where the input arguments for the call back function and context information of the last three operations have been neglected.
PINS operation Input arguments Return value
get_dependency_matrix - example model 2 See Figure 3.2.
get_initial_state - example model 2 (0, 0, 0)
get_next_states_short - example model 2
- transition group ID no. 0 - projected source state (1, 2)
(2, 2)
get_next_states_long - example model 2
- transition group ID no. 0 - source state (1, 2, 0)
(2, 2, 0)
get_next_states_all - example model 2
- source state (1, 2, 0)
(2, 2, 0) with transition group 0 (1, 2, 1) with transition group 2
44 ■ PINS wrapper: Regrouping
The PINS dependency matrix is obtained from the model specification which has a predetermined variable ordering. In most cases this would result in a PINS dependency matrix where transition groups span multiple state slots it depends on, and with possibly lots of state slots in between it does not depend on (the latter are also denoted as intermediate identity transitions). The PINS wrapper dealing with
regrouping is capable of reordering the transition groups and the state slots in such a way that it attempts to minimize the distance between the lowest and highest state slots it depends on for the transition groups, where a cost function is used. This wrapper is not capable of finding the most optimal variable ordering, since this is an NP-complete problem [21]. It tries to find a suitable ordering with the lowest cost function it can manage.