=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Kan/dr.sm1,v retrieving revision 1.50 retrieving revision 1.56 diff -u -p -r1.50 -r1.56 --- OpenXM/src/kan96xx/Kan/dr.sm1 2005/06/16 08:40:04 1.50 +++ OpenXM/src/kan96xx/Kan/dr.sm1 2013/09/22 01:26:07 1.56 @@ -1,9 +1,9 @@ -% $OpenXM: OpenXM/src/kan96xx/Kan/dr.sm1,v 1.49 2005/06/16 06:21:21 takayama Exp $ +% $OpenXM: OpenXM/src/kan96xx/Kan/dr.sm1,v 1.55 2013/09/22 01:06:20 takayama Exp $ %% dr.sm1 (Define Ring) 1994/9/25, 26 %% This file is error clean. @@@.quiet { } -{ (macro package : dr.sm1, 9/26,1995 --- Version 12/10, 2000. ) message } ifelse +{ (macro package : dr.sm1, 9/26,1995 --- Version 09/22, 2013. ) message } ifelse /ctrlC-hook { %%% define your own routing in case of error. @@ -845,7 +845,7 @@ (one may use the command ) ( f (ring) data_conversion /R set) (cf. define_ring, define_qring, system_variable, poly (ring) data_conversion) - (cf. << __ >>) + (cf. << __ >>, getRing) ] ] putUsages @@ -3463,11 +3463,12 @@ newline } def [(getRing) [(obj getRing rr) - (ring rr;) + (ring rr; ) (getRing obtains the ring structure from obj.) (If obj is a polynomial, it returns the ring structure associated to) (the polynomial.) (If obj is an array, it recursively looks for the ring structure.) + (cf. ring_def) ]] putUsages /toVectors { /arg1 set @@ -4468,6 +4469,118 @@ $ [ff ff] fromVectors :: $ ] pop popVariables arg1 +} def + +[(getFileType) +[ + (string getFileType type) + $Example: (/www/prog/cohom.sm1) getFileType ==> (sm1)$ +]] putUsages +/getFileType { + /arg1 set + [/ss ] pushVariables + [ /ss arg1 def + [(stringToArgv2) ss (.)] extension /ss set + ss, ss length 1 sub, get /arg1 set + ] pop + popVariables + arg1 +} def + +% Default initial value. +/localizedString.file null def +/localizedString.dic [ ] def +/localizedString.local { } def + +% Clear and load +/localizedString.load { + /localizedString.dic [ ] def + /localizedString.local { } def + localizedString.file tag 0 eq { } + { [(parse) localizedString.file pushfile] extension pop } ifelse +} def + + +[(localizedString) + [ + (string localizedString translatedString) + (It returns localizedString if localizedString.dic [array] and) + (localizedString.local [function] are set.) + ] +] putUsages +/localizedString { + /arg1 set + [/ss /ans /tt] pushVariables + [ + arg1 /ss set + /ans ss def + { + localizedString.dic length 0 eq { exit } { } ifelse + localizedString.dic ss getNode /tt set + tt tag 0 eq { } { tt /ans set exit } ifelse + ss localizedString.local /ans set + exit + } loop + ans /arg1 set + ] pop + popVariables + arg1 +} def + +[(univ2poly) +[(list univ2poly list2) + (Change universal numbers in list to an element of a ring of polynomials) + (defined by other elements in list. If there is no polynomial element,) + (the current ring is used.) +]] putUsages +/univ2poly { + /arg1 set + [/aa /rg /ag /ans] pushVariables + [ + arg1 /aa set + [(CurrentRingp)] system_variable /rg set + aa getRing /ag set + ag tag 0 { } { + ag ring_def + } ifelse + aa univ2poly.aux /ans set + rg ring_def + ans /arg1 set + ] pop + popVariables + arg1 +} def + +/univ2poly.aux { + /arg1 set + [/aa /ans] pushVariables + [ + arg1 /aa set + aa getRing + aa tag 6 eq { + aa { univ2poly.aux} map /ans set + }{ + aa tag 15 eq, aa tag 1 eq, or { aa toString . /ans set } { + aa /ans set + } ifelse + } ifelse + ans /arg1 set + ] pop + popVariables + arg1 +} def + +/sm1log { + /arg1 set + [/ss /fd ] pushVariables + [ + arg1 /ss set + (/tmp/sm1log.txt) (a) file /fd set + fd , [[(date)] extension + ss (string) dc] cat , writestring + fd closefile + ] pop + popVariables } def ;