Index: pobysoPythonSage/src/pobyso.py
===================================================================
--- pobysoPythonSage/src/pobyso.py	(revision 36)
+++ pobysoPythonSage/src/pobyso.py	(revision 37)
@@ -13,6 +13,8 @@
  -memory management.
 """
 from ctypes import *
+import re
+from sage.symbolic.expression_conversions import polynomial
 
 (SOLLYA_BASE_FUNC_ABS,
 SOLLYA_BASE_FUNC_ACOS,
@@ -332,29 +334,15 @@
     retc = sollya_lib_get_prec_of_constant(byref(prec), ctExp, None)
     return(int(prec.value))
 
+def pobyso_lib_init():
+    sollya_lib_init(None)
+    
+def pobyso_name_free_variable(freeVariableName):
+    sollya_lib_name_free_variable(freeVariableName)
+
 def pobyso_parse_string(string):
     return(sollya_lib_parse_string(string))
 
-def pobyso_univar_polynomial_print_reverse(polySa):
-    """
-    Return the string representation of a univariate polynomial with
-    monomial ordered in the x^0..x^n order of the monomials.
-    Remember: Sage
-    """
-    polynomialRing = polySa.base_ring()
-    # A very expensive solution:
-    # -create a fake multivariate polynomial field with only one variable,
-    #   specifying a negative lexicographical order;
-    mpolynomialRing = PolynomialRing(polynomialRing.base(), \
-                                     polynomialRing.variable_name(), \
-                                     1, order='neglex')
-    # - convert the univariate argument polynomial into a multivariate
-    #   version;
-    p = mpolynomialRing(polySa)
-    # - return the string representation of the converted form.
-    # There is no simple str() method defined for p's class.
-    return(p.__str__())
-    
 def pobyso_range(rnLowerBound, rnUpperBound):
     lowerBoundSo = sollya_lib_constant(get_rn_value(rnLowerBound))
     upperBoundSo = sollya_lib_constant(get_rn_value(rnUpperBound))
@@ -391,10 +379,76 @@
 def pobyso_taylor(function, degree, point):
     return(sollya_lib_taylor(function, degree, point))
     
+# TODO: take care of the interval and of point when it is an interval;
+#       when errorType is not None;
+#       take care of the other elements of the Taylor form (coefficients errors and
+#       delta.
 def pobyso_taylorform(function, degree, point = None, interval = None, errorType=None):
+    """
+    Compute the Taylor form of 'degre' for 'function' at 'point' 
+    for 'interval' with 'errorType'. 
+    point: must be a Real or a Real interval.
+    return the Taylor form as an array
+    """
+    # Absolute as the default error.
     if errorType is None:
-        errorType = sollya_lib_absolute()
-    return(sollya_lib_taylorform(function, degree, point, errorType, None))
+        errorTypeSo = sollya_lib_absolute()
+    else:
+        #TODO: deal with the other case.
+        pass
+    varSa = function.variables()[0]
+    pointBaseRingString = str(point.base_ring())
+    if not re.search('Real', pointBaseRingString):
+        return None
+    # Call Sollya but first "sollyafy" the arguments.
+    sollya_lib_init(None)
+    pobyso_name_free_variable(str(varSa))
+    # Sollyafy the function.
+    functionSo = pobyso_parse_string(function._assume_str())
+    if sollya_lib_obj_is_error(functionSo):
+        print "pobyso_tailorform: function string can't be parsed!"
+        return None
+    # Sollyafy the degree
+    degreeSo = sollya_lib_constant_from_int(int(degree))
+    # Sollyafy the point
+    if not re.search('Interval', pointBaseRingString):
+        pointSo  = pobyso_constant(point)
+    else:
+        # TODO: deal with the interval case.
+        pass
+    # Call Sollya
+    taylorFormSo = sollya_lib_taylorform(functionSo, degreeSo, pointSo, errorTypeSo,\
+                                         None)
+    (tfsAsList, numElements, isEndElliptic) = pobyso_get_list_elements(taylorFormSo)
+    polySo = tfsAsList[0]
+    maxPrecision = pobyso_get_max_prec_of_exp(polySo)
+    polyRealField = RealField(maxPrecision)
+    expSa = pobyso_get_sage_exp_from_sollya_exp(polySo, polyRealField)
+    sollya_lib_close()
+    polynomialRing = polyRealField[str(varSa)]
+    polySa = polynomial(expSa, polynomialRing)
+    taylorFormSa = [polySa]
+    return(taylorFormSa)                    
+
+def pobyso_univar_polynomial_print_reverse(polySa):
+    """
+    Return the string representation of a univariate polynomial with
+    monomial ordered in the x^0..x^n order of the monomials.
+    Remember: Sage
+    """
+    polynomialRing = polySa.base_ring()
+    # A very expensive solution:
+    # -create a fake multivariate polynomial field with only one variable,
+    #   specifying a negative lexicographical order;
+    mpolynomialRing = PolynomialRing(polynomialRing.base(), \
+                                     polynomialRing.variable_name(), \
+                                     1, order='neglex')
+    # - convert the univariate argument polynomial into a multivariate
+    #   version;
+    p = mpolynomialRing(polySa)
+    # - return the string representation of the converted form.
+    # There is no simple str() method defined for p's class.
+    return(p.__str__())
 #
 print "Superficial test of pobyso:"    
 print pobyso_get_prec()  
Index: pobysoPythonSage/src/sollya_lib.sage
===================================================================
--- pobysoPythonSage/src/sollya_lib.sage	(revision 36)
+++ pobysoPythonSage/src/sollya_lib.sage	(revision 37)
@@ -43,9 +43,13 @@
         sollya_lib_get_prec_of_constant = sollya.sollya_lib_get_prec_of_constant
         sollya_lib_get_subfunctions = sollya.sollya_lib_get_subfunctions
         sollya_lib_head = sollya.sollya_lib_head
+        sollya_lib_init= sollya.sollya_lib_init
         sollya_lib_is_absolute = sollya.sollya_lib_is_absolute
+        sollya_lib_name_free_variable = \
+            sollya.sollya_lib_name_free_variable
         sollya_lib_obj_is_function = sollya.sollya_lib_obj_is_function
         sollya_lib_obj_is_list = sollya.sollya_lib_obj_is_list
+        sollya_lib_obj_is_error = sollya.sollya_lib_obj_is_error
         sollya_lib_is_off = sollya.sollya_lib_is_off
         sollya_lib_is_on = sollya.sollya_lib_is_on
         sollya_lib_obj_is_range = sollya.sollya_lib_obj_is_range
@@ -87,6 +91,7 @@
     sollya_lib_get_subfunctions.argtypes     = [c_int, POINTER(c_int), \
     POINTER(c_int), POINTER(c_int), POINTER(c_int), POINTER(c_int), POINTER(c_int), \
     POINTER(c_int), POINTER(c_int), POINTER(c_int), POINTER(c_int), POINTER(c_int)]
+    sollya_lib_name_free_variable.argtypes   = [POINTER(c_char)]
 except :
     print "\nOne of the Python-Sollya arguement type setting command has \
           failed.\n"
