I'm trying to use the CNFEncode module in sagemath. After I got a few strange errors I tried to simply copy and execute the code snippet provided with the documentation inside Sage Cloud. But I got some errors

```
sage: B.<a,b,c> = BooleanPolynomialRing
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-ce036e32ef87> in <module>()
----> 1 B = BooleanPolynomialRing; (a, b, c,) = B._first_ngens(3)
AttributeError: 'function' object has no attribute '_first_ngens'
```

I managed to got past that with:

```
B = BooleanPolynomialRing(3,["a","b","c"])
```

But after a few lines I'm stuck again, here:

```
sage: B = BooleanPolynomialRing(3,["a","b","c"])
sage: from sage.sat.converters.polybori import CNFEncoder
sage: from sage.sat.solvers.dimacs import DIMACS
sage: fn = tmp_filename()
sage: solver = DIMACS(filename=fn)
sage: e = CNFEncoder(solver, B)
sage: e.clauses_sparse(a*b + a + 1)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-8-0dac365c6fab> in <module>()
----> 1 e.clauses_sparse(a*b + a + Integer(1))
NameError: name 'a' is not defined
```

I tried to change the last line, but I simply got to another error:

```
sage: e.clauses_sparse("a*b + a + 1")
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-10-081f32dddbcf> in <module>()
----> 1 e.clauses_sparse("a*b + a + 1")
/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/sat/converters/polybori.py in clauses_sparse(self, f)
284 # any zero block of f+1
285
--> 286 blocks = self.zero_blocks(f+1)
287 C = [dict([(variable, 1-value) for (variable, value) in b.iteritems()]) for b in blocks ]
288
TypeError: cannot concatenate 'str' and 'int' objects
```

I'm pretty stuck with this and I can't find any kind of help in the documentation (beside the same code I can't get to work)