Logic for substate