def _verify_queries()

in src/lic/ppl/inference/abstract_infer.py [0:0]


def _verify_queries(queries: List[RVIdentifier]) -> None:
    if not isinstance(queries, list):
        t = type(queries).__name__
        raise TypeError(
            f"Parameter 'queries' is required to be a list but is of type {t}."
        )

    for query in queries:
        if not isinstance(query, RVIdentifier):
            t = type(query).__name__
            raise TypeError(
                f"A query is required to be a random variable but is of type {t}."
            )
        for arg in query.arguments:
            if isinstance(arg, RVIdentifier):
                raise TypeError(
                    "The arguments to a query must not be random variables."
                )