2021-02-14 17:59:33 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd /tmp/$1
|
|
|
|
|
2021-02-19 07:33:39 +01:00
|
|
|
sed 's/^.*$/:- forall((Goal = (\0), call(Goal)), (write(Goal), nl))./' stdin.stdin |
|
|
|
|
cat code.code - > code.pl
|
2021-02-14 17:59:33 +01:00
|
|
|
|
2021-02-23 10:43:44 +01:00
|
|
|
if [ -s args.args ]
|
|
|
|
then
|
|
|
|
echo ":- main($(jq --raw-input -c --slurp 'split("\n")' args.args))." >> code.pl
|
|
|
|
fi
|
|
|
|
|
2021-02-14 17:59:33 +01:00
|
|
|
timeout -s KILL 3 swipl -g true -t halt code.pl
|