Complete deduce_semantic behavior and tests