I see.

It would be better/safer to keep x1, ..., xn for the variables of the
ring and use other variables for your sequence. One solution is to put
the values into a tuple and use the syntax f(*X) to expand your tuple
as different argument into a function. Here is a precise example

sage: R.<x1,x2,x3,x4> = BooleanPolynomialRing()
sage: f1 = x1*x2 + x3 + x4
sage: f2 = x2*x3
sage: f3 = x1 + x4
sage: f4 = x1 + x2
sage: X0 = (x1,x2,x3,x4)
sage: X1 = (f1(*X0), f2(*X0), f3(*X0), f4(*X0))
sage: X2 = (f1(*X1), f2(*X1), f3(*X1), f4(*X1))
sage: X0
(x1, x2, x3, x4)
sage: X1
(x1*x2 + x3 + x4, x2*x3, x1 + x4, x1 + x2)
sage: X2
(x1*x2*x3 + x2*x3*x4 + x2*x3 + x2 + x4,
 x1*x2*x3 + x2*x3*x4,
 x1*x2 + x1 + x2 + x3 + x4,
 x1*x2 + x2*x3 + x3 + x4)

Is your n fixed (n=4 in my example above) or you want it to be a parameter ?

Vincent

2015-01-03 18:52 UTC+01:00, Dibyendu Roy <dibyendu.roy1...@gmail.com>:
> Actually i want do the following thing:
>
> first i want to define n boolean variables say x1,....xn then i want to
> update each variable by a function of x1,x2.....,xn in each step. That
> means in first step x1 will be updated by an boolean expression of
> x1,....,xn. second step also it will be updated by another boolean
> expression. And finally i want to find the expresion of say xi.
>
> for i =1 to k
> { x1=f1(x1,...,xn)
>   x2=f2(x1,...,xn)
>   ...
> ...
>
>   xn=fn(x1,...,xn)
> }
> finally return x1,....,xn
>
> On Saturday, January 3, 2015 2:29:21 PM UTC+5:30, Dibyendu Roy wrote:
>>
>> I am learning sage for first time. I want to do iteration in boolean
>> polynomial ring.
>>
>> sage: from polybori import *
>> sage: declare_ring([Block('x',177),Block('y',2)],globals())
>> sage: r
>> sage: x(1)=x(0)*y(0)
>>
>> Its showing me following error
>>
>> ValueError: Argument names should be valid python identifiers.
>>
>> actually i want to update the variables x(1) by x(0)*y(0). please help me
>>
>>
>
> --
> 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 sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to