Algebraic formalization of smart systems : Theory and practice.