Modify basic printer for contexts

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
Add name_set typedef

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
Add head_reduce

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>