@@ -81,68 +81,68 @@ def solve(F, converter=None, solver=None, n=1, target_variables=None, **kwds):
8181
8282 and pass it to a SAT solver::
8383
84- sage: from sage.sat.boolean_polynomials import solve as solve_sat # optional - cryptominisat
85- sage: s = solve_sat(F) # optional - cryptominisat
86- sage: F.subs(s[0]) # optional - cryptominisat
84+ sage: from sage.sat.boolean_polynomials import solve as solve_sat # optional - pycryptosat
85+ sage: s = solve_sat(F) # optional - pycryptosat
86+ sage: F.subs(s[0]) # optional - pycryptosat
8787 Polynomial Sequence with 36 Polynomials in 0 Variables
8888
8989 This time we pass a few options through to the converter and the solver::
9090
91- sage: s = solve_sat(F, s_verbosity=1, c_max_vars_sparse=4, c_cutting_number=8) # optional - cryptominisat
91+ sage: s = solve_sat(F, s_verbosity=1, c_max_vars_sparse=4, c_cutting_number=8) # optional - pycryptosat
9292 c ...
9393 ...
94- sage: F.subs(s[0]) # optional - cryptominisat
94+ sage: F.subs(s[0]) # optional - pycryptosat
9595 Polynomial Sequence with 36 Polynomials in 0 Variables
9696
9797 We construct a very simple system with three solutions and ask for a specific number of solutions::
9898
99- sage: B.<a,b> = BooleanPolynomialRing() # optional - cryptominisat
100- sage: f = a*b # optional - cryptominisat
101- sage: l = solve_sat([f],n=1) # optional - cryptominisat
102- sage: len(l) == 1, f.subs(l[0]) # optional - cryptominisat
99+ sage: B.<a,b> = BooleanPolynomialRing() # optional - pycryptosat
100+ sage: f = a*b # optional - pycryptosat
101+ sage: l = solve_sat([f],n=1) # optional - pycryptosat
102+ sage: len(l) == 1, f.subs(l[0]) # optional - pycryptosat
103103 (True, 0)
104104
105- sage: l = solve_sat([a*b],n=2) # optional - cryptominisat
106- sage: len(l) == 2, f.subs(l[0]), f.subs(l[1]) # optional - cryptominisat
105+ sage: l = solve_sat([a*b],n=2) # optional - pycryptosat
106+ sage: len(l) == 2, f.subs(l[0]), f.subs(l[1]) # optional - pycryptosat
107107 (True, 0, 0)
108108
109- sage: sorted((d[a], d[b]) for d in solve_sat([a*b],n=3)) # optional - cryptominisat
109+ sage: sorted((d[a], d[b]) for d in solve_sat([a*b],n=3)) # optional - pycryptosat
110110 [(0, 0), (0, 1), (1, 0)]
111- sage: sorted((d[a], d[b]) for d in solve_sat([a*b],n=4)) # optional - cryptominisat
111+ sage: sorted((d[a], d[b]) for d in solve_sat([a*b],n=4)) # optional - pycryptosat
112112 [(0, 0), (0, 1), (1, 0)]
113- sage: sorted((d[a], d[b]) for d in solve_sat([a*b],n=infinity)) # optional - cryptominisat
113+ sage: sorted((d[a], d[b]) for d in solve_sat([a*b],n=infinity)) # optional - pycryptosat
114114 [(0, 0), (0, 1), (1, 0)]
115115
116116 In the next example we see how the ``target_variables`` parameter works::
117117
118- sage: from sage.sat.boolean_polynomials import solve as solve_sat # optional - cryptominisat
119- sage: R.<a,b,c,d> = BooleanPolynomialRing() # optional - cryptominisat
120- sage: F = [a+b,a+c+d] # optional - cryptominisat
118+ sage: from sage.sat.boolean_polynomials import solve as solve_sat # optional - pycryptosat
119+ sage: R.<a,b,c,d> = BooleanPolynomialRing() # optional - pycryptosat
120+ sage: F = [a+b,a+c+d] # optional - pycryptosat
121121
122122 First the normal use case::
123123
124- sage: sorted((D[a], D[b], D[c], D[d]) for D in solve_sat(F,n=infinity)) # optional - cryptominisat
124+ sage: sorted((D[a], D[b], D[c], D[d]) for D in solve_sat(F,n=infinity)) # optional - pycryptosat
125125 [(0, 0, 0, 0), (0, 0, 1, 1), (1, 1, 0, 1), (1, 1, 1, 0)]
126126
127127 Now we are only interested in the solutions of the variables a and b::
128128
129- sage: solve_sat(F,n=infinity,target_variables=[a,b]) # optional - cryptominisat
129+ sage: solve_sat(F,n=infinity,target_variables=[a,b]) # optional - pycryptosat
130130 [{b: 0, a: 0}, {b: 1, a: 1}]
131131
132132 Here, we generate and solve the cubic equations of the AES SBox (see :trac:`26676`)::
133133
134- sage: from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence # optional - cryptominisat , long time
135- sage: from sage.sat.boolean_polynomials import solve as solve_sat # optional - cryptominisat , long time
136- sage: sr = sage.crypto.mq.SR(1, 4, 4, 8, allow_zero_inversions = True) # optional - cryptominisat , long time
137- sage: sb = sr.sbox() # optional - cryptominisat , long time
138- sage: eqs = sb.polynomials(degree = 3) # optional - cryptominisat , long time
139- sage: eqs = PolynomialSequence(eqs) # optional - cryptominisat , long time
140- sage: variables = map(str, eqs.variables()) # optional - cryptominisat , long time
141- sage: variables = ",".join(variables) # optional - cryptominisat , long time
142- sage: R = BooleanPolynomialRing(16, variables) # optional - cryptominisat , long time
143- sage: eqs = [R(eq) for eq in eqs] # optional - cryptominisat , long time
144- sage: sls_aes = solve_sat(eqs, n = infinity) # optional - cryptominisat , long time
145- sage: len(sls_aes) # optional - cryptominisat , long time
134+ sage: from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence # optional - pycryptosat , long time
135+ sage: from sage.sat.boolean_polynomials import solve as solve_sat # optional - pycryptosat , long time
136+ sage: sr = sage.crypto.mq.SR(1, 4, 4, 8, allow_zero_inversions = True) # optional - pycryptosat , long time
137+ sage: sb = sr.sbox() # optional - pycryptosat , long time
138+ sage: eqs = sb.polynomials(degree = 3) # optional - pycryptosat , long time
139+ sage: eqs = PolynomialSequence(eqs) # optional - pycryptosat , long time
140+ sage: variables = map(str, eqs.variables()) # optional - pycryptosat , long time
141+ sage: variables = ",".join(variables) # optional - pycryptosat , long time
142+ sage: R = BooleanPolynomialRing(16, variables) # optional - pycryptosat , long time
143+ sage: eqs = [R(eq) for eq in eqs] # optional - pycryptosat , long time
144+ sage: sls_aes = solve_sat(eqs, n = infinity) # optional - pycryptosat , long time
145+ sage: len(sls_aes) # optional - pycryptosat , long time
146146 256
147147
148148 TESTS:
@@ -164,7 +164,7 @@ def solve(F, converter=None, solver=None, n=1, target_variables=None, **kwds):
164164 ....: k9 + k28,
165165 ....: k11 + k20]
166166 sage: from sage.sat.boolean_polynomials import solve as solve_sat
167- sage: solve_sat(keqs, n=1, solver=SAT('cryptominisat')) # optional - cryptominisat
167+ sage: solve_sat(keqs, n=1, solver=SAT('cryptominisat')) # optional - pycryptosat
168168 [{k28: 0,
169169 k26: 1,
170170 k24: 0,
@@ -338,15 +338,15 @@ def learn(F, converter=None, solver=None, max_learnt_length=3, interreduction=Fa
338338
339339 EXAMPLES::
340340
341- sage: from sage.sat.boolean_polynomials import learn as learn_sat # optional - cryptominisat
341+ sage: from sage.sat.boolean_polynomials import learn as learn_sat # optional - pycryptosat
342342
343343 We construct a simple system and solve it::
344344
345- sage: set_random_seed(2300) # optional - cryptominisat
346- sage: sr = mq.SR(1,2,2,4,gf2=True,polybori=True) # optional - cryptominisat
347- sage: F,s = sr.polynomial_system() # optional - cryptominisat
348- sage: H = learn_sat(F) # optional - cryptominisat
349- sage: H[-1] # optional - cryptominisat
345+ sage: set_random_seed(2300) # optional - pycryptosat
346+ sage: sr = mq.SR(1,2,2,4,gf2=True,polybori=True) # optional - pycryptosat
347+ sage: F,s = sr.polynomial_system() # optional - pycryptosat
348+ sage: H = learn_sat(F) # optional - pycryptosat
349+ sage: H[-1] # optional - pycryptosat
350350 k033 + 1
351351 """
352352 try :
0 commit comments