def pretty_print_prime_rules(primes):
    """Prints pyboolnet a prime dictionary as Boolean rules
    The output format is of the form:
    A* = B & C | !D, for example.

    Parameters
    ----------
    primes : pyboolnet primes dictionary
        Update rules to print.

    """

    if primes is None:
        return ""

    for k,v in primes.items():
        s = k + "* = "
        sl = []
        for c in v[1]:
            sll = []
            for kk,vv in c.items():
                if vv: sli = kk
                else: sli = '!'+kk
                sll.append(sli)
            if len(sll) > 0:
                sl.append(' & '.join(sll))
        if len(sl) > 0:
            s += ' | '.join(sl)
        if v[1]==[]:
            s = k + "* = 0"
        if v[1]==[{}]:
            s = k + "* = 1"
        print(s)