// MatchScore: the score of aligning letter A with letter B: Match when they // are the same letter, Mismatch otherwise. The simplest substitution score; // a substitution matrix such as BLOSUM62 replaces it for proteins. FUNCTION MatchScore(A : CHAR, B : CHAR, Match : INTEGER, Mismatch : INTEGER) RETURNS INTEGER ENSURE (A == B AND RESULT == Match) OR (A != B AND RESULT == Mismatch) IF A == B THEN RETURN Match ENDIF RETURN Mismatch ENDFUNCTION