How to get a set response interactively
Ross Boylan <[email protected]> Tue, 08 Apr 2014 18:16:36 -0700
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <1397006196.15810.57.camel@localhost> |
I tried ?- setof(OS, mount(_, path([OS | _]), _W), Mounts). _W = 2013-4-20 #60, Mounts = [ostempserver1] ; _W = 2013-4-22 #50, Mounts = [ostempserver1] . ?- setof(OS, mount(_, path([OS | _]), _), Mounts). Mounts = [ostempserver1] ; Mounts = [ostempserver1] ; Mounts = [ostempserver1] . And some variations like ?- setof(OS, +Dev+W+Rest%mount(Dev, path([OS | Rest]), W), Mounts). | . ERROR: Syntax error: Operator expected ERROR: setof(OS, +Dev+W+Rest ERROR: ** here ** ERROR: . Is there a way I can get the set results without seeing all the duplicate copies and having to step through them? This is as close as I could get: ?- findall(OS, mount(_, path([OS | _]), _W), _Mounts), list_to_ord_set(_Mounts, Mounts). _Mounts = [oscorn1, ostempserver1, ostempserver1, ostempserver1, oscorn1, oscorn1, oscorn1, oscorn1, oscorn1|...], Mounts = [oscorn1, ostempserver1]. Thanks. Ross Boylan