IEEE Systems, Man and Cybernetics Magazine - July 2018 - 20

Reasoning About and Applying Patterns

◆ Lifting: Assume that X = " x i | i = 1, f, m , 1 VP, m # n.

P ^ X - Xs h is the pattern such that
Subpattern Relations
Many kinds of relationships between patterns can be
defined in predicate logic so that the verification of
such a relationship can be converted into logic inference
problems. A typical example of such relationships is
the subpattern.
Definition 5 (subpattern and equivalent patterns): Let P
and W be two patterns in a domain D . We say that P and
W are equivalent and write P . W, if Sem (P) + Sem (W) .
We say that P is a subpattern of W and write P d W iff
Sem (P) & Sem (W) .
For example, for the BC floor tile layout pattern, if we
add a condition that the central tiles are horizontally and
vertically connectable, we obtain a subpattern that we call
BC-HVCon. If we replace the connectability conditions of
BC-HVCon with the condition that the tiles in the central
block display central symmetry, then the resulting pattern,
called BC-CSym, is a subpattern of BC-HVCon. This is
because we can prove from the axioms that central symmetry implies horizontal and vertical connectability.
Operators on Patterns for
Composition and Instantiation
Operators on patterns have been shown to be particularly
valuable in the context of software design patterns, where
they can be used to define pattern compositions and instantiations [8]. Now we revisit those definitions to demonstrate
their applicability to a more general notion of patterns.
Definition 6 (pattern operators): Let P and H be any
given patterns of a domain D, VP = Var ^P h = " x i : Ti | i = 1,
f, n ,, and Pred ^P h = p ^ x 1, f, x n h .
◆ Restriction: Let c be a predicate on VP . P [c] is the
pattern such that
Var ^P 6c@h =T Var ^P h, and

Pred ^P 6c@h =T p / c.

◆ Superposition: Assume that VP + Var (H) = 0/. P * H is

the pattern such that
Var ^P * H h =T Var ^P h , Var ^H h, and
Pred ^P * H h =T Pred ^P h / Pred ^H h .
◆ Generalization: Assume that x = x i ! VP, X " VP .

P ^ x / X h is the pattern such that
Var ^P ^ x / X hh =T VP - " x i : Ti , , " X : P ^Ti h,,
T

Pred ^P ^ x / X hh = 6x i ! X.p ^ x 1, f, x i, f, x n h .
◆ Flattening: Assume that X = x i ! VP and Ti = P (T) .

Var ^P ^ X - Xs hh =T " xs i : P (Ti) | i = 1, f, n ,,
Pred ^P ^ X - Xs hh =T 6x 1 ! xs 1, f, 6x m ! xs m ·
7x m + 1 ! xs m + 1, f, 7x n ! xs n · p ^ x 1, f, x n h .
First, note that the operators on patterns are defined
constructively. They can be easily implemented as syntactical transformations of the logical statements of the patterns. Second, a correct renaming of the variables in a
pattern will not affect its meaning. In the sequel, we write
P (x/xl ) to denote the systematic replacement in pattern
P of the variable x with variable xl.
We write pattern expressions with pattern variables,
constants, and operators to define predicates and functions
on patterns. This results in a formalism of very powerful
expressiveness to represent the knowledge of a subject
domain. The following example demonstrates how pattern
operators can be used to represent domain knowledge,
such as how to compose and instantiate patterns.
Example 4: Application of Pattern Operators.
We start with a simple pattern H2 that consists of two
tiles A and B of the same image and that A is laid on the
left of B.
Var (H2) =T " A, B : Tile ,
Pred (H2) =T OnLeft (A, B) / ^ A.Image = B.Imageh
/ A.HCon.
A horizontal line (HL) of tiles laid next to one another
can be defined by applying the lift operator with a constraint condition as follows:
HL =T H2 _ A - As =T " A i | i = 1, f, n ,i

7Bs =T " B i | OnLeft (A i, B i), i = 1, f, n ,

/ 6i ! " 1, f, n - 1 , . ^ A i + 1 = B i h@ .

A matrix is a pattern that consists of n # m tiles. It can
be defined as a number of HLs placed one below another.
Thus, we have that
Matrix =T HL ^l / ls = " l 1, ..., l n ,h
[6i ! " 1, f, n - 1 , · ^^| l i | = | l i + 1 | h / Below ^l i + 1, l i hh].
Here, the binary predicate Below ^ x, y h on HLs of equal
length is defined as follows. Let n = | x.l | = | y.l | .
Below ^ x, y h =T 6i ! " 1, f, n , · Below ^ x.l i, y.l i h .

P (X 0 x) is the pattern such that
Var ^P ^ X 0 x hh =T Var (P) - " x i : P (T)} , {x : T ,,
Pred ^P ^ X 0 x hh =T p ^ x 1, f, {x}, f, x n h .
20

IEEE SyStEmS, man, & CybErnEtICS magazInE July 2 0 1 8

Similarly, we can generalize other attributes and relations of tiles to those of HLs L of n tiles, even a matrix
M of n # m tiles. New functions and predicates can also



Table of Contents for the Digital Edition of IEEE Systems, Man and Cybernetics Magazine - July 2018

Contents
IEEE Systems, Man and Cybernetics Magazine - July 2018 - Cover1
IEEE Systems, Man and Cybernetics Magazine - July 2018 - Cover2
IEEE Systems, Man and Cybernetics Magazine - July 2018 - Contents
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 2
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 3
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 4
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 5
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 6
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 7
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 8
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 9
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 10
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 11
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 12
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 13
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 14
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 15
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 16
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 17
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 18
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 19
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 20
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 21
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 22
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 23
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 24
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 25
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 26
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 27
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 28
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 29
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 30
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 31
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 32
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 33
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 34
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 35
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 36
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 37
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 38
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 39
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 40
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 41
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 42
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 43
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 44
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 45
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 46
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 47
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 48
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 49
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 50
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 51
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 52
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 53
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 54
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 55
IEEE Systems, Man and Cybernetics Magazine - July 2018 - 56
IEEE Systems, Man and Cybernetics Magazine - July 2018 - Cover3
IEEE Systems, Man and Cybernetics Magazine - July 2018 - Cover4
https://www.nxtbook.com/nxtbooks/ieee/smc_202310
https://www.nxtbook.com/nxtbooks/ieee/smc_202307
https://www.nxtbook.com/nxtbooks/ieee/smc_202304
https://www.nxtbook.com/nxtbooks/ieee/smc_202301
https://www.nxtbook.com/nxtbooks/ieee/smc_202210
https://www.nxtbook.com/nxtbooks/ieee/smc_202207
https://www.nxtbook.com/nxtbooks/ieee/smc_202204
https://www.nxtbook.com/nxtbooks/ieee/smc_202201
https://www.nxtbook.com/nxtbooks/ieee/smc_202110
https://www.nxtbook.com/nxtbooks/ieee/smc_202107
https://www.nxtbook.com/nxtbooks/ieee/smc_202104
https://www.nxtbook.com/nxtbooks/ieee/smc_202101
https://www.nxtbook.com/nxtbooks/ieee/smc_202010
https://www.nxtbook.com/nxtbooks/ieee/smc_202007
https://www.nxtbook.com/nxtbooks/ieee/smc_202004
https://www.nxtbook.com/nxtbooks/ieee/smc_202001
https://www.nxtbook.com/nxtbooks/ieee/smc_201910
https://www.nxtbook.com/nxtbooks/ieee/smc_201907
https://www.nxtbook.com/nxtbooks/ieee/smc_201904
https://www.nxtbook.com/nxtbooks/ieee/smc_201901
https://www.nxtbook.com/nxtbooks/ieee/smc_201810
https://www.nxtbook.com/nxtbooks/ieee/smc_201807
https://www.nxtbook.com/nxtbooks/ieee/smc_201804
https://www.nxtbook.com/nxtbooks/ieee/smc_201801
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_1017
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0717
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0417
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0117
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_1016
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0716
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0416
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0116
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_1015
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0715
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0415
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0115
https://www.nxtbookmedia.com