#!/bin/sh # # $Id$ # # Copyright 1989-2016 MINES ParisTech # # This file is part of PIPS. # # PIPS is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # any later version. # # PIPS is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. # # See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with PIPS. If not, see . # # convert a transformer list of inequalities into a sc system with declaration of variables # Francois Irigoin, September 1993 input=$1 output=$2 echo -n 'VAR ' >$output sed -e 's/[-+=<>,{} ]/\ /g;s/#/_/' <$input | sed -e 's/^ *//g;s/ *$//g' | sed -e '/^$/d;/^[0-9][0-9]$/d;s/^[0-9][0-9]*\(.*\)/\1/' | sort | uniq | tr '\012' ',' | \ cat - $input | sed -e 's/,{/\ {/;s/^,//;s/#/_/' >>$output # {/' >>$output # | sed -e 's/,$/foo/' # cat $input >>$output