Did you know ... | Search Documentation: |
Packs (add-ons) for SWI-Prolog |
Title: | Collection of tools to make writing scripts in Prolog easier. |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 0.5.0 |
SHA1 sum: | 9eafbc60d252f97db1504f2791310bb6453b08bb |
Author: | Reed Oei <reedoei2@illinois.edu> |
Home page: | https://github.com/ReedOei/achelois |
Download URL: | https://github.com/ReedOei/achelois/releases/*.zip |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
0.0.1 | 8ba3eaad0f03b894581b867960f8f989ffc74407 | 1 | https://github.com/ReedOei/achelois/archive/0.0.1.zip |
0.0.2 | 24bb19c1fbe74d104143fcf5bde3ca3f66a89247 | 1 | https://github.com/ReedOei/achelois/archive/0.0.2.zip |
0.1.4 | 27cdf23f8882c716987d3584e836f7694b54a144 | 2 | https://github.com/ReedOei/achelois/archive/0.1.4.zip |
0.2.2 | 14e5d0c79c365d06aa95b133cb0874084de7e1e6 | 4 | https://github.com/ReedOei/achelois/archive/0.2.2.zip |
0.3.1 | e940dfc58e6290f11bb7a7380f710fc0b2d7b745 | 1 | https://github.com/ReedOei/achelois/archive/0.3.1.zip |
0.4.5 | 1c4d62687e998a635fbf983653daaf307ca524e3 | 1 | https://github.com/ReedOei/achelois/archive/0.4.5.zip |
0.4.6 | 7cee511025e6234e842e37675655cc4658691153 | 7382 | https://github.com/ReedOei/achelois/archive/0.4.6.zip |
0.5.0 | 9eafbc60d252f97db1504f2791310bb6453b08bb | 216 | https://github.com/ReedOei/achelois/archive/0.5.0.zip |
achelois
is a collection of tools to make writing shell script style programs in Prolog easier.
Run
pack_install(achelois).
Run a process and store it's output in a variable, using a path other than the current directory. The last arguments are all options and can be left empty/not passed:
?- process(path(ls), [], [path('Prolog/achelois'), output(Output)]). Output = 'pack.pl\nprolog\nREADME.md\n' .
Unify P with the various processes of a user (similar rules exist to get other information, such as PID, command, or start time):
?- user(roei, P). P = process(roei, 1243, 14010, 1243, 1243, 0, '15:52', 'pts/26', '00:00:00', [bash]) ; P = process(roei, 1455, 3299, 4205, 4205, 2, '09:57', ?, '00:08:29', ['/usr/share/spotify/spotify']) ; P = process(roei, 1952, 14010, 1952, 1952, 0, '10:00', 'pts/7', '00:00:00', [bash]) ; P = process(roei, 2147, 2110, 2056, 1952, 0, '10:00', 'pts/7', '00:01:17', ['/home/roei/idea-IU-181.4445.78/bin/fsnotifier64']) ; ...
Unify File with all files/directories inside another directory:
?- walk('/home/roei/Prolog/achelois/', File). File = '/home/roei/Prolog/achelois/pack.pl' ; File = '/home/roei/Prolog/achelois/prolog' ; File = '/home/roei/Prolog/achelois/prolog/achelois.pl' ; File = '/home/roei/Prolog/achelois/prolog/build_systems.pl' ; ... File = '/home/roei/Prolog/achelois/prolog/utility.pl' ; false.
Run a Java program (that builds using Maven). You don't have to provide a fully qualified name, just the last part (suffix) of it. This means you can just write a class name and it will find a fully qualified name (or names) which match it.
?- java('Main', ['argument']).
Clone a git repo (Path and Commit terms are unified with the path it gets downloaded to and the commit). You can also specify the path/commit if you wish.
?- git_clone('https://github.com/ReedOei/achelois', Path, Commit). Clonage dans 'achelois'... remote: Counting objects: 177, done. remote: Compressing objects: 100% (16/16), done. remote: Total 177 (delta 13), reused 24 (delta 13), pack-reused 148 Réception d'objets: 100% (177/177), 35.72 KiB | 0 bytes/s, fait. Résolution des deltas: 100% (100/100), fait. Vérification de la connectivité... fait. Path = achelois, Commit = '1570038399540fc6979db40c306c6d750f2e2737' .
Copy files to a remote computer (assumes you have the SSH keys and everything set up). Can optionally specify the destination (will be unified with the default directory you SSH into otherwise).
?- scp('path', 'user@host', Path). Path = '/home/user'.
Compile a Java project (using Maven, Gradle, Ant, or Make). The plan is to expand this so that it will work with other languages.
?- compiles('/home/roei/Java/eunomia').
Pack contains 18 files holding a total of 48.5K bytes.