First time here? Check out the FAQ!

Ask Your Question
0

How to evaluate a Boolean function at a point

asked 3 years ago

Sanu gravatar image

I want to evaluate a Boolean function at a point as follows but it is giving error

V=BooleanPolynomialRing(6,['x%d'%(i) for i in range(6)] )

V.inject_variables()

Z_1 = list(V.gens())

f=x1

A=[]

for i in range(6):
A.append(ZZ.random_element(2))

print(f(A))

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 3 years ago

rburing gravatar image

Try this:

f(*A)

It passes the elements of A to f as six arguments, instead of passing one argument which is the whole list.

Preview: (hide)
link

Comments

Thanks a lot

Sanu gravatar imageSanu ( 3 years ago )

thanks very much

minionsss gravatar imageminionsss ( 3 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 170 times

Last updated: Jan 23 '22