[BACK]Return to sugar.sm1 CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

File: [local] / OpenXM / src / kan96xx / Kan / sugar.sm1 (download)

Revision 1.2, Sun Jan 16 07:55:41 2000 UTC (24 years, 4 months ago) by takayama
Branch: MAIN
CVS Tags: maekawa-ipv6, R_1_3_1-2, RELEASE_20000124, RELEASE_1_3_1_13b, RELEASE_1_2_3_12, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, RELEASE_1_1_3, RELEASE_1_1_2, KNOPPIX_2006, HEAD, DEB_REL_1_2_3-9
Changes since 1.1: +1 -0 lines

Congratulation of sm1 version 3.* !

%% $OpenXM: OpenXM/src/kan96xx/Kan/sugar.sm1,v 1.2 2000/01/16 07:55:41 takayama Exp $
%% sugar.sm1,   It should be developed on 300CT. 1998, 1/27 --
%% sugar.sm1  1998, 1/29.

[(getOptions)
 [( getOptions [<options for system_variable>  <options for switch_function>])
  (cf. restoreOptions)
 ]
] putUsages
[(restoreOptions)
 [([<options for system_variable>  <options for switch_function>] restoreOptions)
  (cf. getOptions)
 ]
] putUsages
[(groebner_sugar)
 [(groebner_sugar computes Groebner basis by the sugar strategy.)
  (Format of arguments and results are as same as that of groebner.)
  (See groebner.  When you compute in the ring of polynomials,)
  $it is recommended to turn on the switch [(UseCriterion1) 1] system_variable$
  (Note that groebner_sugar does not use the homogenized Weyl algebra.)
  (So, it does work only for term orders. Never use negative weight vectors.)
 ]
] putUsages

/getOptions {
 [ 
  [
   [(ReduceLowerTerms) [(ReduceLowerTerms)] system_variable]
   [(Sugar) [(Sugar)] system_variable]
   [(Homogenize) [(Homogenize)] system_variable]
   [(CheckHomogenization) [(CheckHomogenization)] system_variable]
   [(UseCriterion2B) [(UseCriterion2B)] system_variable]
   [(UseCriterion1) [(UseCriterion1)] system_variable]
   [(Statistics) [(Statistics)] system_variable]
   [(KanGBmessage) [(KanGBmessage)] system_variable]
   [(Verbose) [(Verbose)] system_variable]
   [(Homogenize_vec) [(Homogenize_vec)] system_variable]
  ]
  [ [(mmLarger) (report) (mmLarger) switch_function]
    [(mpMult) (report) (mpMult) switch_function]
    [(monomialAdd) (report) (monomialAdd) switch_function]
    [(red@) (report) (red@) switch_function]
    [(sp) (report) (sp) switch_function]
    [(grade) (report) (grade) switch_function]
    [(groebner) (report) (groebner) switch_function]
  ]
 ]
} def

/restoreOptions {
 /arg1 set
 [/opt ] pushVariables
 [
    /opt arg1 def
    opt 0 get { system_variable } map
    opt 1 get { aload pop switch_function } map
 ] pop
 popVariables
} def
  
/on_sugar_mode {
  [(ReduceLowerTerms) 0] system_variable
  [(Sugar) 1] system_variable
  [(Homogenize) 0] system_variable
  [(CheckHomogenization) 0] system_variable
  [(UseCriterion2B) 1] system_variable
} def

/off_sugar_mode {
  [(ReduceLowerTerms) 1] system_variable
  [(Sugar) 0] system_variable
  [(Homogenize) 1] system_variable
  [(CheckHomogenization) 1] system_variable
  [(UseCriterion2B) 0] system_variable
} def

/groebner_sugar {
  /arg1 set
  [/savedopt  /ff] pushVariables
  [
     /ff arg1 def
     /savedopt getOptions def
     on_sugar_mode
     ff groebner /ff set
     savedopt restoreOptions
     /arg1 ff def
  ] pop
  popVariables
  arg1
} def

%% cf. sugar-test.sm1