Index: dyn_modules/syzextra/mod_main.cc
===================================================================
--- dyn_modules/syzextra/mod_main.cc	(revision 92992c08c2f387188f53d5f874a342fb60dccc06)
+++ dyn_modules/syzextra/mod_main.cc	(revision 4eba3ad2d6dfbd57121d3a026b973301857fa069)
@@ -506,6 +506,15 @@
 
 
+
 static BOOLEAN _ComputeLeadingSyzygyTerms(leftv res, leftv h)
 {
+  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
+      
+  const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
+//  const BOOLEAN __SYZCHECK__   = attributes.__SYZCHECK__;
+  const BOOLEAN __LEAD2SYZ__   = attributes.__LEAD2SYZ__;
+//  const BOOLEAN __HYBRIDNF__   = attributes.__HYBRIDNF__;
+//  const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;
+
   const ring r = currRing;
   NoReturn(res);
@@ -518,10 +527,4 @@
 
   assume( h != NULL );  
-
-#ifndef NDEBUG
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));
-#else
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));
-#endif
 
   if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
@@ -533,24 +536,13 @@
     if( __DEBUG__ )
     {
-      PrintS("ComputeLeadingSyzygyTerms::Input: \n");
-      
-      const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0)));
-      const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0)));
-      const BOOLEAN __SYZCHECK__ = (BOOLEAN)((long)(atGet(currRingHdl,"SYZCHECK",INT_CMD, (void*)0)));
-
-
-      Print("\nSYZCHECK: \t%d", __SYZCHECK__);
-      Print(", DEBUG: \t%d", __DEBUG__);
-      Print(", LEAD2SYZ: \t%d", __LEAD2SYZ__);
-      Print(", TAILREDSYZ: \t%d\n", __TAILREDSYZ__);
-
+      PrintS("ComputeLeadingSyzygyTerms::Input: \n");     
       dPrint(id, r, r, 1);
-
-      assume( !__LEAD2SYZ__ );
     }
+    
+    assume( !__LEAD2SYZ__ );
 
     h = h->Next(); assume (h == NULL);
 
-    const ideal newid = ComputeLeadingSyzygyTerms(id, r);
+    const ideal newid = ComputeLeadingSyzygyTerms(id, r, attributes);
     
     res->data = newid; res->rtyp = MODUL_CMD;
@@ -567,4 +559,12 @@
 static BOOLEAN _Sort_c_ds(leftv res, leftv h)
 {
+  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
+
+  const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
+//  const BOOLEAN __SYZCHECK__   = attributes.__SYZCHECK__;
+//  const BOOLEAN __LEAD2SYZ__   = attributes.__LEAD2SYZ__;
+//  const BOOLEAN __HYBRIDNF__   = attributes.__HYBRIDNF__;
+//  const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;
+
   NoReturn(res);
 
@@ -579,10 +579,4 @@
 
   assume( h != NULL );  
-
-#ifndef NDEBUG
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));
-#else
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));
-#endif
 
   if(    (h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
@@ -598,14 +592,4 @@
     {
       PrintS("Sort_c_ds::Input: \n");
-
-      const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0)));
-      const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0)));
-      const BOOLEAN __SYZCHECK__ = (BOOLEAN)((long)(atGet(currRingHdl,"SYZCHECK",INT_CMD, (void*)0)));   
-
-      Print("\nSYZCHECK: \t%d", __SYZCHECK__);
-      Print(", DEBUG: \t%d", __DEBUG__);
-      Print(", LEAD2SYZ: \t%d", __LEAD2SYZ__);
-      Print(", TAILREDSYZ: \t%d\n", __TAILREDSYZ__);
-
       dPrint(id, r, r, 1);      
     }
@@ -637,4 +621,12 @@
 static BOOLEAN _Compute2LeadingSyzygyTerms(leftv res, leftv h)
 {
+  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
+
+  const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
+//  const BOOLEAN __SYZCHECK__   = attributes.__SYZCHECK__;
+  const BOOLEAN __LEAD2SYZ__   = attributes.__LEAD2SYZ__;
+//  const BOOLEAN __HYBRIDNF__   = attributes.__HYBRIDNF__;
+//  const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;
+
   const ring r = currRing;
   NoReturn(res);
@@ -648,13 +640,5 @@
   assume( h != NULL );  
 
-#ifndef NDEBUG
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));
-#else
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));
-#endif
-
-  const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0)));
-  
-  assume( __LEAD2SYZ__ );
+  assume( __LEAD2SYZ__ ); // ???
   
   if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
@@ -672,5 +656,5 @@
     h = h->Next(); assume (h == NULL);
 
-    res->data = Compute2LeadingSyzygyTerms(id, r);
+    res->data = Compute2LeadingSyzygyTerms(id, r, attributes);
     res->rtyp = MODUL_CMD;
 
@@ -687,4 +671,12 @@
 static BOOLEAN _FindReducer(leftv res, leftv h)
 {
+  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
+
+  const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
+//   const BOOLEAN __SYZCHECK__   = attributes.__SYZCHECK__;
+//   const BOOLEAN __LEAD2SYZ__   = attributes.__LEAD2SYZ__;
+//   const BOOLEAN __HYBRIDNF__   = attributes.__HYBRIDNF__;
+  const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;
+
   const char* usage = "`FindReducer(<poly/vector>, <vector/0>, <ideal/module>[,<module>])` expected";
   const ring r = currRing;
@@ -692,12 +684,4 @@
   NoReturn(res);
 
-
-#ifndef NDEBUG
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));
-#else
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));
-#endif
-
-  const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0)));
 
   if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL))
@@ -766,5 +750,5 @@
 
   res->rtyp = VECTOR_CMD;
-  res->data = FindReducer(product, syzterm, L, LS, r);
+  res->data = FindReducer(product, syzterm, L, LS, r, attributes);
 
   if( __DEBUG__ )
@@ -781,4 +765,12 @@
 static BOOLEAN _SchreyerSyzygyNF(leftv res, leftv h)
 {
+  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
+
+  const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
+//   const BOOLEAN __SYZCHECK__   = attributes.__SYZCHECK__;
+//   const BOOLEAN __LEAD2SYZ__   = attributes.__LEAD2SYZ__;
+  const BOOLEAN __HYBRIDNF__   = attributes.__HYBRIDNF__;
+  const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;
+
   const char* usage = "`SchreyerSyzygyNF(<vector>, <vector>, <ideal/module>, <ideal/module>[,<module>])` expected";
   const ring r = currRing;
@@ -786,17 +778,5 @@
   NoReturn(res);
 
-#ifndef NDEBUG
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));
-#else
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));
-#endif
-
-  const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0)));
-//  const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0)));
-  const BOOLEAN __SYZCHECK__ = (BOOLEAN)((long)(atGet(currRingHdl,"SYZCHECK",INT_CMD, (void*)0)));   
-
-  const BOOLEAN __HYBRIDNF__ = (BOOLEAN)((long)(atGet(currRingHdl,"HYBRIDNF",INT_CMD, (void*)0)));
-
-  assume( __HYBRIDNF__ );
+  assume( __HYBRIDNF__ ); // ???
   
   if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL))
@@ -872,5 +852,5 @@
   
   res->rtyp = VECTOR_CMD;
-  res->data = SchreyerSyzygyNF(syz_lead, syz_2, L, T, LS, r);
+  res->data = SchreyerSyzygyNF(syz_lead, syz_2, L, T, LS, r, attributes);
 
   if( __DEBUG__ )
@@ -890,18 +870,16 @@
 static BOOLEAN _ReduceTerm(leftv res, leftv h)
 {
+  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
+
+  const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
+  const BOOLEAN __SYZCHECK__   = attributes.__SYZCHECK__;
+//   const BOOLEAN __LEAD2SYZ__   = attributes.__LEAD2SYZ__;
+//   const BOOLEAN __HYBRIDNF__   = attributes.__HYBRIDNF__;
+  const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;
+
   const char* usage = "`ReduceTerm(<poly>, <poly/vector>, <vector/0>, <ideal/module>, <ideal/module>[,<module>])` expected";
   const ring r = currRing;
 
   NoReturn(res);
-
-#ifndef NDEBUG
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));
-#else
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));
-#endif
-
-  const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0)));
-//  const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0)));
-  const BOOLEAN __SYZCHECK__ = (BOOLEAN)((long)(atGet(currRingHdl,"SYZCHECK",INT_CMD, (void*)0)));   
 
   if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL))
@@ -1014,5 +992,5 @@
 
   res->rtyp = VECTOR_CMD;
-  res->data = ReduceTerm(multiplier, term4reduction, syztermCheck, L, T, LS, r);
+  res->data = ReduceTerm(multiplier, term4reduction, syztermCheck, L, T, LS, r, attributes);
 
 
@@ -1034,16 +1012,16 @@
 static BOOLEAN _TraverseTail(leftv res, leftv h)
 {
+  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
+
+  const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
+//   const BOOLEAN __SYZCHECK__   = attributes.__SYZCHECK__;
+//   const BOOLEAN __LEAD2SYZ__   = attributes.__LEAD2SYZ__;
+//   const BOOLEAN __HYBRIDNF__   = attributes.__HYBRIDNF__;
+  const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;
+
   const char* usage = "`TraverseTail(<poly>, <poly/vector>, <ideal/module>, <ideal/module>[,<module>])` expected";
   const ring r = currRing;
 
   NoReturn(res);
-
-#ifndef NDEBUG
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));
-#else
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));
-#endif
-
-  const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)1)));
 
   if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL))
@@ -1121,5 +1099,5 @@
 
   res->rtyp = VECTOR_CMD;
-  res->data = TraverseTail(multiplier, tail, L, T, LS, r);
+  res->data = TraverseTail(multiplier, tail, L, T, LS, r, attributes);
 
 
@@ -1139,4 +1117,12 @@
 static BOOLEAN _ComputeSyzygy(leftv res, leftv h)
 {
+  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
+
+  const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
+//   const BOOLEAN __SYZCHECK__   = attributes.__SYZCHECK__;
+//   const BOOLEAN __LEAD2SYZ__   = attributes.__LEAD2SYZ__;
+//   const BOOLEAN __HYBRIDNF__   = attributes.__HYBRIDNF__;
+//   const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;
+
   const char* usage = "`ComputeSyzygy(<ideal/module>, <ideal/module>])` expected";
   const ring r = currRing;
@@ -1144,10 +1130,4 @@
   NoReturn(res);
 
-#ifndef NDEBUG
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)TRUE)));
-#else
-  const BOOLEAN __DEBUG__ = (BOOLEAN)((long)(atGet(currRingHdl,"DEBUG",INT_CMD, (void*)FALSE)));
-#endif
-
   if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
   {
@@ -1183,5 +1163,5 @@
   ideal LL, TT;
 
-  ComputeSyzygy(L, T, LL, TT, r);
+  ComputeSyzygy(L, T, LL, TT, r, attributes);
 
   lists l = (lists)omAllocBin(slists_bin); l->Init(2);
