Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 8800
1
r"""
2
"""
3
4
#*****************************************************************************
5
# Copyright (C) 2016 Paul Leopardi [email protected]
6
#
7
# Distributed under the terms of the GNU General Public License (GPL)
8
# as published by the Free Software Foundation; either version 2 of
9
# the License, or (at your option) any later version.
10
# http://www.gnu.org/licenses/
11
#*****************************************************************************
12
13
import re
14
15
encoding = 'UTF-8'
16
17
def read_langevin_hou_anf_list(anf_file):
18
r"""
19
20
Classification of partial spread functions in eight variables
21
http://langevin.univ-tln.fr/project/spread/psp.html
22
23
Langevin, Philippe, and Xiang-Dong Hou.
24
"Counting partial spread functions in eight variables."
25
IEEE Transactions on Information Theory 57, no. 4 (2011): 2263-2269.
26
27
"""
28
29
R8.<x1,x2,x3,x4,x5,x6,x7,x8> = BooleanPolynomialRing(8)
30
31
anf_list = [None]
32
line = None
33
while line != '':
34
line = anf_file.readline().decode(encoding)
35
match = re.match('anf=(.*)', line)
36
37
if match != None:
38
anf_abbr = match.groups()[0]
39
anf_pass1 = re.sub('([1-8])', 'x\\1', anf_abbr)
40
anf = eval(re.sub('([1-8])x', '\\1*x', anf_pass1))
41
anf_list.append(anf)
42
43
anf_file.close()
44
45
return anf_list
46
47
48