Generalized nets and pattern recognition