unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* set-o-mat
@ 2015-05-10 19:33 Stefan Israelsson Tampe
  0 siblings, 0 replies; only message in thread
From: Stefan Israelsson Tampe @ 2015-05-10 19:33 UTC (permalink / raw)
  To: guile-devel, guile-user@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1737 bytes --]

Hello guilers!

ANOUNCEMENT: functional sets  and functional set generator aka the
set-o-mat library

I have made some fairly good progress into making a set library that takes
assoc like objects
like assoc's and vhashes, and ouputs a functional set / setmap / ordered
set / ordered setmap
library that includes the complement operator.

You may find it at,

https://gitlab.com/tampe/set-o-mat

--------------
Complements is based no symbolic algebra and does not require an
instantiation of the world
But some operations needs a world to exists. See the documentation in
ice-9/set/complement.scm

ice-9/vset.scm contains the functional set operations related to guile's
vlist.scm and the assoc structure defined theirin.

ice-9/set/complement.scm contains a small library that does set-operations
with complements on lists, you may use those to check out and study the
complement operator.


Example
scheme@(guile-user)> (use-modules (ice-9 vset))scheme@(guile-user)>
(voset-union 7 (voset-complement (voset-intersection (voset-union 1 2 3)
(voset-union 3 1))))
$7 = #<#<set len=1> ⊔ #<set len=2>ᶜ>
scheme@(guile-user)> (vset-union 7 (voset-complement (voset-intersection
(voset-union 1 2 3) (voset-union 3 1))))
$8 = #<∅ ⊔ #<set len=2>ᶜ>
scheme@(guile-user)> (vset->list (voset-intersection (voset-union 1 2 3 4 5
6 7) (voset-union 7 (voset-complement (voset-intersection (voset-union 1 2
3) (voset-union 3 1))))))
$11 = (7 2 4 5 6)
scheme@(guile-user)> (vset->list (vset-intersection (vset-union 1 2 3 4 5 6
7) (vset-union 7 (vset-complement (voset-intersection (vset-union 1 2 3)
(vset-union 3 1))))))
$12 = (2 4 5 6 7)
scheme@(guile-user)>

Thats' all folks. Happy hacking.

[-- Attachment #2: Type: text/html, Size: 2228 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-10 19:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-10 19:33 set-o-mat Stefan Israelsson Tampe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).