fix `pattern-matrix` pre conditions