Unified algebra of constraints