• No se han encontrado resultados

Descripción de la grieta tridimensional mediante level sets

In document UNIVERSITAT POLITÈCNICA DE VALÈNCIA (página 82-86)

2. Problema mecánico de la fractura elástico lineal 5

3.2. xfem en grietas tridimensionales

3.2.1. Descripción de la grieta tridimensional mediante level sets

In this section, the Markov model that is described above in Section4.3is used to compute what are called inconsistencies for a given state either in the current automata during inference or for an LTS model. The inconsistency score is defined as the number of

contradictions between the existing labels of the outgoing transitions against corresponding predictions, for a given state or for all states in an LTS.

4.4.1.1 Inconsistency Score for a Specific State

In this section, the process of finding and counting the inconsistency score for a given state is described. The inconsistency score for a given state is computed with respect to its outgoing transitions. It begins by collecting the set of prefix paths for a given a state prefixpaths (A, k, q) as described in Definition 4.2. Then, a set of labels of outgoing transitions are obtained, denoted Σout

q and defined in Definition 2.3.

A label of an outgoing transition σ ∈ Σout

q is said to be consistent if there is a match be-

tween the outgoing transition and the corresponding prediction as defined in Definition4.8. Definition 4.8. Given a state q ∈ Q, prefix length k, automaton A, a prefix path pr ∈ prefixpaths(A, k, q), a label of outgoing transition σ, and the trained Markov model MT. An element of alphabet σ is said to be consistent based on Markov predictions for a prefix paths pr if:

1. (∃q0 ∈ F+. δ(q, σ) = q0 ∧ σ ∈ ML

permitted(q, pr)) ∨ (∃q00 ∈ F−. δ(q, σ) = q00∧ σ ∈

MLprohibited(q, pr))

From Definition 4.8, a label of outgoing transition σ ∈ Σout

q is said to be consistent with

Markov predictions in two cases. First, if there is a transition labelled with σ that leads to an accepting state from a state q and the σ is predicted as permitted to follow pr. The first case if the provided automaton is LTS or PTA. Second, if σ is predicted by the Markov model as prohibited after pr and there is an outgoing transition labelled with σ leaving a state q leading to a rejecting state q0∈ F−. The second case is included alongside the first case if the learner infers PLTS from positive and negative traces. Otherwise, σ is said to be inconsistent for the current prefix path pr ∈ prefixpaths (A, k, q).

Algorithm 10 summarized the process of computationvof the inconsistency score for a given state q ∈ Q in the current automaton A, and this score is denoted by (Inconsq).

It begins by collecting a set of all prefix paths of length k leading to state q. The prefixpaths(A, q, k) function in Algorithm 10 returns all prefix paths. For example, for

the automaton A and state B that is illustrated in Figure 4.3, the set of prefix path of length 1 is prefixpaths(A, B, 1) = {hLoadi, hClosei} and the set of prefix path of length 2 contains prefixpaths(A, B, 2) = {hLoad, Closei, hClose,

Closei}. O start B C G E H I F Z Load Edit Load Close Edit Save Save Close Close

Figure 4.3: Example of computing Inconsq

Input: q and k

/* S+ is the current state, k is the prefix length k */ Result: Inconsq

// Inconsq is the number of inconsistencies 1 Inconsq← 0;

2 for pr ∈prefixpaths(A, q, k) of length k do 3 for σ ∈Σoutq do

4 if checkConsistencies (pr, σ, MT) is false then 5 incons ← incons ∪(pr, σ); 6 else 7 cons ← cons ∪(pr, σ); 8 end 9 end 10 end

11 return Inconsq← |incons|

Algorithm 10: The computation of inconsistency for a given state q

The second step during the computation of the Inconsq score is to check the consistency of

each element in Σout

q against Markov predictions. The aim is to find inconsistencies (con-

tradictions) between the outgoing transitions and the corresponding predictions. Given a state q, the computation of the Inconsq score is achieved by iterating through the set of

prefix path leading to q, and checking the consistency of an element of alphabet σ ∈ Σout q

for the current pr. It classifies each given prefix path and each label in Σout

q into the incon-

sistent (incons) and consistent (cons) sets as shown in Table4.4. If a label of an outgoing transition σ ∈ Σout

then the pair (pr, σ) is added to the cons set. Otherwise, it is added to the incons set. It is important to highlight that the consistency (matching) of the label of outgoing transition σ with predictions is determined as described in the previous section (see Definition4.8). The Inconsq score is the number of pairs that are added to the incons set after the classi-

fication process.

pr ∈

PrefixPaths(A,q,k)

Markov predictions

σ ∈ MLpermitted(pr) σ ∈ MLprohibitted(pr) (pr, σ) /∈ dom(MT)

σ ∈Σout

q | q0= δ(q, σ), q0∈ F+ cons incons incons

σ ∈Σout

q | q0= δ(q, σ), q0∈ F− incons cons incons

Table 4.4: Classification of inconsistency

Load Edit Save Close

Load, Load - - - -

Load, Edit - Pos Pos -

Load, Save - - - -

Load, Close Pos - - -

Edit, Load - - - -

Edit, Edit - - Pos -

Edit, Save - - - Pos

Edit, Close - - - - Save, Load - - - - Save, Edit - - - - Save, Save - - - - Save, Close - - - - Close, Load - - - - Close, Edit - - - - Close, Save - - - - Close, Close - - - -

Table 4.5: The Markov Table where k = 2

Example 4.3. Let us again consider the automaton shown in Figure4.3, and the M T illus- trated in Table4.5where k = 2. The M T is built from the following positive traces: S+=

{hLoad, Edit, Edit, Save, Closei, hLoad, Edit, Save, Closei, hLoad, Close, Loadi}. The set of labels of outgoing transitions of state B (Σout

B ) contains the following labels: {Load, Edit, Close}.

The prefixpaths (A, B, 2) function returns the following prefix paths: {hLoad, Closei, hClose, Closei}. The next step is to check consistency for each label in the Σout

B set against

Markov predictions for each prefix path in prefixpaths (A, B, 2). For instance, the Load label is predicted as permitted to follow hLoad, Closei based on the Markov table that

is illustrated in Table 4.5. Thus, the Load label is considered consistent since there is an outgoing transition that leads to the accepting state labelled with Z. However, the Load label is not predicted after the prefix path hClose, Closei, and this is considered as in- consistency. Table 4.6shows the inconsistency classification for each label of the outgoing transitions for the B state where the prefix path is hLoad, Closei.

hLoad, Closei ∈ collectPrefixPaths(A,q,k)

Markov Table (MT )

σ ∈ MLpermitted(hLoad, Closei) σ ∈ MLprohibitted(hLoad, Closei) (hLoad, Closei, σ) /∈ dom(MT)

Load ∈Σout B | δ(B, σ) = K ∈ F + cons - - Edit ∈Σout B | δ(B, σ) = C ∈ F + - - incons Close ∈Σout B | δ(B, σ) = B ∈ F+ - - incons Table 4.6: Classification of inconsistency for the prefix path hLoad, Closei and state B

4.4.1.2 Inconsistency Score for an Automaton

The computation of Incons for an automaton is described formally in Definition4.9, where Incons(A, MT, q) is the function that returns the inconsistency score for a given state and it is computed as described in the previous section.

Definition 4.9.

Incons(A, MT) = X

q∈QA

Incons(A, MT, q)

In document UNIVERSITAT POLITÈCNICA DE VALÈNCIA (página 82-86)