hoa-ltl2dstar-with-ltl3ba-for-prism 1.27 KB
  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
#! /bin/bash

# Interface wrapper for calling ltl2dstar with ltl3ba as the LTL->NBA tool
# Invoke from PRISM with
# -ltl2datool hoa-ltl2dstar-with-ltl3ba-for-prism -ltl2dasyntax lbt
#
# Expects ltl2dstar and ltl3ba executables on the PATH, otherwise
# specify their location using
# export LTL2DSTAR=path/to/ltl2dstar
# export LTL3BA=path/to/ltl3ba
#
# If ltl3ba is not statically compiled, you can specify the path
# to the Buddy library using
# export BUDDY_LIB=path/to/library-dir

# Take ltl2dstar executable from the LTL2DSTAR environment variable
# Otherwise, default to "ltl2dstar", which will search the PATH
LTL2DSTAR_BIN=${LTL2DSTAR-ltl2dstar}

# Take the ltl3ba executable from the LTL3BA environment variable
# Otherwise, default to "ltl3ba", which will search the PATH
LTL3BA_BIN=${LTL3BA-ltl3ba}

# If BUDDY_LIB environment variable is set, add to appropriate path
if [ ! -z "$BUDDY_LIB" ]; then
if [ "$(uname)" == "Darwin" ]; then
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH":"$BUDDY_LIB"
else
export LD_LIBRARY_PATH="$DYLD_LIBRARY_PATH":"$BUDDY_LIB"
fi
fi

# --output=automaton = we want the automaton
# --output-format=hoa = ... in HOA
# --ltl2nba = with ltl3ba as LTL->NBA
$LTL2DSTAR_BIN --output=automaton --output-format=hoa "--ltl2nba=spin:$LTL3BA_BIN" "$@"