Ask Your Question
0

How to evaluate a Boolean function at a point

asked 2022-01-23 19:19:20 +0200

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))

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-01-23 22:26:15 +0200

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.

edit flag offensive delete link more

Comments

Thanks a lot

Sanu gravatar imageSanu ( 2022-01-24 03:57:56 +0200 )edit

thanks very much

minionsss gravatar imageminionsss ( 2022-02-23 03:19:01 +0200 )edit

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: 2022-01-23 19:19:20 +0200

Seen: 36 times

Last updated: Jan 23