INTERFACE PZSymbol; (* Small signed integers coded into characters. *) TYPE T = CHAR; (* Encoding: 'A'..'Z' = +1..+26, 'a'..'z' = -1..-26, '0' = 0. *) PROCEDURE ToInt(ch: T): INTEGER; (* The numeric value of "ch". *) PROCEDURE FromInt(i: INTEGER): T; (* The coded representation of value "i". *) PROCEDURE Complement(ch: T): T; (* Negates the numeric value of "ch" *) PROCEDURE DistSqr(a, b: T; complement: BOOLEAN): LONGREAL; (* A discrepancy measure, squared, between "a" and "b": basically, the square of the difference "d = ToInt(a) - ToInt(b)", plus a constant term (1/6) to account for the quantization error. If "complement=TRUE", uses "Complement(b(t))" instead of "b"". *) PROCEDURE IntgDistSqr(a1, a2, b1, b2: T; complement: BOOLEAN): LONGREAL; (* The integral of "DistSqr(a(t), b(t), complement)" where "a(t)" interpolates linearly between "a1" and "a2" as "t" goes from 0 to 1; and similarly for "b(t)". *) END PZSymbol.