def _trunc(f, minpoly, p):
    """
    Compute the reduced representation of a polynomial `f` in
    `\\mathbb Z_p[z] / (\\check m_{\\alpha}(z))[x]`

    Parameters
    ==========

    f : PolyElement
        polynomial in `\\mathbb Z[x, z]`
    minpoly : PolyElement
        polynomial `\\check m_{\\alpha} \\in \\mathbb Z[z]`, not necessarily
        irreducible
    p : Integer
        prime number, modulus of `\\mathbb Z_p`

    Returns
    =======

    ftrunc : PolyElement
        polynomial in `\\mathbb Z[x, z]`, reduced modulo
        `\\check m_{\\alpha}(z)` and `p`

    """
    ring = f.ring
    minpoly = minpoly.set_ring(ring)
    p_ = ring.ground_new(p)
    return f.trunc_ground(p).div([minpoly, p_])[1].trunc_ground(p)
