Hi, I am using Sage 7.2 built from sources.
If I save a BooleanFunction of 6 variables, it loads OK.
If I save a BooleanFunction of 8 variables, loading gives an exception
error message:
ValueError: (ValueError('the length of the truth table must be a power of
2',), <built-in function unpickle_BooleanFunction>,
('22d222d2dd2d22d222d222d2dd2d22d2dd2ddd2d22d2dd2d22d222d2dd2d22d222d222d2dd2d22d2dd2ddd2d22d2dd2d22d222d2dd2d22d2',))
See the attachments for a transcript and the saved sobj files for details.
It looks like the save didn't work correctly. Should I report this as a bug?
All the best, Paul
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.
sage: sigma_bf_list[3]
Boolean function with 6 variables
sage: len(sigma_bf_list[3].truth_table())
64
sage: save(sigma_bf_list[3],"sigma_3")
sage: saved_sigma_3=load("sigma_3")
sage: sigma_bf_list[4]
Boolean function with 8 variables
sage: len(sigma_bf_list[4].truth_table())
256
sage: save(sigma_bf_list[4],"sigma_4")
sage: saved_sigma_4=load("sigma_4")
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-43-01693bb272b5> in <module>()
----> 1 saved_sigma_4=load("sigma_4")
/home/leopardi/opt/sage/sage-7.2/src/sage/structure/sage_object.pyx in
sage.structure.sage_object.load
(/home/leopardi/opt/sage/sage-7.2/src/build/cythonized/sage/structure/sage_object.c:11626)()
1030
1031 ## Load file by absolute filename
-> 1032 X = loads(open(filename).read(), compress=compress)
1033 try:
1034 X._default_filename = os.path.abspath(filename)
/home/leopardi/opt/sage/sage-7.2/src/sage/structure/sage_object.pyx in
sage.structure.sage_object.loads
(/home/leopardi/opt/sage/sage-7.2/src/build/cythonized/sage/structure/sage_object.c:13854)()
1406 unpickler.find_global = unpickle_global
1407
-> 1408 return unpickler.load()
1409
1410
/home/leopardi/opt/sage/sage-7.2/src/sage/crypto/boolean_function.pyx in
sage.crypto.boolean_function.unpickle_BooleanFunction
(/home/leopardi/opt/sage/sage-7.2/src/build/cythonized/sage/crypto/boolean_function.c:16987)()
1109 True
1110 """
-> 1111 return BooleanFunction(bool_list)
1112
1113 cdef class BooleanFunctionIterator:
/home/leopardi/opt/sage/sage-7.2/src/sage/crypto/boolean_function.pyx in
sage.crypto.boolean_function.BooleanFunction.__cinit__
(/home/leopardi/opt/sage/sage-7.2/src/build/cythonized/sage/crypto/boolean_function.c:8539)()
292 x = ZZ("0x"+x).digits(base=2,padto=4*L)
293 else:
--> 294 raise ValueError, "the length of the truth table must
be a power of 2"
295 from types import GeneratorType
296 if isinstance(x, (list,tuple,GeneratorType)):
ValueError: (ValueError('the length of the truth table must be a power of 2',),
<built-in function unpickle_BooleanFunction>,
('22d222d2dd2d22d222d222d2dd2d22d2dd2ddd2d22d2dd2d22d222d2dd2d22d222d222d2dd2d22d2dd2ddd2d22d2dd2d22d222d2dd2d22d2',))
sigma_3.sobj
Description: Binary data
sigma_4.sobj
Description: Binary data
