def sort_decls(structs):
    """Generate the set of all (uninterpreted) sort declarations from a set of predefined structures.

    Return (possibly empty) dictionary of sort declarations suitable for z3 python API."""
    sorts = [struct.sort.ref for struct in structs
             if struct.sort.to_declare()]
    return { str(s) : s for s in sorts }