template_polymorphism_candidate env ~ctor_levels uctx params
conclsort is true iff an inductive with params params, conclusion conclsort and universe levels appearing in the constructor arguments ctor_levels would be definable as template polymorphic. It should have at least one universe in its monomorphic universe context that can be made parametric in its conclusion sort, if one is given. If the Template Check flag is false we just check that the conclusion sort is not small.
sign_level env sigma ctx computes the universe level of the context ctx as the sup of its individual assumptions, which should be well-typed in env and sigma