(I hope it's okay to ask here, it seems authentication at ask.sagemath.org 
is busted currently.)

I have some code to generate randomized boolean formulas involving AND, OR, 
and IMPLIES for use in student assessments:

    props = [propcalc.formula(l) for l in "PQRS"]
    ops = ["&","|","->"]
    for _ in range(3):
        shuffle(props)
        shuffle(ops)
        p = props.pop()
        q = props.pop()
        props.append(p.add_statement(q,ops.pop()))
    statement = props[0]
    show(statement)

It's okay, but it has some superfluous parentheses I'd like to simplify. I 
also would like to compute the denial of these formulas. Is there an easy 
recipe for this I'm overlooking?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/b225303b-5f40-4ea3-ab79-6905dca1fd8en%40googlegroups.com.

Reply via email to