File mttroot/mtt/bin/trans/makesubs artifact 409b406455 part of check-in 65b5567de9


#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: makesubs
# Makes the default substitution file

# Copyright (C) 2000 by Peter J. Gawthrop


###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.2  2001/05/08 15:18:10  gawthrop
## Added trig and hyperbolic functions to argument exclusion list
##
## Revision 1.1  2000/12/28 09:09:52  peterg
## Initial revision
##
##
###############################################################

#Inform user
echo Creating $1_subs.r

cat > $1_subs.r <<EOF
% Default SUBS file
% File $1_subs.r
% Generated by MTT on `date`.

EOF

cat $MTTPATH/trans/m/rcs_header.txt	>> $1_subs.r

cat >> $1_subs.r <<EOF
% Put algebraic substitution commands here
FOR ALL i LET arbint(i) = 0; % Zap arbitary constants
END;
EOF


exit

## NB the following messes up the expansion switch ????
cat >> $1_subs.r <<EOF
% Ordering switch
ORDER
EOF

# Symbolic params first
gawk '{
  print $1 ","
}' < $1_sympar.txt >> $1_subs.r

# Then states
Nx=`mtt_getsize $1 x` # States

gawk 'END{
  for (k=1;k<Nx;k++){
    printf("mttx%i,\n", k);
  }
    printf("mttx%i;\n", Nx);
  
}' Nx=$Nx < $1_sympar.txt >> $1_subs.r

cat >> $1_subs.r <<EOF
END;
EOF











MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]