Lattice Structure of Some Closed Classes for Three-Valued Logic and Its Applications