I am not sure what you are attempting to do here using your particular syntax. You seem to be assigning some set-related meaning to syntactic constructs like myset[insert(?X)] and the like.
Where did you see something thing like that? There are several ways to use or simulate sets.
First, you can use predicates, like p(a), p(b), etc. This is common in LP.
In Ergo, you also have an option to use something like
set(123)[member->{a,b,c,d}].
Finally, there are real,
not simulated,set objects, as described in Section 50.6.
-- michael
gRyBwq5fwes23!#
--
You received this message because you are subscribed to the Google Groups "ErgoAI and XSB Users Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-XSB-for...@coherentknowledge.com.
To view this discussion visit https://groups.google.com/a/coherentknowledge.com/d/msgid/ErgoAI-XSB-forum/e481af7f-f0e7-4332-bf7e-29aac3c906ffn%40coherentknowledge.com.
Ah, this is embarrassing! I completely forgot how that syntax looks like and started to ask you stupid questions :-(
Yes, an empty set can be created via a query like
?- myEmptySet[insert([])]@\set.
There are some assumptions about the arguments. For example, in union, intersect, minus, all input args must be bound to sets represented by atoms. Then we can do this sort of things:
?- set1[insert([a,b,c])]@\set, set2[insert([c,d,e])]@\set. // define some sets
?- set1[intersect(set2) -> set3]@\set. // do the intersect
?- set3[member->?Answer]@\set. // check the result.
?Answer = c
In other words, this set package does not create set ids on the
fly and
?- set1[intersect(set2) -> ?intersection]@\set.
will get an error.
> You seem to be assigning some set-related meaning to syntactic constructs like myset[insert(?X)] and the like.
I was trying towwww use the techniques described in section 50.6, which is where I got that syntax. For example, on page 332: