{log} - version 4.3

Syntax

   1.  Extensional set/multiset terms:                 
           - {a,b,c} is a set containing three elements, a, b, c
             (equivalent to {} with c with b with a)         
           - {a,b\R} is the set {a,b} U R          
             (equivalent to R with b with a)       
           - *{a,b,b} is a multiset containing the elements,
             'a' (1 occurrence) and  'b' (2 occurrences)  
             (equivalent to {} mwith c mwith b mwith a)        
           - *{a,b\R} is the multiset *{a,b} U R    
             (equivalent to R mwith b mwith a)   
           - {} is the empty set/multiset                            
   2.  Intensional set terms:                                
           - {X : G}, X variable and G any {log} goal containing X
           - {X : exists(V,G)}, V variable local to G
           - {X : exists([V1,...,Vn],G)}, 
             V1,...,Vn variables local to G
   3.  Predefined sets
       (only for membership (in predicate) and RUQs   
           - int(n1,n2) (interval) is the set of integer numbers      
             ranging from n1 to n2 (n1 <= n2)    
           - integer, char, float      
   4.  RUQs:                            
           - forall(X in a, G), 
             X variable and G any {log} goal containing X  
           - forall(X in a, exists(V,G))
           - forall(X in a, exists([V1,...,Vn],G)), 
             V1,...,Vn variables local to G
   5.  Syntactic differences w.r.t. std Prolog:
           - &  is used in place of  ,  in clause bodies
           - or  is used in place of  ;
             to represent goal disjunction.
           - neg or naf are used in place of  \+
             to represent negation (resp., 
             simplified Constructive Negation and Negation as Failure)  

  Predefined set/multiset predicates (constraints)
          
           ('t' any term, 's' a set, 'a' either a set or a multiset)
           - t in a  (membership)
           - t in int(n,m)  (interval membership)
           - t nin a  (non-membership)   
           - t1 = t2  (equality)
           - t1 neq t2  (non-equality)
           - un(s1,s2,s3) (union)
           - nun(s1,s2,s3) (non-union)  
           - disj(s1,s2) (disjointness)
           - ndisj(s1,s2) (non-disjointness) 
           - less(s1,t,s3) (element removal)
           - subset(s1,s2) (subset)
           - nsubset(s1,s2,s3) (not subset)
           - ssubset(s1,s2) (strict subset)
           - int(s1,s2,s3) (intersection)
           - nint(s1,s2,s3) (not intersection)
           - diff(s1,s2,s3) (difference)
           - ndiff(s1,s2,s3) (not difference)
           - sdiff(s1,s2,s3) (symmetric difference)
           - set(t) (is a set) 
           - bag(t) (is a multiset)  

{log} specific built-in predicates

      -   start/0, setlog/0 to (re-)enter {log} 
          from the Prolog environment   
      -   help, help(built), help(lib), help(prolog) to get help information
               (resp., general, about {log} built-in predicates,
               {log} library predicates, Prolog predicates'
               for accessing {log})
      -   halt/0     to leave {log}
          (go back to the Prolog environment) 
      -   prolog_call/1   to call any Prolog goal 
          from the {log} environment 
      -   !/1 (used postfix): G!, G any {log} goal: 
          makes G deterministic
      -   delay(G,C), G, C any {log} goals: delays
          execution of G until C holds

Prolog-like {log} built-in predicates 

      -   read/1
      -   write/1
      -   call/1
      -   assert/0, assert/1
      -   consult/0, consult/1
      -   listing/0
      -   abolish/0
  
{log} library predicates

      -   size(?S,?N): cardinality (N = |S|)'
      -   powerset(+S,?PS): powerset (PS = 2^S)
      -   cross_product(+A,+B,?CP): the Cartesian product of sets A and B
      -   list_to_set(+L,?S): S is the set of all elements of the list L
      -   bag_to_set(+M,?S): S is the set of all elements of the bag M
      -   int_to_set(+I,?S): S is the set of all elements of the interval I
      -   diff1(?S,?X,?R): equivalent to diff(S,{X},R) but more efficient

      The {log} library provides also alternative definitions for some  
      set predicates, aimed at reducing the number of repeated solutions

      -   xless/3
      -   xsubset/2
      -   xun/3
      -   xint/3
      -   xdiff/3
      -   xndiff/3
      -   xsdiff/3
      -   xsize/2

Prolog predicates for accessing {log} facilities

      -   setlog_call(G), setlog_call(G,C): to call a {log}
          goal G, possibly getting an (output) {log} constraint C
      -   setlog_consult(F): to consult any {log} file F
      -   setlog_clause(Cl): to add a {log} clause Cl to the current {log} program
      -   setlog_help/0, h/0: to get general help information about {log}
      -   setlog/0:  to enter the {log} interactive environment