Constraint automata with memory cells and their composition