6 CAPITULO VI - ESTADOS FINANCIEROS
6.3 INFORMACIÓN FINANCIERA A DICIEMBRE DE 2008 Y 2007
6.3.5 NOTAS A LOS ESTADOS FINANCIEROS PARA LOS PERIODOS TERMINADOS EN DICIEMBRE DE
In this section we will explain the sub functions used in the algorithm shown in Figure 4.8. Some of these sub functions find the set of traces by em- ploying the graph traversal algorithm. Each visited state is marked to avoid redundant cycles in the traces. The functions are explained as follows:
• getStates(K)
This function takes Kripke model K as its parameter and returns a set of states of the model K.
• getSubFormula(n)
This function takes node n of the parse tree as its parameter and returns the sub formula represented by this node.
• nodeType(n)
This function takes node n of the parse tree as its parameter and returns the type of the nodes, which are atomic proposition, ∧, ∨, X, G, F and U.
• concat(π1, π2)
This function takes two traces π1 and π2 as its parameters and returns the concatenation of π1 followed by π2.
• head(π)
This function takes trace π as its parameter and returns the first state of the trace.
• findTraceX(si, sj, K, f )
This function takes two states si and sj, model K and sub formula f as its parameters. If si is succeeded by sj, this function returns a trace consisting only of si. Otherwise, it returns an empty set.
• findTraceG(si, sj, K, f )
This function takes two states si and sj, model K and sub formula f as its parameters. It returns a set of all traces within the model
Input: Node n of the parse tree Input: Kripke Model K tr1← ∅ ; tr2← ∅ ; trout← ∅ ; 1 switch nodeType(n) do 2 case atomicProposition 3
foreach s ∈ getStates(K) ∧ K, s getSubFormula(n) do 4
tr1← tr1∪ {s} ; /* add a one-state trace */
5 case ∧-node 6 tr1← getTraces(n.sub1, K) ; 7 tr2← getTraces(n.sub2, K) ; 8 trout← tr1∩ tr2; 9 case ∨-node 10 tr1← getTraces(n.sub1, K) ; 11 tr2← getTraces(n.sub2, K) ; 12 trout← tr1∪ tr2; 13 case X-node 14 tr1← getTraces(n.sub1, K) ; 15
foreach s ∈ getStates(K) ∧ K, s getSubFormula(n) do 16
foreach π ∈ tr1do
17
temp ← findTraceX(s, head(π), K) ; 18
if temp 6= ∅ then 19
foreach ρ ∈ temp do 20
trout← trout∪ {concat(ρ, π)} ;
21
case G-node 22
tr1← getTraces(n.sub1, K) ;
23
foreach s ∈ getStates(K) ∧ K, s getSubFormula(n) do 24
foreach π ∈ tr1do
25
temp ← findTraceG(s, head(π), K, getSubFormula(n.sub1)) ;
26
if temp 6= ∅ then 27
foreach ρ ∈ temp do 28
trout← trout∪ {concat(ρ, π)} ;
29
else if s = head(π) then 30 trout← trout∪ {π} ; 31 case F-node 32 tr1← getTraces(n.sub1, K) ; 33
foreach s ∈ getStates(K) ∧ K, s getSubFormula(n) do 34
foreach π ∈ tr1do
35
temp ← findTraceF(s, head(π), K) ; 36
if temp 6= ∅ then 37
foreach ρ ∈ temp do 38
trout← trout∪ {concat(ρ, π)} ;
39
else if s = head(π) then 40 trout← trout∪ {π} ; 41 case U -node 42 tr2← getTraces(n.sub2, K) ; 43
foreach s ∈ getStates(K) ∧ K, s getSubFormula(n) do 44
foreach π ∈ tr2do
45
temp ← findTraceG(s, head(π), K, getSubFormula(n.sub1)) ;
46
if temp 6= ∅ then 47
foreach ρ ∈ temp do 48
trout← trout∪ {concat(ρ, π)} ;
49
else if s = head(π) then 50 trout← trout∪ {π} ; 51 return tr ; 52 Figure 4.8: getTraces(n)
CHAPTER 4. DESCRIPTION LOGIC-BASED MODEL CHECKING 58 K, which start from si and end at sj. These traces fulfill formula f . Since f is a sub formula from the type G α, each state of these traces fulfills α. It should be noted that the last state of the traces, sj, is omitted from the traces. This set is constructed by employing the graph search algorithm. The set returned by this function should be the set of minimal all-state-visiting traces with respect to formula f (see Definition 30 on the next page). The detailed algorithm of this function is presented in Section 4.6.2.
• findTraceF(si, sj, K, f )
This function takes two states si and sj, model K and sub formula f as its parameters. It returns a set of traces within the model K, which start from si and end at sj. It should be noted that the last state of the traces, sj, is omitted from the traces. Sub formula f has the formF α. Thus, at least a state in each traces, which are collected by this func- tion, satisfies sub formula α. Similar to the function findTraceG(), this function is realized by employing the graph search algorithm. Fur- thermore, the set returned by this function should also be the set of minimal all-state-visiting traces with respect to formula f . Since the algorithm of this function is almost similar to findTraceG(si, sj, K, f ), we discuss further the algorithm in Section 4.6.2.
The set of execution traces returned by these sub functions fulfills the finite set of finite visiting-all-nodes traces property, which will be defined below.
Definition 29 (states of a trace) the function states returns all distinct states occurring in a trace.
Example 14 Let π = s0s1s3s2s2s4. Thus, states(π) = {s0, s1, s2, s3, s4}. Definition 30 (All-state-visiting traces) Let Ψ be the set of all possible traces within the model K and let states(π) be the the set of states appearing in the trace π. π0 and πlast is the first and the last state of the trace π.
A set Γ ⊂ Ψ is defined as the set of minimal all-state-visiting traces w.r.t. model K, formula f and states sa and sb, if and only if,
[ ∀π ∈ Ψ : π f ∧ π0 = sa ∧ πlast = sb states(π) = [ ∀ν ∈ Γ states(ν) (4.32) and ∀ν ∈ Γ : ∃n ∈ N : length(ν) < n (4.33)
are true.
The first condition in Equation 4.32 says that the union of states(π) for each possible trace π ∈ Ψ, which starts from state saand ends at state sb and satisfies formula f , is equal to the union of states(ν) for each ν ∈ Γ. This condition also means that set Γ contains the traces, which visit all states that are also visited by all possible traces that satisfy formula f , start from sa and ends at sb. The second condition in Equation 4.33 says that the length of all traces in Γ are finite.
It should be noted that the set of all-state-visiting traces is not always unique for a given model and formula. Let us consider Example 15.
Example 15 Let us consider a Kripke model K, which is shown in Figure 4.9. The set Γ of the model w.r.t. to formula g = F β and states sa =
s1 s3
s2
s4
s5
Figure 4.9: Kripke model K
s1 and sb = s5 is {s1s2s3s4s5}. On the other hand, one can also define {s1s2s3s5, s1s3s4s5} as the set Γ.