summaryrefslogtreecommitdiff
path: root/web/reduce/rweb/appl/liesuperconvert.web
blob: 1c03f50920b8dea46dfefa9c56f54cc6a610398e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
% Copyright (c) 1991 Marcel Roelofs, University of Twente, Enschede,
% The Netherlands.
% 
% $Header: liesuperconvert.web,v 1.1 91/09/18 17:49:54 roelofs Exp $
%

@* Conversion of vector structures. In the latest version of the
LIESUPER package, the klist mechanism has been replaced by a vector
structure based mechanism to check wether a commutator has been used
in any other algebraic expression or not. Due to this change the
entries of a vector structure also have changed. As a consequence,
save files of liebrackets written by the old package cannot be used by
the current package anymore.

Fortunately, it is still possible to read saved liebrackets without
damaging any information. The following procedure will convert the
vector structure of former liebrackets to the corresponding vector
structure of the current liebrackets. In order to understand what
happens we refer to the documentation of the LIESUPER package.

@d old_informative_part_of=car
@d old_commutator_part_of=cdr

@u lisp operator convert_liebracket;
lisp procedure convert_liebracket bracketname;
begin scalar m,n,klist,vector_structure,vector_i,entry_i_j,k_info_i_j;
  if get(bracketname,'rtype) neq 'liebracket then
    rederr "CONVERT_LIEBRACKET: argument must be a liebracket";
  m:=get(bracketname,'even_dimension);
  n:=get(bracketname,'odd_dimension);
  klist:=get(bracketname,'klist);
  vector_structure:=get(bracketname,'vector_structure);
  for i:=-n:m do 
  begin vector_i:=getv(vector_structure,n+i);
    for j:=i:m do 
    begin entry_i_j:=getv(vector_i,m-j);
      k_info_i_j:=assoc(list(bracketname,i,j),klist);
      if entry_i_j then 
          putv(vector_i,m-j,old_informative_part_of entry_i_j . k_info_i_j . 
                            old_commutator_part_of entry_i_j)
      else if k_info_i_j then
          putv(vector_i,m-j,nil . k_info_i_j . nil);
      if k_info_i_j then klist:=delete(k_info_i_j,klist)
    end
  end;
  put(bracketname,'klist,klist)
end$

@ Any REDUCE file must end with |end@;|.

@u end;