Modeling consistency of a database -- database state and transaction