• No results found

7.4 Construction of Consistent World Views

7.4.1 Processing with a minimum scope

The minimum scope required to satisfy a simple predicate has been discussed in Section 7.2.3. Similar to the case of a simple predicate, I start checking the consis- tency of a compound predicate (defined in Section 7.3.1) with its minimum scope, although compound predicates may not always satisfy within their minimum scope. As I am going to define the minimum scope of a compound predicate next, re-

call the definition of the minimum satisfying scope of a simple predicate and note that the minimum satisfying scope for each simple predicate was recorded in the database. The Minimum Scope, which is likely to satisfy a compound predicate, is the pointwise maximum of the minimum scope of individual messages contained in the predicate. Consider the following two messages as an example:

1. “A stationary car was hit by another car” [Minimum Scope: 1 Person, 2 Cars] 2. “There was a traffic accident” [Minimum Scope: 1 Person, 1 Car]

The minimum scope required to satisfy the first message (predicate) is 1 Person and 2 Cars. The minimum scope required to satisfy the second message is 1 Person and 1 Car. So, the pointwise maximum scope for ‘Person’ is 1 and the pointwise maximum scope for ‘Car’ is 2. Thus, the minimum scope required to satisfy the compound predicate consisting of the above messages is 1 person and 2 cars.

However, a compound predicate may not always satisfy with the Minimum Scope; it may require a larger scope to satisfy. Consider the following messages:

• “A blue car hit a red car at Trafalgar Square”[Minimum Scope: 1 Person, 2 Cars]

• “A green car hit a red car Trafalgar Square”[Minimum Scope: 1 Person, 2 Cars]

They will not satisfy with theirMinimum Scopeof Car (which is 2). Hence, the scope of car needs to be increased. These two messages will satisfy with the availability of 3 Cars and may refer to an incident, a pileup involving three cars, similar to what is shown in the picture (Figure 7.13). However, if we

Figure 7.13: A Pileup need to increase the scope for satisfying a compound

predicate, a good bound on theMaximum Scope that we may need to consider is the pointwise sum of the minimum scope of individual messages. Hence, for

the above two statements, the pointwise sum of the minimum scope for ‘Person’ and ‘Car’ are (1 + 1 =) 2 and (2 + 2 =) 4, respectively. However, with maximum scope all the messages in a cluster (compound predicate) will satisfy together unless they make contradictory statements about some definite identifier. The above two statements are consistent if we allow four cars and two distinct incidents, but they are perhaps more likely inconsistent reports of a single incident with two cars.

World View Construction Process:

If is a compound predicate and it does not satisfy with the minimum scope, then we try all of the following combinations of the messages it contains:

Each of the satisfying combinations forms a world view and the unsatisfying com- binations will be split further to check if they form any smaller world views.

Figure 7.14: World View Construction Process

This process (illustrated in Figure 7.14) continues until it comes to the point that none of the messages are consistent with each other and we get world views with a single message in each of them. This ensures that we get the complete list of possible world views. This operation of generating message-combinations and checking their satisfiability by feeding each combination into the Alloy Analyzer is performed by the Consistency Analysis and Conflict Resolution unit (tagged 5 in the system archi- tecture, shown in Figure 5.1 and Figure 7.1). Hence, the Consistency Analysis and

Conflict Resolution unit has mainly two internal components: Message-Cluster Gen- erator and Model Finder (Alloy Analyzer). The overall process of generating world views is shown in Figure 7.15. The process shown in Figure 7.15 involves a breadth- first search for finding world views. The process of finding a world view which involves depth-first search is shown in the appendix in Figure B.1 (Appendix B).

During the whole process, care needs to be been taken to avoid checking the satisfiability of the same element twice. The first occurrence of a cluster is checked for satisfiability but all subsequent occurrences are ignored. Also, if a larger world view is found, then there is no need to consider any of its subsets as a world view.

Note: None of the factors can be a subset on a World View until we actually find a World View which is not atomic. Hence, the coloured decision symbol does not need to be used until then.

World Views Largest Cluster Satisfiable (SAT) ? YES YES NO END START Factorise [ nCn-1 ] &

Repeat for Each Factor NO Largest Cluster NO No. of Unfactorised Clusters > 0 ? Subset of an existing World View or

Unfactorised Cluster? Unsatisfiable

Clusters

Read Unsatisfiable Clusters from Database that haven’t been Factorised.

Repeat this step until ‘END’ (Step 8) is reached 1 2 3 4 5 6 7 8 10 9 1. Sort unfactorised clusters in

Descending Order according to their size (string-length) 2. Select the Largest Cluster &

Mark it as Factorised in the database

Figure 7.15: Process Diagram of the World View Generator (Breadth-First Search)

For example, if we get the world view ABFG, then we will disregard all of its subsets e.g. ABF, ABG, etc. If, in any case, a larger world view is found that is a superset of one or more existing smaller world views, then the only larger world view is kept by discarding all its existing subsets (smaller world views). Hence, in a worst case scenario when none of the messages in a cluster of n number of messages are consistent with each other, a total of

n P

i=1 nc

1 distinct combination of messages will

have to be checked for satisfiability.

Illustration of the Process Diagram in Figure 7.15 with an Example

Suppose we have four messages A, B, C and D. Hence, the largest possible message-cluster is ABCD. Suppose ABD and AC are the two world views that can be constructed from these four messages.

Step - 1: ABCD Step - 2: No

Step - 3: ABCD is stored in the database as unsatisfiable cluster (, which has not been factorised yet)

Iteration - 1:

Step-5: ABCD Step-6: Yes Step-7: ABCD

Step-9: ABCD is factorised into the factors ABC, ABD, ACD, and BCD. Perform the following steps (Steps 10, 2 and 3 or 4) for each of these factors. Iteration-1 (ABC) Iteration-2 (ABD) Iteration-3 (ACD) Iteration-4 (BCD) Step-10 No No No No Step-2 No Yes No No Step-3/4 Step-3 (Saved as an Unsatisfiable Cluster) Step-4 (Saved as a World View) Step-3 Step-3

Iteration - 2:

Step-5: ABC, ACD, and BCD Step-6: Yes

Step-7: ABC (is selected from ABC, ACD, and BCD) Step-9: ABC is factorised into the factors AB, AC, and BC.

Perform Step-10 for each of these factors.

Iteration-1 (AB) Iteration-2 (AC) Iteration-3 (BC) Step-10: Yes

(Subset of the World View ABD. No further action is taken) Step-10: Yes (Subset of Unfactorised Cluster ACD. No further action is taken) Step-10: Yes (Subset of Unfactorised Cluster BCD. No further action is taken) Iteration - 3: Step-5: ACD, BCD Step-6: Yes

Step-7: ACD is selected from ACD and BCD

Step-9: ACD is factorised into the factors AC, AD, and CD. Perform the following step(s) for each of these factors.

Iteration-1 (AC) Iteration-2 (AD) Iteration-3 (CD)

Step-10: No Step-10: Yes

(Subset of Unfactorised Cluster ABD. No further action is taken) Step-10: Yes (Subset of Unfactorised Cluster BCD. No further action is taken) Step-2: Yes Step-4 (saved as a World View)

Iteration continues in the same manner, until the number of unfactorised clusters is found zero i.e. Step 6 returns ‘No’ and execution stops (Step 8).