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

Package "open_dicts"

Title:Open dicts for SWI Prolog
Rating:Not rated. Create the first rating!
Latest version:0.0.1
SHA1 sum:8e7c72b4006c6841899d0c9fc8b336d544049b55
Author:Eyal Dechter <eyaldechter@gmail.com>
Maintainer:Eyal Dechter <eyaldechter@gmail.com>
Packager:Eyal Dechter <eyaldechter@gmail.com>
Download URL:https://github.com/edechter/open_dicts/releases/*.zip
Requires:function_expansion

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.0.18e7c72b4006c6841899d0c9fc8b336d544049b5532https://github.com/edechter/open_dicts.git

Open Dicts for SWI Prolog

Synopsis


?- use_module(library(open_dicts)).

?- A = _{a: 1}+, B = _{b : 1}+, A = B.
A = B,
open_dict(_104{a:1, b:1}, B).

?- A = _{a: X}+, contains(A, [a-1, b-2]).
X = 1,
open_dict(_3520{a:1, b:2}, A).

?- A = _{a:Val, b:2}+, B = _{a:1, c:3}+, A = B.
A = B,
Val = 1,
open_dict(_4266{a:1, b:2, c:3}, B).

?- A = _{a:Val, b:2}+, B = _{a:1, c:3}+, A = B, close_dict(B).
A = B, B = _50{a:1, b:2, c:3},
Val = 1.

?- A = _{a: _{b:1}+}+, B = A.^a.^b.
B = 1,
open_dict(_1430{a:_1434}, A),
open_dict(_1450{b:1}, _1434).

?- A = _{a: _{b:X}+}+, A.^a.^b = 1.
X = 1,
open_dict(_5378{a:_5382}, A),
open_dict(_5398{b:1}, _5382).

Dependencies

Tests

Tests can be run using `library(tap)` and any TAP harness (in the example below: prove). E.g:

$ prove -v --ext=pl -j4 -r -e 'swipl -q -f dev.pl -t main -s' t/

Contents of pack "open_dicts"

Pack contains 6 files holding a total of 7.1K bytes.