cvit.red 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. module cvit; % Header module for CVIT package.
  2. % Authors: A.Kryukov, A.Rodionov, A.Taranov.
  3. % Copyright (C) 1988,1990, Institute of Nuclear Physics, Moscow State
  4. % University.
  5. % VERSION 2.1
  6. % RELEASE 11-MAR-90
  7. % 07.06.90 all MAP replaced by MAP_ RT
  8. % 08.06.90 SOME MACROS FROM CVITMAP FILE ADDED to section IV RT
  9. % 10.06.90 SOME MACROS FROM CVITMAP FILE ADDED RT
  10. % Modifications for Reduce 3.4.1 by John Fitch.
  11. create!-package('(cvit red2cvit map2strn evalmaps intfierz cvitmap),
  12. '(contrib physics));
  13. % The High Energy Physics package must be loaded first.
  14. load_package hephys;
  15. % These fluids and globals have been moved here for cleaner compilation.
  16. fluid '(!*msg ndims!* dindices!*)$
  17. global '(windices!* indices!* !*cvit gamma5!* !*g5cvit)$
  18. if null windices!*
  19. then windices!*:=
  20. '(nil !_f0 !_f1 !_f2 !_f3 !_f4 !_f5 !_f6 !_f7 !_f8 !_f9)$
  21. if null gamma5!*
  22. then gamma5!*:=
  23. '(nil !_a0 !_a1 !_a2 !_a3 !_a4 !_a5 !_a6 !_a7 !_a8 !_a9)$
  24. %GGGGGGGGGGGGGGGGGGGGGGGGG GLOBALS & FLUIDS FFFFFFFFFFFFFFFFFFFFFFFFF$
  25. global '( !_0edge)$
  26. fluid '( new_edge_list old_edge_list )$
  27. % NEW_EDGE_LIST - LIST OF CREATED EDGES$
  28. % OLD_EDGE_LIST - LIST OF INITIAL EDGES$
  29. fluid '(n_edge)$
  30. % N_EDGE - NUMBER OF CREATED EDGES$
  31. % The following smacros need only be present during compilation.
  32. %************ SECTION I ************************************
  33. smacro procedure hvectorp x$
  34. get(x,'rtype) eq 'hvector$
  35. smacro procedure windexp x$
  36. x memq car windices!*$
  37. smacro procedure replace_by_indexp v$
  38. get(v,'replace_by_index)$
  39. smacro procedure indexp i$
  40. i memq indices!*$
  41. smacro procedure replace_by_vectorp i$
  42. get(i,'replace_by_vector)$
  43. smacro procedure replace_by_vector i$
  44. get(i,'replace_by_vector) or i$
  45. smacro procedure gamma5p x$
  46. memq(x,car gamma5!*)$
  47. smacro procedure nospurp x$
  48. flagp(x,'nospur)$
  49. smacro procedure clear_gamma5()$
  50. gamma5!* := nil . append(reverse car gamma5!*,cdr gamma5!*)$
  51. %********************* SECTION II **************************
  52. symbolic smacro procedure p_empty_map_ map_$
  53. % IS MAP_ EMPTY ? $
  54. null map_$
  55. symbolic smacro procedure p_empty_vertex vertex$
  56. % IS VERTEX EMPTY ? $
  57. null vertex$
  58. %++++++++++++++++++++++++++ SELECTORS +++++++++++++++++++++++++++++++$
  59. symbolic smacro procedure s_vertex_first map_$
  60. % SELECT FIRST VERTEX IN MAP_ $
  61. car map_$
  62. symbolic smacro procedure s_map__rest map_$
  63. % SELECT TAIL OF MAP_ $
  64. cdr map_$
  65. symbolic smacro procedure s_vertex_second map_$
  66. % SELECT SECOND VERTEX IN MAP_ $
  67. s_vertex_first s_map__rest map_$
  68. symbolic smacro procedure first_edge vertex$
  69. % SELECT FIRST EDGE IN VERTEX $
  70. car vertex$
  71. symbolic smacro procedure s_vertex_rest vertex$
  72. % SELECT TAIL OF VERTEX $
  73. cdr vertex$
  74. symbolic smacro procedure second_edge vertex$
  75. % SELECT SECOND EDGE IN VERTEX $
  76. first_edge s_vertex_rest vertex$
  77. symbolic smacro procedure s_edge_name edge$
  78. % SELECT EDGE'S NAME $
  79. car edge$
  80. symbolic smacro procedure s_edge_prop_ edge$
  81. % SELECT PROP_ERTY OF AN EDGE (NAMES OF PARENTS OR NUMBERS)$
  82. cadr edge$
  83. symbolic smacro procedure s_edge_type edge$
  84. % SELEC TYPE (PARITY) OF AN EDGE$
  85. caddr edge$
  86. %?????????????????????? CONSTRUCTORS ??????????????????????????????$
  87. symbolic smacro procedure add_vertex (vertex,map_)$
  88. % ADD VERTEX TO MAP_ $
  89. vertex . map_ $
  90. symbolic smacro procedure add_edge (edge,vertex)$
  91. % ADD EDGE TO VERTEX$
  92. edge . vertex$
  93. symbolic smacro procedure append_map_s (map_1,map_2)$
  94. % APPEND TWO MAP_S $
  95. append(map_1,map_2)$
  96. symbolic smacro procedure conc_map_s (map_1,map_2)$
  97. % APPEND TWO MAP_S $
  98. nconc(map_1,map_2)$
  99. symbolic smacro procedure conc_vertex (vertex1,vertex2)$
  100. % APPEND TWO VERTICES
  101. nconc(vertex1,vertex2)$
  102. symbolic smacro procedure mk_name1 name$
  103. explode name$
  104. symbolic smacro procedure mk_edge_prop_ (prop_1,prop_2)$
  105. prop_1 . prop_2 $
  106. symbolic smacro procedure mk_edge_type (typ1,typ2)$
  107. % DEFINED EDGE <=> TYPE T,
  108. % UNDEFINED EDGE <=> TYPE NIL$
  109. typ1 and typ2 $
  110. symbolic smacro procedure mk_edge (name,prop_,type)$
  111. % MAKE UP NEW EDGE $
  112. list(name,prop_,type)$
  113. symbolic smacro procedure mk_edge3_vertex (edge1,edge2,edge3)$
  114. % MAKES PRIMITIVE VERTEX $
  115. list(edge1,edge2,edge3)$
  116. symbolic smacro procedure mk_empty_map_ ()$
  117. % GENERATE EMPTY MAP_ $
  118. nil $
  119. symbolic smacro procedure mk_empty_vertex ()$
  120. % GENERATE EMPTY VERTEX $
  121. nil $
  122. symbolic smacro procedure mk_vertex1_map_ vertex1$
  123. % MAKE MAP_ OF ONE VERTEX $
  124. list(vertex1)$
  125. symbolic smacro procedure mk_vertex2_map_ (vertex1,vertex2)$
  126. % MAKE MAP_ OF TWO VERTICES $
  127. list(vertex1,vertex2)$
  128. symbolic smacro procedure mk_edge2_vertex (edge1,edge2)$
  129. %MAKES VERTEX FROM TWO EDGES$
  130. list(edge1,edge2)$
  131. symbolic smacro procedure conc_vertex (vertex1,vertex2)$
  132. nconc(vertex1,vertex2)$
  133. symbolic smacro procedure cycl_map_ map_$
  134. % MAKES CYCLIC PERMUTATION OF MAP_$
  135. append(cdr map_,list car map_)$
  136. symbolic smacro procedure cycl_vertex vertex$
  137. % MAKES CYCLIC PERMUTATION OF VERTEX$
  138. append(cdr vertex,list car vertex)$
  139. symbolic smacro procedure mk_world (actedges,world1)$
  140. list(actedges,list nil,world1)$
  141. %====================== PREDICATES (CONTINUE) =====================$
  142. symbolic smacro procedure p_member_edge (edge,vertex)$
  143. % IS EDGE (WITH THE SAME NAME) CONTAINS IN VERTEX ?$
  144. assoc(s_edge_name edge,vertex)$
  145. symbolic smacro procedure equal_edges (edge1,edge2)$
  146. % IF EDGES HAVE THE SAME NAMES ? $
  147. eq ( s_edge_name edge1, s_edge_name edge2)$
  148. symbolic smacro procedure single_no_parents edges$
  149. length edges = 1 $
  150. symbolic smacro procedure resto_map__order map_$
  151. % REVERSE (BETTER REVERSIP) MAP_ $
  152. reverse map_$
  153. symbolic smacro procedure map__length map_$
  154. % NUMBER OF VERTICES IN MAP_$$
  155. length map_$
  156. symbolic smacro procedure vertex_length vertex$
  157. % NUMBER OF EDGES IN VERTEX $
  158. length vertex$
  159. symbolic smacro procedure prepare_map_ map_$
  160. for each x in map_
  161. collect mk_old_edge x$
  162. symbolic smacro procedure p_vertex_prim vertex$
  163. % IS VERTEX PRIMITIVE ? $
  164. vertex_length (vertex) <= 3 $
  165. %************ SECTION III ************************************
  166. symbolic smacro procedure s!-edge!-name edge$ car edge$
  167. symbolic smacro procedure sappend(x,y)$ append(x,y)$
  168. symbolic smacro procedure sreverse y $ reverse y$
  169. symbolic smacro procedure getedge(x,y)$ cdr assoc(x,y)$
  170. symbolic smacro procedure mk!-road!-name(x,y,n)$
  171. list(car x . n,car y . n)$
  172. symbolic smacro procedure mk!-external!-leg edge$
  173. %< FLAG(LIST EDGE,'EXTRNL)$
  174. list( edge . 0) $
  175. symbolic smacro procedure index!-in(ind,l)$
  176. if atom ind then nil
  177. else member(ind,l)$
  178. %************ SECTION IV ************************************
  179. symbolic smacro procedure reverse_map_ map_$
  180. reverse map_$
  181. symbolic smacro procedure mk_edge1_vertex edge$
  182. list edge$
  183. symbolic smacro procedure mk_edges_vertex edges$
  184. edges$
  185. symbolic smacro procedure reversip_vertex vertex$
  186. reversip vertex$
  187. symbolic smacro procedure append_vertex (vertex1,vertex2)$
  188. append(vertex1,vertex2)$
  189. %symbolic smacro procedure conc_vertex (vertex1,vertex2)$
  190. % nconc(vertex1,vertex2)$
  191. symbolic smacro procedure mk_edge4_vertex (edge1,edge2,edge3,edge4)$
  192. list(edge1,edge2,edge3,edge4)$
  193. symbolic smacro procedure p_old_edge edge$
  194. assoc(s_edge_name edge,old_edge_list )$
  195. symbolic smacro procedure s_atlas_map_ atlas$
  196. car atlas$
  197. symbolic smacro procedure s_atlas_coeff atlas$
  198. cadr atlas$
  199. symbolic smacro procedure s_atlas_den_om atlas$
  200. caddr atlas$
  201. symbolic smacro procedure mk_atlas (map_,atlases,den_om)$
  202. list(map_,atlases,den_om)$
  203. symbolic smacro procedure vertex_edges edge$
  204. edge$
  205. symbolic smacro procedure s_coeff_world1 world1$
  206. cadr world1 $
  207. symbolic smacro procedure s_edgelist_world world$
  208. car world$
  209. symbolic smacro procedure s_world1 world$
  210. caddr world $
  211. symbolic smacro procedure s_world_var world$
  212. cadr world$
  213. symbolic smacro procedure s_world_atlas world$
  214. caddr world$
  215. symbolic smacro procedure s_world_edges world$
  216. car world$
  217. endmodule;
  218. end;