• Keine Ergebnisse gefunden

5.3 Discrete Temporal Interval Sequences

5.3.3 Result Mappings

Figure 5.8: Intersection and complement of sequence and interval.

Again, the validity of the construction above is stated separately in the theorem below, which follows directly from the theorem above.

Theorem 5.7. LetT1 = (I1,i)Ni=0 andT2 be temporal interval sequences. Then the relative complement T2\T1 is an admissible temporal interval sequence according that fulfills the requirements of Definition 5.2.

Proof. The proof works by induction over the cardinality ofT1 and uses The-orem 5.6. Since it is structured exactly as the one in TheThe-orem 5.5, it is not repeated in detail.

The definitions above together form a solid basis that allow the creation, access, and manipulation of temporal interval sequences. Additionally, at sev-eral points of the algorithms, a function is needed to calculate the latest time point in an interval sequence.

Definition 5.11 (Latest time point in interval sequence). Let T = (Ii)Ni=0 be a temporal interval sequence. Then the latest time point in T, written as maxt(T) is defined as follows:

maxt(T) =maxt((Ii)Ni=0) := max{t∈N0| ∃i. t∈Ii}

Definition 5.12 (Temporal result mapping). A temporal result mapping

res

R is a tuplehT , Rithat consists of a temporal interval sequenceT and a function R :IT(T)→ {>,⊥,?} that labels each interval in T with a result, i.e. one of

>,⊥, or?. Furthermore, let

res

R .intvrefer to the temporal interval sequence of

res

R and

res

R .rmap to its labeling function.

Figure 5.9: Example for a result mapping.

Figure 5.9 shows a possible mapping of the intervals in Figure 5.4 to dif-ferent results. This particular example could describe a typical outcome of the evaluation of a property at the end of a simulation step. Here, the al-gorithm was able to decide that the scheduled evaluation goal instances that start within the first two intervals are successful, while no conclusive result has been found yet for the instances that start within the third interval.

Since result mappings are actually merely labeled temporal interval se-quences, it is possible to reuse the operations that were defined in the last section and extend them in a very straightforward manner to incorporate the result labels. The first step is a simple constructor that assigns the same result label to all intervals.

Definition 5.13 (Unique result assignment). Let T = (Ii)Ni=0 be a temporal interval sequence and r ∈ {>,⊥,?} a result label. Then the unique result assignment of r to the intervals in T, written as T|r yields a result mapping

res

R = hT , Ri with the mapping function R : IT(T) → {>,⊥,?} defined as follows:

R(I) =r for all I ∈ IT(T)

The only other constructor needed for result mappings is the union oper-ator. Since the evaluation algorithms allow a restriction to result mappings with non-overlapping intervals, the union an easily be defined by leveraging the union operator for interval sequences.

Definition 5.14 (Union of temporal result mappings). Let

res

R =hT , Ri and

res

R0 =hT0, R0ibe two temporal result mappings with disjunct temporal interval sequences, i.e. it holds that

∀I ∈ IT(T).∀I0 ∈ IT(T0). I∩I0 =∅

. Then the union of

res

R and

res

R0 is defined as

res

R ∪

res

R0 =hT∪T0, Ri where

R :IT(T)∪ IT(T0)→ {>,⊥,?}=

(R(I) if I ∈ IT(T) R0(I) if I ∈ IT(T0)

As expected, the union of result mappings basically amounts to creating a union of the interval sequences and combining the mapping functions by case distinction. However, a restriction to disjunct temporal interval sequences is necessary since overlapping intervals with different result labels would lead to ambiguity. Therefore, it will later be necessary to show that the participating result mappings in fact have disjunctive interval sequences whenever the union operator is used.

With the operations defined so far, it is possible to construct any result mapping simply by adding together mapping segments with unique labels that were constructed with the|roperator. Additionally, the evaluation algorithms in Section 5.6 need to be able to use result mappings within logical connectives, i.e. negation, conjunction, and disjunction. Naturally, the most basic one is the negation operator that simply flips all definite labels.

Definition 5.15 (Negation of a result mapping). Let

res

R =hT , Ri be a result mapping. Then, the negation of

res

R, written as ¬

res

R is defined as follows:

¬

res

R =hT , R¬i whereR¬ :IT(T)→ {>,⊥,?}with

R¬(I) =





> if R(I) =⊥

⊥ if R(I) =>

? otherwise

The other two required connectives,∧and∨, are a bit more complex. The problem is that the interval sequences of the two participating result mappings are not necessarily equal. This means that intervals possibly have to be cut and recomposed according to the application of the logical operators to interval overlaps.

Definition 5.16 (Logical connectives for result mappings). Let

res

R1 =hT1, R1i and

res

R2 =hT2, R2i be result mappings. Then the conjunc-tion and disjuncconjunc-tion of the two can be defined as follows:

res

R1

res

R2 =hT, Ri=T∧,?|? ∪ T∧,>|> ∪ T∧,⊥| and

res

R1

res

R2 =hT, Ri=T∨,?|? ∪ T∨,>|> ∪ T∨,⊥| .

To construct the interval sequences in the definition above, first all intervals from the source sequences are sorted by their label in the result mappings and combined into three new sequences T>,T, and T?:

T>=T1,>∪T2,>, T=T1,⊥∪T2,⊥, T? =T1,?∪T2,?

with

Tj,>= M

I∈I1,>

I whereIj,>={I ∈Tj |Rj(I) =>}for j∈ {1,2}

and analogically for Tj,⊥ and Tj,?.

With these combined intervals and the relative complement of one interval sequence in another from Definition 5.10, it is possible to define the sequences from which the final result mappings are constructed:

T∧,?=T?\T

T∧,>= (T>\T)\T∧,?

T∧,⊥=T

T∨,?=T?\T>

T∨,>=T>

T∨,⊥= (T\T>)\T∨,?

Finally, a function is needed that determines a summary of a result map-ping, which could be unanimous if all intervals have the same label, ambiguous if the mapping contains both top and ⊥intervals, and undetermined (?) if at least one interval is undetermined.

Definition 5.17 (Summary of a result mapping). Let

res

R =hT , Ri be a result mapping. The summary of

res

R, written as summary(

res

R), is defined as follows:

summary(

res

R) =

























> if ∀I ∈ IT(T).R(I) =>

⊥ if ∀I ∈ IT(T).R(I) =⊥ ambiguous if (∀I ∈ IT(T).R(I)6=?)

∧(∃I0 ∈ IT(T).R(I0) =>)

∧(∃I00 ∈ IT(T).R(I00) =⊥)

? if ∃I ∈ IT(T).R(I) =?

In the definition above,?has precedence overambiguous in the sense that even if the result mapping contains both positive and negative definite inter-vals, it is still seen as undetermined if at least one of its intervals is. This is important for the evaluation algorithm since it indicates that at least for some of the intervals, entries for the evaluation goal schedule have to be created.

Other mechanisms to manipulate result mappings are actually not neces-sary, since result mappings are only used as means for data collection through-out recursive function calls during property evaluation. The actual evaluation state information in the evaluation goal schedule is stored differently. This will be discussed in Section 5.5. However, before the data structures involved in the evaluation goal schedule can be examined properly, it is necessary to look at the way in which formulas are translated into the internal representation that is actually used by the Prolog-based property interpreter. This is the topic of the next section.