| Did you know ... | Search Documentation: |
| Packs (add-ons) for SWI-Prolog |
| Title: | Shared utilities for my Prolog projects |
|---|---|
| Rating: | Not rated. Create the first rating! |
| Latest version: | 1.0.5 |
| SHA1 sum: | 2793ad602e696c27b7d607f9a31edde79b4a956b |
| Author: | Sebastian Sardina <ssardina@gmail.com> |
| Home page: | https://github.com/ssardina/swi_ssardina |
| Download URL: | https://github.com/ssardina/swi_ssardina.git |
No reviews. Create the first review!.
| Version | SHA1 | #Downloads | URL |
|---|---|---|---|
| 1.0.5 | 0595dab1a9b69d7ebfe0199a7f4d8e7635df7d8b | 1 | https://github.com/ssardina/swi_ssardina.git |
| 20ab5fcce22af6571cc17c01731311d19ef27070 | 2 | https://github.com/ssardina/swi_ssardina.git | |
| 2793ad602e696c27b7d607f9a31edde79b4a956b | 4 | https://github.com/ssardina/swi_ssardina.git | |
| 1.0.4 | b97c67ce43cf04788a595b9da2fb74bc21709855 | 1 | https://github.com/ssardina/swi_ssardina.git |
| 1.0.3 | daeda547a76da9afc9741aa5403c0e0897f245b9 | 1 | https://github.com/ssardina/swi_ssardina.git |
| 084d9286e632b73728acc06e8ea46213fa822826 | 2 | https://github.com/ssardina/swi_ssardina.git | |
| 1.0.2 | 587335248ea66ebb782bcb833a38f3ba84286b98 | 3 | https://github.com/ssardina/swi_ssardina.git |
| 1.0.1 | cc203aabf8fb43482095276cbc301b448f575b22 | 2 | https://github.com/ssardina/swi_ssardina.git |
| c7fa3744e2f9214b64cf11f0b9f83501e64a7984 | 1 | https://github.com/ssardina/swi_ssardina.git | |
| 4e84276f85763fe7b8e9c7ff7269ef0a84b5195d | 1 | https://github.com/ssardina/swi_ssardina.git | |
| 9b64583e639efcf0d20edc7ef5457b05b66ab5f6 | 1 | https://github.com/ssardina/swi_ssardina.git |
This repository contains a collection of shared utilities for Prolog projects.
Assuming SWI-Prolog is instaled, you can install this pack via CLI as follows:
$ swipl -q -g "pack_install('https://github.com/ssardina/swi_ssardina.git',[package(swi_ssardina),interactive(false),git(true),upgrade(true)])" -t halt
[!NOTE] This will upgrade the pack if it is already installed. If you want to avoid that, set upgrade(false).
From inside SWIPL itself:
?- pack_install('https://github.com/ssardina/swi_ssardina.git', [package(swi_ssardina), git(true), upgrade(true)]).
This will install in folder `$HOME/.local/share/swi-prolog/pack/swi_ssardina`.
Confirm it is installed:
?- pack_list_installed. % Contacting server at https://www.swi-prolog.org/pack/query ... ok i auc@1.0 - Library for computing Areas Under the Receiving Operating Charactersitics and Precision Recall curves i bddem@4.3.1 - A library for manipulating Binary Decision Diagrams i cplint@4.5.0 - A suite of programs for reasoning with probabilistic logic programs i matrix@2.0 - Operations with matrices l swi_ssardina@1.0.0 - Shared utilities for my Prolog projects true.
To remove the package:
?- pack_remove(swi_ssardina).
All modules are named with the suffix _ssardina to avoid name clashes with other libraries. You can load them as needed in your Prolog code via:
?- use_module(library(xxx_ssardina)).
The pack contains the following modules:
| Name | Description |
|---|---|
utils_ssardina | General utilties |
datetime_ssardina | Date and time utilities |
system_ssardina | System utilities |
network_ssardina | System utilities |
Once the pack is installed, use the utilities in your Prolog code, simply load the library:
?- use_module(library(utils_ssardina)). true. ?- get_date_time(D). D = date(2026, 5, 13, 14, 46, 54.307682514190674, -36000, 'AEST', false). ?- get_time(T), stamp_date_time_tz(T, DT, 'Australia/Melbourne'). T = 1778647645.071011, DT = date(2026, 5, 13, 14, 47, 25.071011066, -36000, -, -) ;
To turn on debug in a module, enable it in the module scope:
?- use_module(library(system_ssardina)). ?- system_ssardina:debug(debug).
Pack contains 8 files holding a total of 22.4K bytes.