Explanation of rules

Beat independent rules

In order of execution:

rest
Rests can't be altered or imperfected.
coloration
Colored notation is assumed to be simple duple and labelled accordingly.
I.2.a.PerfDot
Dot of augmentation following a regularly perfect note.
simpleDot
Simple dot of augmentation.
unalterableImperfect
Any note that is not regularly perfect and that is not a direct part of a ternary note is unalterable imperfect.
unalteredImperfectAfterLarger
An alterable note preceded by a larger note is followed by a larger note and regularly imperfect.
A.2b
unalteredImperfect
A regularly imperfect alterable note that is not followed by a larger note.
I.2.b.antesim
If a regularly perfect note is followed immediately by a note or rest at the same level, the former cannot be imperfected.

Compex analysis

Imperfection

I.3
A regularly perfect note that falls on the first subunit of its own unit and is followed by any larger note or rest is ipso facto perfect.
I.4a
A regularly perfect note that falls on the first subunit of its own unit and is followed, before the next note or rest of its own value or larger or before a dot of division, by the equivalent of one note that would imperfect it is imperfected from behind by that note or equivalent.
I.4b
I.4bi
I.4bii
I.5
A regularly perfect note that falls on the first subunit of its own unit and is followed, before the next note or rest of its own value or larger or before a dot of division, by the equivalent of two notes that would imperfect it is perfect, provided that the last of these can be altered.
I.5-add
I.5-literalunits
I.6
A regularly perfect note that falls on the first subunit of its own unit and is followed, before the next note or rest of its own value or larger or before a dot of division, by the equivalent 3 or 6 notes that would imperfect it is perfect (even if the last note of this series is potentially alterable), unless a dot of division forces it to be imperfected (rule I.4).
I.6-literalunits
Trusting in alteration
I.8
A regularly perfect note that falls on the second subunit of its own unit is imperfected from ahead by what would imperfect it, either immediately or by syncope.
I.9a
A regularly perfect note that falls on the third subunit of its own unit is imperfected from ahead by what would imperfect it, either immediately or by syncope, unless it is followed by what would imperfect it, immediately followed by a dot of division, in which case it is imperfected from behind.
I.9b

Alteration

A.1
An alterable note on the second beat gets altered.
A.2
An alterable note that is preceded by a dot of division followed by the equivalent of its own regular value and followed by a note or rest of the perfect unit next larger is altered.
A.xxx
A.xxz