Split sygus template inference to its own file (#5388)