Artifact 3b8f7df6f95a421e036ba55698b9de658a5c5aff1e36192b0d9c5e594194d115:


#! /bin/sh

set -e

filename="$1"

# get expression to optimise

lhs=`cat ${filename} | gawk '{ print $1 }'`
rhs=`cat ${filename} | gawk '{ print $2 }'`

# set work file names

tmp="$0.tmp"
log="$0.log"


cat <<EOF | reduce > $log
off echo$
load scope$
on double$
on noconvert$
on rounded$
off int$
off nat$

out "${tmp}"$
optimize mtt_tmp0 :=: ${rhs} iname mtt_tmp$
write "${lhs} := mtt_tmp0"$
shut "${tmp}"$

;end;
EOF

mv ${tmp} ${filename}

exit 0

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