Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "swi_ssardina"

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

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
1.0.50595dab1a9b69d7ebfe0199a7f4d8e7635df7d8b1https://github.com/ssardina/swi_ssardina.git
20ab5fcce22af6571cc17c01731311d19ef270702https://github.com/ssardina/swi_ssardina.git
2793ad602e696c27b7d607f9a31edde79b4a956b4https://github.com/ssardina/swi_ssardina.git
1.0.4b97c67ce43cf04788a595b9da2fb74bc217098551https://github.com/ssardina/swi_ssardina.git
1.0.3daeda547a76da9afc9741aa5403c0e0897f245b91https://github.com/ssardina/swi_ssardina.git
084d9286e632b73728acc06e8ea46213fa8228262https://github.com/ssardina/swi_ssardina.git
1.0.2587335248ea66ebb782bcb833a38f3ba84286b983https://github.com/ssardina/swi_ssardina.git
1.0.1cc203aabf8fb43482095276cbc301b448f575b222https://github.com/ssardina/swi_ssardina.git
c7fa3744e2f9214b64cf11f0b9f83501e64a79841https://github.com/ssardina/swi_ssardina.git
4e84276f85763fe7b8e9c7ff7269ef0a84b5195d1https://github.com/ssardina/swi_ssardina.git
9b64583e639efcf0d20edc7ef5457b05b66ab5f61https://github.com/ssardina/swi_ssardina.git

SWI-Prolog Pack Utilities

This repository contains a collection of shared utilities for Prolog projects.

Setup

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).

Modules

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:

NameDescription
utils_ssardinaGeneral utilties
datetime_ssardinaDate and time utilities
system_ssardinaSystem utilities
network_ssardinaSystem utilities

Usage

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).

Contents of pack "swi_ssardina"

Pack contains 8 files holding a total of 22.4K bytes.