Skip to contents

gateinputcount(expr) counts the inputs of the logic gates (And, Or, Xor, Not and ITE) in a boolean expression, as SymPy's gateinputcount().

Usage

gateinputcount(expr)

Arguments

expr

A boolean expression.

Value

An integer.

Examples

a <- Symbol("a"); b <- Symbol("b"); c <- Symbol("c")
gateinputcount(Or(a, And(b, c)))
#> [1] 4