next up previous contents
Next: Transitive Closure with ZCQ Up: Signature Compilation Previous: Zero-Counting by Quadrants   Contents

Prolog Representation of ZCQ Matrices

[Code--ZCQ Matrix]
In Prolog, we represent the Zero-Counting-Quadrant (ZCQ) Matrices discussed above using the data structure presented in this section.

$\bullet$
zcm(A,B,D,C) is the basic data structure. Each argument in zcm/4 stands for a quadrant in the matrix. The correspondence is shown in Figure 3.4. This is a recursive structure which means that each one of A, B, C, or D is itself a zcm/4 or any of the other data structures presented below.

A B
D C

Figure 3.4: Matrix quadrants corresponding to arguments in zcm(A,B,D,C)

$\bullet$
The number 0 stands for a sparse matrix of 0s.

$\bullet$
zcu(A,B,C) represents an upper-triangular matrix as shown in Figure 3.5. Because it is an upper-triangular matrix, we already know that D is 0. The values of A and C need only be either zcu/3 themselves or 1. The value of B can be zcm/4 or any of the base cases mentioned below.

A B
0 C

Figure 3.5: An upper triangular matrix corresponding to zcu(A,B,C)

$\bullet$
Base Cases:


next up previous contents
Next: Transitive Closure with ZCQ Up: Signature Compilation Previous: Zero-Counting by Quadrants   Contents
TRALE Reference Manual