#! /bin/bash

( [ -z "$(idris --check --total $* --ibcsubdir /dev/null)" ] &&
  [ -z "$(grep assert_smaller $*)" ] &&
  [ -z "$(grep assert_total $*)" ] ) &&
 (echo termination warranted; true) ||
 ([ -z "$(idris --check --total --ibcsubdir /dev/null $* | grep recursive)" ] &&
   (echo termination safe; true) ||
   (echo termination not safe; false))
