lib/Tools/codegen
author wenzelm
Mon, 22 Sep 2008 15:26:11 +0200
changeset 28318 6b8d001ce1de
parent 28142 cf8da9bbc584
child 28502 6b0e3e4e1891
permissions -rwxr-xr-x
removed deriv.ML which is now incorporated into thm.ML;

#!/usr/bin/env bash
#
# $Id$
# Author: Florian Haftmann, TUM
#
# DESCRIPTION: issue code generation from shell


## diagnostics

PRG="$(basename "$0")"

function usage()
{
  echo
  echo "Usage: $PRG IMAGE THY CMD"
  echo
  echo "  Issues code generation using image IMAGE,"
  echo "  theory THY,"
  echo "  with Isar command 'export_code CMD'"
  echo
  exit 1
}


## process command line

[ "$#" -lt 2 -o "$1" = "-?" ] && usage

IMAGE="$1"; shift
THY="$1"; shift
CMD="$1"


## main

CMD=$(echo $CMD | sed -e 's/\\/\\\\"/g; s/"/\\\"/g')
FULL_CMD="Code_Target.shell_command \"$THY\" \"$CMD\";"

"$ISABELLE" -q -e "$FULL_CMD" "$IMAGE" || exit 1