big update
Sun Jan 7 17:49:57 PST 2007 kilian.sprotte@gmail.com
* big update
The API resembles much more the original gecode one.
Added support for finite sets.
Can now use BAB search.
diff -rN -u old-gecol/examples.lisp new-gecol/examples.lisp
--- old-gecol/examples.lisp 2014-07-23 02:53:25.000000000 -0700
+++ new-gecol/examples.lisp 2014-07-23 02:53:25.000000000 -0700
@@ -29,67 +29,106 @@
(in-package :cl-user)
+;; TODO maybe use gecol:intvar-assigned
(defun cartesian-product ()
- (let ((s (gecol:create-space 3 1 3 0 0)))
- (gecol:gec-branch-vars-min s)
- (let ((e (gecol:create-search-engine s)))
+ (let ((s (gecol:make-gecolspace :intnum 3 :intmin 1 :intmax 3)))
+ (gecol:with-var-arg-array ((loop for i below 3 collect (gecol:gecolspace-getint-int s i))
+ varargs)
+ (gecol:branch-intvarargs-bvarsel-bvalsel s varargs :bvar-none :bval-min))
+ (let ((e (gecol:make-dfs-space-int-int-stop s)))
(loop
- for sol = (gecol:search-next e)
+ for sol = (gecol:dfs-next e)
until (cffi:null-pointer-p sol)
do (format t "~a, ~a, ~a~%"
- (gecol:space-read-int sol 0)
- (gecol:space-read-int sol 1)
- (gecol:space-read-int sol 2))
- do (gecol:dispose-space sol))
- (gecol:dispose-search-engine e)
- (gecol:dispose-space s))))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 0))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 1))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 2)))
+ do (gecol:delete-gecolspace sol))
+ (gecol:delete-dfs e)
+ (gecol:delete-gecolspace s))))
(defun distinct ()
- (let ((s (gecol:create-space 3 1 3 0 0)))
- (gecol:gec-distinct s (list 0 1 2) :icl-def)
- (gecol:gec-branch-vars-min s)
- (let ((e (gecol:create-search-engine s)))
+ (let ((s (gecol:make-gecolspace :intnum 3 :intmin 1 :intmax 3)))
+ (gecol:with-var-arg-array ((loop for i below 3 collect (gecol:gecolspace-getint-int s i))
+ varargs)
+ (gecol:distinct-intvarargs-intconlevel s varargs :icl-def)
+ (gecol:branch-intvarargs-bvarsel-bvalsel s varargs :bvar-none :bval-min))
+ (let ((e (gecol:make-dfs-space-int-int-stop s)))
(loop
- for sol = (gecol:search-next e)
+ for sol = (gecol:dfs-next e)
until (cffi:null-pointer-p sol)
do (format t "~a, ~a, ~a~%"
- (gecol:space-read-int sol 0)
- (gecol:space-read-int sol 1)
- (gecol:space-read-int sol 2))
- do (gecol:dispose-space sol))
- (gecol:dispose-search-engine e)
- (gecol:dispose-space s))))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 0))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 1))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 2)))
+ do (gecol:delete-gecolspace sol))
+ (gecol:delete-dfs e)
+ (gecol:delete-gecolspace s))))
(defun sorted ()
- (let ((s (gecol:create-space 3 1 3 0 0)))
- (gecol:gec-rel-var s 0 :irt-< 1 :icl-def)
- (gecol:gec-rel-var s 1 :irt-< 2 :icl-def)
- (gecol:gec-branch-vars-min s)
- (let ((e (gecol:create-search-engine s)))
+ (let ((s (gecol:make-gecolspace :intnum 3 :intmin 1 :intmax 3)))
+ (gecol:rel-intvar-intreltype-intvar-intconlevel s
+ (gecol:gecolspace-getint-int s 0)
+ :irt-<
+ (gecol:gecolspace-getint-int s 1)
+ :icl-def)
+ (gecol:rel-intvar-intreltype-intvar-intconlevel s
+ (gecol:gecolspace-getint-int s 1)
+ :irt-<
+ (gecol:gecolspace-getint-int s 2)
+ :icl-def)
+
+ (gecol:with-var-arg-array ((loop for i below 3 collect (gecol:gecolspace-getint-int s i))
+ varargs)
+ (gecol:branch-intvarargs-bvarsel-bvalsel s varargs :bvar-none :bval-min))
+ (let ((e (gecol:make-dfs-space-int-int-stop s)))
(loop
- for sol = (gecol:search-next e)
+ for sol = (gecol:dfs-next e)
until (cffi:null-pointer-p sol)
do (format t "~a, ~a, ~a~%"
- (gecol:space-read-int sol 0)
- (gecol:space-read-int sol 1)
- (gecol:space-read-int sol 2))
- do (gecol:dispose-space sol))
- (gecol:dispose-search-engine e)
- (gecol:dispose-space s))))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 0))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 1))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 2)))
+ do (gecol:delete-gecolspace sol))
+ (gecol:delete-dfs e)
+ (gecol:delete-gecolspace s))))
(defun cartesian-product-distr-max ()
- (let ((s (gecol:create-space 3 1 3 0 0)))
- (gecol:gec-branch-vars-max s)
- (let ((e (gecol:create-search-engine s)))
+ "Like cartesian-product, but using a different branching."
+ (let ((s (gecol:make-gecolspace :intnum 3 :intmin 1 :intmax 3)))
+ (gecol:with-var-arg-array ((loop for i below 3 collect (gecol:gecolspace-getint-int s i))
+ varargs)
+ ;; branching
+ (gecol:branch-intvarargs-bvarsel-bvalsel s varargs :bvar-none :bval-max))
+ (let ((e (gecol:make-dfs-space-int-int-stop s)))
(loop
- for sol = (gecol:search-next e)
+ for sol = (gecol:dfs-next e)
until (cffi:null-pointer-p sol)
do (format t "~a, ~a, ~a~%"
- (gecol:space-read-int sol 0)
- (gecol:space-read-int sol 1)
- (gecol:space-read-int sol 2))
- do (gecol:dispose-space sol))
- (gecol:dispose-search-engine e)
- (gecol:dispose-space s))))
-
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 0))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 1))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 2)))
+ do (gecol:delete-gecolspace sol))
+ (gecol:delete-dfs e)
+ (gecol:delete-gecolspace s))))
+
+(defun distinct-minimal-third ()
+ "Like distinct, but minimizing the third variable."
+ (let ((s (gecol:make-gecolspace :intnum 3 :intmin 1 :intmax 3
+ :bab-intvar-ind 2 :bab-intreltype :irt-<)))
+ (gecol:with-var-arg-array ((loop for i below 3 collect (gecol:gecolspace-getint-int s i))
+ varargs)
+ (gecol:distinct-intvarargs-intconlevel s varargs :icl-def)
+ (gecol:branch-intvarargs-bvarsel-bvalsel s varargs :bvar-none :bval-min))
+ (let ((e (gecol:make-bab-space-int-int-stop s)))
+ (loop
+ for sol = (gecol:bab-next e)
+ until (cffi:null-pointer-p sol)
+ do (format t "~a, ~a, ~a~%"
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 0))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 1))
+ (gecol:intvar-val (gecol:gecolspace-getint-int sol 2)))
+ do (gecol:delete-gecolspace sol))
+ (gecol:delete-bab e)
+ (gecol:delete-gecolspace s))))
diff -rN -u old-gecol/ffi.lisp new-gecol/ffi.lisp
--- old-gecol/ffi.lisp 2014-07-23 02:53:25.000000000 -0700
+++ new-gecol/ffi.lisp 2014-07-23 02:53:25.000000000 -0700
@@ -1,3 +1,4 @@
+
;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: GECOL; Base: 10 -*-
;;; arch-tag: 09C25807-504D-487A-B9D3-275276CF17B1
@@ -29,6 +30,11 @@
(in-package :gecol)
+(defmacro defcfun* (name &rest args)
+ `(progn
+ (export ',(if (listp name) (second name) name))
+ (defcfun ,name ,@args)))
+
(defcenum int-rel-type
:irt-= ; =
:irt-/= ; /=
@@ -61,260 +67,102 @@
:sot-minus ; difference
)
-(defcfun ("create_space" create-space) :pointer
- (varnum :int)
- (varmin :int)
- (varmax :int)
- (boolnum :int)
- (setnum :int))
-
-(defcfun ("dispose_space" dispose-space) :void
- (space :pointer))
-
-(defcfun ("create_search_engine" create-search-engine) :pointer
- (space :pointer))
-
-(defcfun ("dispose_search_engine" dispose-search-engine) :void
- (engine :pointer))
-
-(defcfun ("search_next" search-next) :pointer
- (engine :pointer))
-
-(defcfun space-read-int :int
- (space :pointer)
- (index :int))
-
-(defcfun space-read-bool :boolean
- (space :pointer)
- (index :int))
-
-(defcfun gec-branch-vars-min :void
- (space :pointer))
-
-(defcfun gec-branch-vars-med :void
- (space :pointer))
-
-(defcfun gec-branch-vars-max :void
- (space :pointer))
-
-(defcfun ("gec_rel_var" gec-rel-var) :void
- (space :pointer)
- (x :int)
- (type int-rel-type)
- (y :int)
- (level int-con-level))
-
-(defcfun ("gec_rel_const" gec-rel-const) :void
- (space :pointer)
- (x :int)
- (type int-rel-type)
- (c :int)
- (level int-con-level))
-
-(defcfun ("gec_rel_reif" gec-rel-reif) :void
- (space :pointer)
- (x :int)
- (type int-rel-type)
- (y :int)
- (b :int)
- (level int-con-level))
-
-(defcfun ("gec_dom_var" gec-dom-var) :void
- (space :pointer)
- (x :int)
- (min :int)
- (max :int)
- (level int-con-level))
-
-(defcfun ("gec_dom_var_set" %gec-dom-var-set) :void
- (space :pointer)
- (x :int)
- (dom :pointer)
- (n :int)
- (level int-con-level))
+(defcenum bvar-sel
+ :bvar-none
+ :bvar-min-min
+ :bvar-min-max
+ :bvar-max-min
+ :bvar-max-max
+ :bvar-size-min
+ :bvar-size-max
+ :bvar-degree-min
+ :bvar-degree-max
+ :bvar-regret-min-min
+ :bvar-regret-min-max
+ :bvar-regret-max-min
+ :bvar-regret-max-max
+ )
-(defcfun ("gec_linear_var" %gec-linear-var) :void
- (space :pointer)
- (res :int)
- (type int-rel-type)
- (xs :pointer)
- (n :int)
- (level int-con-level))
+(defcenum bval-sel
+ :bval-min
+ :bval-med
+ :bval-max
+ :bval-split-min
+ :bval-split-max
+ )
-(defcfun ("gec_linear_const" %gec-linear-const) :void
- (space :pointer)
- (res :int)
- (type int-rel-type)
- (xs :pointer)
+;; IntSet
+(defcfun* ("make_IntSet_int_int" make-intset-int-int) :pointer
(n :int)
- (level int-con-level))
-
-(defcfun ("gec_distinct" %gec-distinct) :void
- (space :pointer)
- (xs :pointer)
- (n :int)
- (level int-con-level))
-
-(defcfun ("gec_distance" gec-distance) :void
- (space :pointer)
- (res :int)
- (a :int)
- (b :int))
-
-(defcfun gec-distance-const :void
- (space :pointer)
- (res :int)
- (a :int)
- (b :int))
-
-(defcfun ("gec_min" gec-min) :void
- (space :pointer)
- (res :int)
- (a :int)
- (b :int)
- (level int-con-level))
-
-(defcfun ("gec_max" gec-max) :void
- (space :pointer)
- (res :int)
- (a :int)
- (b :int)
- (level int-con-level))
-
-(defcfun ("gec_mult" gec-mult) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
-
-(defcfun ("gec_minus" gec-minus) :void
- (space :pointer)
- (res :int)
- (a :int)
- (b :int)
- (level int-con-level))
-
-(defcfun ("gec_bool_eq" gec-bool-eq) :void
- (space :pointer)
- (a :int)
- (b :int)
- (level int-con-level))
-
-(defcfun ("gec_bool_eq_const" gec-bool-eq-const) :void
- (space :pointer)
- (a :int)
- (const :int)
- (level int-con-level))
-
-(defcfun ("gec_bool_not" gec-bool-not) :void
- (space :pointer)
- (a :int)
- (res :int)
- (level int-con-level))
+ (m :int))
-(defcfun ("gec_bool_and" gec-bool-and) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
+(defcfun* ("make_IntSet_intarray_int" make-intset-intarray-int) :pointer
+ (r :pointer)
+ (n :int))
-(defcfun ("gec_bool_and_const" gec-bool-and-const) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
+(defcfun* ("IntSet_size" intset-size) :int
+ (intset :pointer))
-(defcfun ("gec_bool_or" gec-bool-or) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
+(defcfun* ("IntSet_min_int" intset-min-int) :int
+ (intset :pointer)
+ (i :int))
-(defcfun ("gec_bool_or_const" gec-bool-or-const) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
+(defcfun* ("IntSet_max_int" intset-max-int) :int
+ (intset :pointer)
+ (i :int))
-(defcfun ("gec_bool_xor" gec-bool-xor) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
+(defcfun* ("IntSet_width_int" intset-width-int) :unsigned-int
+ (intset :pointer)
+ (i :int))
-(defcfun ("gec_bool_xor_const" gec-bool-xor-const) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
-
-(defcfun ("gec_bool_imp" gec-bool-imp) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
+(defcfun* ("IntSet_min" intset-min) :int
+ (intset :pointer))
-(defcfun ("gec_bool_imp_const" gec-bool-imp-const) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
-
-(defcfun ("gec_bool_eqv" gec-bool-eqv) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
+(defcfun* ("IntSet_max" intset-max) :int
+ (intset :pointer))
-(defcfun ("gec_bool_eqv_const" gec-bool-eqv-const) :void
- (space :pointer)
- (a :int)
- (b :int)
- (res :int)
- (level int-con-level))
+(defcfun* ("delete_IntSet" delete-intset) :void
+ (intset :pointer))
-(defcfun ("gec_int_assigned" gec-int-assigned) :boolean
+;; IntVar
+(defcfun* ("make_IntVar_Space_int_int" make-intvar-space-int-int) :pointer
(space :pointer)
- (x :int))
+ (min :int)
+ (max :int))
+(defcfun* ("IntVar_assigned" intvar-assigned) :boolean
+ (intvar :pointer))
+(defcfun* ("IntVar_val" intvar-val) :int
+ (intvar :pointer))
+(defcfun* ("delete_IntVar" delete-intvar) :void
+ (intvar :pointer))
+
+;; Space
+(defcfun ("make_GecolSpace" %make-gecolspace) :pointer
+ (intnum :int)
+ (intmin :int)
+ (intmax :int)
+ (boolnum :int)
+ (setnum :int)
+ (bab-intvar-ind :int)
+ (bab-intreltype int-rel-type))
-(defcfun ("gec_bool_assigned" gec-bool-assigned) :boolean
- (space :pointer)
- (x :int))
+(defcfun* ("delete_GecolSpace" delete-gecolspace) :void
+ (gecolspace :pointer))
-(defcfun ("gec_element_const" %gec-element-const) :void
+(defcfun* ("GecolSpace_getInt_int" gecolspace-getint-int) :pointer
(space :pointer)
- (ns :pointer)
- (n :int)
- (x0 :int)
- (x1 :int)
- (level int-con-level))
+ (ind :int))
-(defcfun ("gec_element_vars" %gec-element-vars) :void
+(defcfun* ("GecolSpace_getBool_int" gecolspace-getbool-int) :pointer
(space :pointer)
- (xs :pointer)
- (n :int)
- (x0 :int)
- (x1 :int)
- (level int-con-level))
+ (ind :int))
-(defcfun ("gec_mod_12" gec-mod-12) :void
+(defcfun* ("GecolSpace_getSet_int" gecolspace-getset-int) :pointer
+ "Access SetVar at IND in SPACE."
(space :pointer)
- (x :int)
- (m :int))
-
-;;; Sets
+ (ind :int))
-(defcfun gec-fs-space-put :void
+(defcfun* ("GecolSpace_putSet_int_SetVar" gecolspace-putset-int-setvar) :void
"Place the SetVar SET into SPACE.
After SPACE has been constructed with only the number of
SetVars given, this needs to be done for each one.
@@ -325,10 +173,367 @@
(ind :int)
(set :pointer))
-(defcfun gec-fs-space-get :pointer
- "Access SetVar at IND in SPACE."
+;;; DFS
+(defcfun ("make_DFS_Space_int_int_Stop" %make-dfs-space-int-int-stop) :pointer
(space :pointer)
- (ind :int))
+ (c-d :int)
+ (a-d :int)
+ (st :pointer))
+
+(defcfun* ("delete_DFS" delete-dfs) :void
+ (dfs :pointer))
+
+(defcfun* ("DFS_next" dfs-next) :pointer
+ (dfs :pointer))
+
+;;; BAB
+(defcfun ("make_BAB_Space_int_int_Stop" %make-bab-space-int-int-stop) :pointer
+ (space :pointer)
+ (c-d :int)
+ (a-d :int)
+ (st :pointer))
+
+(defcfun* ("delete_BAB" delete-bab) :void
+ (bab :pointer))
+
+(defcfun* ("BAB_next" bab-next) :pointer
+ (bab :pointer))
+
+;;;;;;;;;
+
+(defcfun*
+ ("branch_intvarargs_bvarsel_bvalsel" branch-intvarargs-bvarsel-bvalsel) :void
+ (home :pointer) (x :pointer) (vars bvar-sel) (vals bval-sel))
+(defcfun*
+ ("linear_intvarargs_intreltype_int_intconlevel"
+ linear-intvarargs-intreltype-int-intconlevel)
+ :void (home :pointer) (x :pointer) (r int-rel-type) (c :int)
+ (icl int-con-level))
+(defcfun*
+ ("linear_intvarargs_intreltype_intvar_intconlevel"
+ linear-intvarargs-intreltype-intvar-intconlevel)
+ :void (home :pointer) (x :pointer) (r int-rel-type) (y :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("linear_intvarargs_intreltype_int_boolvar_intconlevel"
+ linear-intvarargs-intreltype-int-boolvar-intconlevel)
+ :void (home :pointer) (x :pointer) (r int-rel-type) (c :int) (b :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("linear_intvarargs_intreltype_intvar_boolvar_intconlevel"
+ linear-intvarargs-intreltype-intvar-boolvar-intconlevel)
+ :void (home :pointer) (x :pointer) (r int-rel-type) (y :pointer) (b :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("linear_intargs_intvarargs_intreltype_int_intconlevel"
+ linear-intargs-intvarargs-intreltype-int-intconlevel)
+ :void (home :pointer) (a :pointer) (x :pointer) (r int-rel-type) (c :int)
+ (icl int-con-level))
+(defcfun*
+ ("linear_intargs_intvarargs_intreltype_intvar_intconlevel"
+ linear-intargs-intvarargs-intreltype-intvar-intconlevel)
+ :void (home :pointer) (a :pointer) (x :pointer) (r int-rel-type) (y :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("linear_intargs_intvarargs_intreltype_int_boolvar_intconlevel"
+ linear-intargs-intvarargs-intreltype-int-boolvar-intconlevel)
+ :void (home :pointer) (a :pointer) (x :pointer) (r int-rel-type) (c :int)
+ (b :pointer) (icl int-con-level))
+(defcfun*
+ ("linear_intargs_intvarargs_intreltype_intvar_boolvar_intconlevel"
+ linear-intargs-intvarargs-intreltype-intvar-boolvar-intconlevel)
+ :void (home :pointer) (a :pointer) (x :pointer) (r int-rel-type) (y :pointer)
+ (b :pointer) (icl int-con-level))
+(defcfun*
+ ("linear_boolvarargs_intreltype_int_intconlevel"
+ linear-boolvarargs-intreltype-int-intconlevel)
+ :void (home :pointer) (x :pointer) (r int-rel-type) (c :int)
+ (icl int-con-level))
+(defcfun*
+ ("linear_boolvarargs_intreltype_intvar_intconlevel"
+ linear-boolvarargs-intreltype-intvar-intconlevel)
+ :void (home :pointer) (x :pointer) (r int-rel-type) (y :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("cumulatives_intvarargs_intvarargs_intvarargs_intvarargs_intvarargs_intargs_bool_intconlevel"
+ cumulatives-intvarargs-intvarargs-intvarargs-intvarargs-intvarargs-intargs-bool-intconlevel)
+ :void (home :pointer) (machine :pointer) (start :pointer) (duration :pointer)
+ (end :pointer) (height :pointer) (limit :pointer) (at_most :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("cumulatives_intargs_intvarargs_intvarargs_intvarargs_intvarargs_intargs_bool_intconlevel"
+ cumulatives-intargs-intvarargs-intvarargs-intvarargs-intvarargs-intargs-bool-intconlevel)
+ :void (home :pointer) (machine :pointer) (start :pointer) (duration :pointer)
+ (end :pointer) (height :pointer) (limit :pointer) (at_most :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("cumulatives_intvarargs_intvarargs_intargs_intvarargs_intvarargs_intargs_bool_intconlevel"
+ cumulatives-intvarargs-intvarargs-intargs-intvarargs-intvarargs-intargs-bool-intconlevel)
+ :void (home :pointer) (machine :pointer) (start :pointer) (duration :pointer)
+ (end :pointer) (height :pointer) (limit :pointer) (at_most :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("cumulatives_intargs_intvarargs_intargs_intvarargs_intvarargs_intargs_bool_intconlevel"
+ cumulatives-intargs-intvarargs-intargs-intvarargs-intvarargs-intargs-bool-intconlevel)
+ :void (home :pointer) (machine :pointer) (start :pointer) (duration :pointer)
+ (end :pointer) (height :pointer) (limit :pointer) (at_most :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("cumulatives_intvarargs_intvarargs_intvarargs_intvarargs_intargs_intargs_bool_intconlevel"
+ cumulatives-intvarargs-intvarargs-intvarargs-intvarargs-intargs-intargs-bool-intconlevel)
+ :void (home :pointer) (machine :pointer) (start :pointer) (duration :pointer)
+ (end :pointer) (height :pointer) (limit :pointer) (at_most :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("cumulatives_intargs_intvarargs_intvarargs_intvarargs_intargs_intargs_bool_intconlevel"
+ cumulatives-intargs-intvarargs-intvarargs-intvarargs-intargs-intargs-bool-intconlevel)
+ :void (home :pointer) (machine :pointer) (start :pointer) (duration :pointer)
+ (end :pointer) (height :pointer) (limit :pointer) (at_most :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("cumulatives_intvarargs_intvarargs_intargs_intvarargs_intargs_intargs_bool_intconlevel"
+ cumulatives-intvarargs-intvarargs-intargs-intvarargs-intargs-intargs-bool-intconlevel)
+ :void (home :pointer) (machine :pointer) (start :pointer) (duration :pointer)
+ (end :pointer) (height :pointer) (limit :pointer) (at_most :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("cumulatives_intargs_intvarargs_intargs_intvarargs_intargs_intargs_bool_intconlevel"
+ cumulatives-intargs-intvarargs-intargs-intvarargs-intargs-intargs-bool-intconlevel)
+ :void (home :pointer) (machine :pointer) (start :pointer) (duration :pointer)
+ (end :pointer) (height :pointer) (limit :pointer) (at_most :boolean)
+ (icl int-con-level))
+(defcfun* ("eq_intvar_intvar_intconlevel" eq-intvar-intvar-intconlevel) :void
+ (home :pointer) (x0 :pointer) (x1 :pointer) (icl int-con-level))
+(defcfun* ("eq_intvar_int_intconlevel" eq-intvar-int-intconlevel) :void
+ (home :pointer) (x :pointer) (n :int) (icl int-con-level))
+(defcfun*
+ ("eq_intvar_intvar_boolvar_intconlevel" eq-intvar-intvar-boolvar-intconlevel)
+ :void (home :pointer) (x0 :pointer) (x1 :pointer) (b :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("eq_intvar_int_boolvar_intconlevel" eq-intvar-int-boolvar-intconlevel) :void
+ (home :pointer) (x :pointer) (n :int) (b :pointer) (icl int-con-level))
+(defcfun* ("eq_intvarargs_intconlevel" eq-intvarargs-intconlevel) :void
+ (home :pointer) (x :pointer) (icl int-con-level))
+(defcfun*
+ ("count_intvarargs_int_intreltype_int_intconlevel"
+ count-intvarargs-int-intreltype-int-intconlevel)
+ :void (home :pointer) (x :pointer) (n :int) (r int-rel-type) (m :int)
+ (icl int-con-level))
+(defcfun*
+ ("count_intvarargs_intvar_intreltype_int_intconlevel"
+ count-intvarargs-intvar-intreltype-int-intconlevel)
+ :void (home :pointer) (x :pointer) (y :pointer) (r int-rel-type) (m :int)
+ (icl int-con-level))
+(defcfun*
+ ("count_intvarargs_int_intreltype_intvar_intconlevel"
+ count-intvarargs-int-intreltype-intvar-intconlevel)
+ :void (home :pointer) (x :pointer) (n :int) (r int-rel-type) (z :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("count_intvarargs_intvar_intreltype_intvar_intconlevel"
+ count-intvarargs-intvar-intreltype-intvar-intconlevel)
+ :void (home :pointer) (x :pointer) (y :pointer) (r int-rel-type) (z :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("gcc_intvarargs_intargs_int_int_int_int_int_intconlevel"
+ gcc-intvarargs-intargs-int-int-int-int-int-intconlevel)
+ :void (home :pointer) (x :pointer) (c :pointer) (m :int) (unspec_low :int)
+ (unspec_up :int) (min :int) (max :int) (icl int-con-level))
+(defcfun*
+ ("gcc_intvarargs_intargs_int_int_int_int_intconlevel"
+ gcc-intvarargs-intargs-int-int-int-int-intconlevel)
+ :void (home :pointer) (x :pointer) (c :pointer) (m :int) (unspec :int)
+ (min :int) (max :int) (icl int-con-level))
+(defcfun*
+ ("gcc_intvarargs_int_int_intconlevel" gcc-intvarargs-int-int-intconlevel)
+ :void (home :pointer) (x :pointer) (lb :int) (ub :int) (icl int-con-level))
+(defcfun* ("gcc_intvarargs_int_intconlevel" gcc-intvarargs-int-intconlevel)
+ :void (home :pointer) (x :pointer) (ub :int) (icl int-con-level))
+(defcfun*
+ ("gcc_intvarargs_intvarargs_int_int_intconlevel"
+ gcc-intvarargs-intvarargs-int-int-intconlevel)
+ :void (home :pointer) (x :pointer) (c :pointer) (min :int) (max :int)
+ (icl int-con-level))
+(defcfun*
+ ("gcc_intvarargs_intargs_intvarargs_int_int_int_bool_int_int_intconlevel"
+ gcc-intvarargs-intargs-intvarargs-int-int-int-bool-int-int-intconlevel)
+ :void (home :pointer) (x :pointer) (v :pointer) (c :pointer) (m :int)
+ (unspec_low :int) (unspec_up :int) (all :boolean) (min :int) (max :int)
+ (icl int-con-level))
+(defcfun*
+ ("gcc_intvarargs_intargs_intvarargs_int_int_bool_int_int_intconlevel"
+ gcc-intvarargs-intargs-intvarargs-int-int-bool-int-int-intconlevel)
+ :void (home :pointer) (x :pointer) (v :pointer) (c :pointer) (m :int)
+ (unspec :int) (all :boolean) (min :int) (max :int) (icl int-con-level))
+(defcfun*
+ ("channel_intvarargs_intvarargs_intconlevel"
+ channel-intvarargs-intvarargs-intconlevel)
+ :void (home :pointer) (x :pointer) (y :pointer) (icl int-con-level))
+(defcfun* ("dom_intvar_int_int_intconlevel" dom-intvar-int-int-intconlevel)
+ :void (home :pointer) (x :pointer) (l :int) (m :int) (icl int-con-level))
+(defcfun*
+ ("dom_intvarargs_int_int_intconlevel" dom-intvarargs-int-int-intconlevel)
+ :void (home :pointer) (x :pointer) (l :int) (m :int) (icl int-con-level))
+(defcfun* ("dom_intvar_intset_intconlevel" dom-intvar-intset-intconlevel) :void
+ (home :pointer) (x :pointer) (s :pointer) (icl int-con-level))
+(defcfun*
+ ("dom_intvarargs_intset_intconlevel" dom-intvarargs-intset-intconlevel) :void
+ (home :pointer) (x :pointer) (s :pointer) (icl int-con-level))
+(defcfun*
+ ("dom_intvar_int_int_boolvar_intconlevel"
+ dom-intvar-int-int-boolvar-intconlevel)
+ :void (home :pointer) (x :pointer) (l :int) (m :int) (b :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("dom_intvar_intset_boolvar_intconlevel"
+ dom-intvar-intset-boolvar-intconlevel)
+ :void (home :pointer) (x :pointer) (s :pointer) (b :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("bool_not_boolvar_boolvar_intconlevel" bool-not-boolvar-boolvar-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (icl int-con-level))
+(defcfun*
+ ("bool_eq_boolvar_boolvar_intconlevel" bool-eq-boolvar-boolvar-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (icl int-con-level))
+(defcfun*
+ ("bool_and_boolvar_boolvar_boolvar_intconlevel"
+ bool-and-boolvar-boolvar-boolvar-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (b2 :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("bool_and_boolvar_boolvar_bool_intconlevel"
+ bool-and-boolvar-boolvar-bool-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (b2 :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("bool_and_boolvarargs_boolvar_intconlevel"
+ bool-and-boolvarargs-boolvar-intconlevel)
+ :void (home :pointer) (b :pointer) (c :pointer) (icl int-con-level))
+(defcfun*
+ ("bool_and_boolvarargs_bool_intconlevel"
+ bool-and-boolvarargs-bool-intconlevel)
+ :void (home :pointer) (b :pointer) (c :boolean) (icl int-con-level))
+(defcfun*
+ ("bool_or_boolvar_boolvar_boolvar_intconlevel"
+ bool-or-boolvar-boolvar-boolvar-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (b2 :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("bool_or_boolvar_boolvar_bool_intconlevel"
+ bool-or-boolvar-boolvar-bool-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (b2 :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("bool_or_boolvarargs_boolvar_intconlevel"
+ bool-or-boolvarargs-boolvar-intconlevel)
+ :void (home :pointer) (b :pointer) (c :pointer) (icl int-con-level))
+(defcfun*
+ ("bool_or_boolvarargs_bool_intconlevel" bool-or-boolvarargs-bool-intconlevel)
+ :void (home :pointer) (b :pointer) (c :boolean) (icl int-con-level))
+(defcfun*
+ ("bool_imp_boolvar_boolvar_boolvar_intconlevel"
+ bool-imp-boolvar-boolvar-boolvar-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (b2 :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("bool_imp_boolvar_boolvar_bool_intconlevel"
+ bool-imp-boolvar-boolvar-bool-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (b2 :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("bool_eqv_boolvar_boolvar_boolvar_intconlevel"
+ bool-eqv-boolvar-boolvar-boolvar-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (b2 :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("bool_eqv_boolvar_boolvar_bool_intconlevel"
+ bool-eqv-boolvar-boolvar-bool-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (b2 :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("bool_xor_boolvar_boolvar_boolvar_intconlevel"
+ bool-xor-boolvar-boolvar-boolvar-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (b2 :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("bool_xor_boolvar_boolvar_bool_intconlevel"
+ bool-xor-boolvar-boolvar-bool-intconlevel)
+ :void (home :pointer) (b0 :pointer) (b1 :pointer) (b2 :boolean)
+ (icl int-con-level))
+(defcfun*
+ ("sortedness_intvarargs_intvarargs_intconlevel"
+ sortedness-intvarargs-intvarargs-intconlevel)
+ :void (home :pointer) (x :pointer) (y :pointer) (icl int-con-level))
+(defcfun*
+ ("sortedness_intvarargs_intvarargs_intvarargs_intconlevel"
+ sortedness-intvarargs-intvarargs-intvarargs-intconlevel)
+ :void (home :pointer) (x :pointer) (y :pointer) (z :pointer)
+ (icl int-con-level))
+(defcfun* ("distinct_intvarargs_intconlevel" distinct-intvarargs-intconlevel)
+ :void (home :pointer) (x :pointer) (icl int-con-level))
+(defcfun*
+ ("distinct_intargs_intvarargs_intconlevel"
+ distinct-intargs-intvarargs-intconlevel)
+ :void (home :pointer) (n :pointer) (x :pointer) (icl int-con-level))
+(defcfun*
+ ("element_intargs_intvar_intvar_intconlevel"
+ element-intargs-intvar-intvar-intconlevel)
+ :void (home :pointer) (n :pointer) (x0 :pointer) (x1 :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("element_intvarargs_intvar_intvar_intconlevel"
+ element-intvarargs-intvar-intvar-intconlevel)
+ :void (home :pointer) (x :pointer) (y0 :pointer) (y1 :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("rel_intvar_intreltype_intvar_intconlevel"
+ rel-intvar-intreltype-intvar-intconlevel)
+ :void (home :pointer) (x0 :pointer) (r int-rel-type) (x1 :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("rel_intvar_intreltype_int_intconlevel"
+ rel-intvar-intreltype-int-intconlevel)
+ :void (home :pointer) (x :pointer) (r int-rel-type) (c :int)
+ (icl int-con-level))
+(defcfun*
+ ("rel_intvar_intreltype_intvar_boolvar_intconlevel"
+ rel-intvar-intreltype-intvar-boolvar-intconlevel)
+ :void (home :pointer) (x0 :pointer) (r int-rel-type) (x1 :pointer)
+ (b :pointer) (icl int-con-level))
+(defcfun*
+ ("rel_intvar_intreltype_int_boolvar_intconlevel"
+ rel-intvar-intreltype-int-boolvar-intconlevel)
+ :void (home :pointer) (x :pointer) (r int-rel-type) (c :int) (b :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("rel_intvarargs_intreltype_intvarargs_intconlevel"
+ rel-intvarargs-intreltype-intvarargs-intconlevel)
+ :void (home :pointer) (x :pointer) (r int-rel-type) (y :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("min_intvar_intvar_intvar_intconlevel" min-intvar-intvar-intvar-intconlevel)
+ :void (home :pointer) (x0 :pointer) (x1 :pointer) (x2 :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("min_intvarargs_intvar_intconlevel" min-intvarargs-intvar-intconlevel) :void
+ (home :pointer) (x :pointer) (y :pointer) (icl int-con-level))
+(defcfun*
+ ("max_intvar_intvar_intvar_intconlevel" max-intvar-intvar-intvar-intconlevel)
+ :void (home :pointer) (x0 :pointer) (x1 :pointer) (x2 :pointer)
+ (icl int-con-level))
+(defcfun*
+ ("max_intvarargs_intvar_intconlevel" max-intvarargs-intvar-intconlevel) :void
+ (home :pointer) (x :pointer) (y :pointer) (icl int-con-level))
+(defcfun* ("abs_intvar_intvar_intconlevel" abs-intvar-intvar-intconlevel) :void
+ (home :pointer) (x0 :pointer) (x1 :pointer) (icl int-con-level))
+(defcfun*
+ ("mult_intvar_intvar_intvar_intconlevel"
+ mult-intvar-intvar-intvar-intconlevel)
+ :void (home :pointer) (x0 :pointer) (x1 :pointer) (x2 :pointer)
+ (icl int-con-level))
+
+;;; Sets
(defcfun gec-fs-make-const :pointer
"Make constant SetVar of CARD with DOM (int array)."
@@ -407,44 +612,129 @@
"Test whether this variable is assigned."
(set :pointer))
-(defcfun gec-fs-cardinality-const :void
- (space :pointer)
- (set :pointer)
- (min :unsigned-int)
- (max :unsigned-int))
-
-(defcfun gec-fs-cardinality :void
- (space :pointer)
- (set :pointer)
- (x :int))
+;;
-(defcfun gec-fs-rel-setvar-setreltype-setvar :void
- (space :pointer)
- (x :pointer)
- (r set-rel-type)
- (y :pointer))
-
-(defcfun gec-fs-rel-intvar-setreltype-setvar :void
- (space :pointer)
- (x :int)
- (r set-rel-type)
- (y :pointer))
-
-(defcfun gec-fs-rel-setvar-setoptype-setvar-setreltype-setvar :void
- (space :pointer)
- (x :pointer)
- (op set-op-type)
- (y :pointer)
- (r set-rel-type)
- (z :pointer))
-
-(defcfun gec-fs-min :void
- (space :pointer)
- (set :pointer)
- (x :int))
-
-(defcfun gec-fs-max :void
- (space :pointer)
- (set :pointer)
- (x :int))
+(defcfun*
+ ("atmostOne_setvarargs_unsigned_int" atmostone-setvarargs-unsigned-int) :void
+ (home :pointer) (x :pointer) (c :unsigned-int))
+(defcfun* ("distinct_setvarargs_unsigned_int" distinct-setvarargs-unsigned-int)
+ :void (home :pointer) (x :pointer) (c :unsigned-int))
+(defcfun* ("min_setvar_intvar" min-setvar-intvar) :void (home :pointer)
+ (s :pointer) (x :pointer))
+(defcfun* ("max_setvar_intvar" max-setvar-intvar) :void (home :pointer)
+ (s :pointer) (x :pointer))
+(defcfun* ("match_setvar_intvarargs" match-setvar-intvarargs) :void
+ (home :pointer) (s :pointer) (x :pointer))
+(defcfun* ("channel_intvarargs_setvarargs" channel-intvarargs-setvarargs) :void
+ (home :pointer) (x :pointer) (y :pointer))
+(defcfun* ("cardinality_setvar_intvar" cardinality-setvar-intvar) :void
+ (home :pointer) (s :pointer) (x :pointer))
+(defcfun*
+ ("weights_intargs_intargs_setvar_intvar"
+ weights-intargs-intargs-setvar-intvar)
+ :void (home :pointer) (elements :pointer) (weights :pointer) (x :pointer)
+ (y :pointer))
+(defcfun* ("convex_setvar" convex-setvar) :void (home :pointer) (x :pointer))
+(defcfun* ("convexHull_setvar_setvar" convexhull-setvar-setvar) :void
+ (home :pointer) (x :pointer) (y :pointer))
+(defcfun*
+ ("selectUnion_setvarargs_setvar_setvar" selectunion-setvarargs-setvar-setvar)
+ :void (home :pointer) (x :pointer) (y :pointer) (z :pointer))
+(defcfun*
+ ("selectInter_setvarargs_setvar_setvar" selectinter-setvarargs-setvar-setvar)
+ :void (home :pointer) (x :pointer) (y :pointer) (z :pointer))
+(defcfun*
+ ("selectInterIn_setvarargs_setvar_setvar_intset"
+ selectinterin-setvarargs-setvar-setvar-intset)
+ :void (home :pointer) (x :pointer) (y :pointer) (z :pointer)
+ (universe :pointer))
+(defcfun* ("selectDisjoint_setvarargs_setvar" selectdisjoint-setvarargs-setvar)
+ :void (home :pointer) (x :pointer) (y :pointer))
+(defcfun*
+ ("selectSet_setvarargs_intvar_setvar" selectset-setvarargs-intvar-setvar)
+ :void (home :pointer) (x :pointer) (y :pointer) (z :pointer))
+(defcfun* ("rel_setvar_setreltype_setvar" rel-setvar-setreltype-setvar) :void
+ (home :pointer) (x :pointer) (r set-rel-type) (y :pointer))
+(defcfun*
+ ("rel_setvar_setreltype_setvar_boolvar" rel-setvar-setreltype-setvar-boolvar)
+ :void (home :pointer) (x :pointer) (r set-rel-type) (y :pointer) (b :pointer))
+(defcfun* ("rel_setvar_setreltype_intvar" rel-setvar-setreltype-intvar) :void
+ (home :pointer) (s :pointer) (r set-rel-type) (x :pointer))
+(defcfun* ("rel_intvar_setreltype_setvar" rel-intvar-setreltype-setvar) :void
+ (home :pointer) (x :pointer) (r set-rel-type) (s :pointer))
+(defcfun*
+ ("rel_setvar_setreltype_intvar_boolvar" rel-setvar-setreltype-intvar-boolvar)
+ :void (home :pointer) (s :pointer) (r set-rel-type) (x :pointer) (b :pointer))
+(defcfun*
+ ("rel_intvar_setreltype_setvar_boolvar" rel-intvar-setreltype-setvar-boolvar)
+ :void (home :pointer) (x :pointer) (r set-rel-type) (s :pointer) (b :pointer))
+(defcfun* ("rel_setvar_intreltype_intvar" rel-setvar-intreltype-intvar) :void
+ (home :pointer) (s :pointer) (r int-rel-type) (x :pointer))
+(defcfun* ("rel_intvar_intreltype_setvar" rel-intvar-intreltype-setvar) :void
+ (home :pointer) (x :pointer) (r int-rel-type) (s :pointer))
+(defcfun*
+ ("rel_setvar_setoptype_setvar_setreltype_setvar"
+ rel-setvar-setoptype-setvar-setreltype-setvar)
+ :void (home :pointer) (x :pointer) (op set-op-type) (y :pointer)
+ (r set-rel-type) (z :pointer))
+(defcfun* ("rel_setoptype_setvarargs_setvar" rel-setoptype-setvarargs-setvar)
+ :void (home :pointer) (op set-op-type) (x :pointer) (y :pointer))
+(defcfun* ("rel_setoptype_intvarargs_setvar" rel-setoptype-intvarargs-setvar)
+ :void (home :pointer) (op set-op-type) (x :pointer) (y :pointer))
+(defcfun*
+ ("rel_intset_setoptype_setvar_setreltype_setvar"
+ rel-intset-setoptype-setvar-setreltype-setvar)
+ :void (home :pointer) (x :pointer) (op set-op-type) (y :pointer)
+ (r set-rel-type) (z :pointer))
+(defcfun*
+ ("rel_setvar_setoptype_intset_setreltype_setvar"
+ rel-setvar-setoptype-intset-setreltype-setvar)
+ :void (home :pointer) (x :pointer) (op set-op-type) (y :pointer)
+ (r set-rel-type) (z :pointer))
+(defcfun*
+ ("rel_setvar_setoptype_setvar_setreltype_intset"
+ rel-setvar-setoptype-setvar-setreltype-intset)
+ :void (home :pointer) (x :pointer) (op set-op-type) (y :pointer)
+ (r set-rel-type) (z :pointer))
+(defcfun*
+ ("rel_intset_setoptype_intset_setreltype_setvar"
+ rel-intset-setoptype-intset-setreltype-setvar)
+ :void (home :pointer) (x :pointer) (op set-op-type) (y :pointer)
+ (r set-rel-type) (z :pointer))
+(defcfun*
+ ("rel_intset_setoptype_setvar_setreltype_intset"
+ rel-intset-setoptype-setvar-setreltype-intset)
+ :void (home :pointer) (x :pointer) (op set-op-type) (y :pointer)
+ (r set-rel-type) (z :pointer))
+(defcfun*
+ ("rel_setvar_setoptype_intset_setreltype_intset"
+ rel-setvar-setoptype-intset-setreltype-intset)
+ :void (home :pointer) (x :pointer) (op set-op-type) (y :pointer)
+ (r set-rel-type) (z :pointer))
+(defcfun* ("sequence_setvarargs" sequence-setvarargs) :void (home :pointer)
+ (x :pointer))
+(defcfun*
+ ("sequentialUnion_setvarargs_setvar" sequentialunion-setvarargs-setvar) :void
+ (home :pointer) (y :pointer) (x :pointer))
+(defcfun* ("dom_setvar_setreltype_int" dom-setvar-setreltype-int) :void
+ (home :pointer) (x :pointer) (r set-rel-type) (i :int))
+(defcfun* ("dom_setvar_setreltype_int_int" dom-setvar-setreltype-int-int) :void
+ (home :pointer) (x :pointer) (r set-rel-type) (i :int) (j :int))
+(defcfun* ("dom_setvar_setreltype_intset" dom-setvar-setreltype-intset) :void
+ (home :pointer) (x :pointer) (r set-rel-type) (s :pointer))
+(defcfun*
+ ("dom_setvar_setreltype_int_boolvar" dom-setvar-setreltype-int-boolvar) :void
+ (home :pointer) (x :pointer) (r set-rel-type) (i :int) (b :pointer))
+(defcfun*
+ ("dom_setvar_setreltype_int_int_boolvar"
+ dom-setvar-setreltype-int-int-boolvar)
+ :void (home :pointer) (x :pointer) (r set-rel-type) (i :int) (j :int)
+ (b :pointer))
+(defcfun*
+ ("dom_setvar_setreltype_intset_boolvar" dom-setvar-setreltype-intset-boolvar)
+ :void (home :pointer) (x :pointer) (r set-rel-type) (s :pointer) (b :pointer))
+(defcfun*
+ ("cardinality_setvar_unsigned_int_unsigned_int"
+ cardinality-setvar-unsigned-int-unsigned-int)
+ :void (home :pointer) (x :pointer) (i :unsigned-int) (j :unsigned-int))
diff -rN -u old-gecol/gec.lisp new-gecol/gec.lisp
--- old-gecol/gec.lisp 2014-07-23 02:53:25.000000000 -0700
+++ new-gecol/gec.lisp 2014-07-23 02:53:25.000000000 -0700
@@ -29,50 +29,26 @@
(in-package :gecol)
-(defun gec-dom-var-set (space x dom level)
- (let ((n (length dom)))
- (with-foreign-object (xs :int n)
- (dotimes (i n)
- (setf (mem-aref xs :int i) (nth i dom)))
- (%gec-dom-var-set space x xs n level))))
-
-(defun gec-linear-var (space res type list level)
- (let ((n (length list)))
- (with-foreign-object (xs :int n)
- (dotimes (i n)
- (setf (mem-aref xs :int i) (nth i list)))
- (%gec-linear-var space res type xs n level))))
-
-(defun gec-linear-const (space res type list level)
- (let ((n (length list)))
- (with-foreign-object (xs :int n)
- (dotimes (i n)
- (setf (mem-aref xs :int i) (nth i list)))
- (%gec-linear-const space res type xs n level))))
-
-(defun gec-distinct (space list level)
- (let ((n (length list)))
- (with-foreign-object (xs :int n)
- (dotimes (i n)
- (setf (mem-aref xs :int i) (nth i list)))
- (%gec-distinct space xs n level))))
-
-(defun gec-element-vars (space list ind var level)
- (let ((n (length list)))
- (with-foreign-object (xs :int n)
- (dotimes (i n)
- (setf (mem-aref xs :int i) (nth i list)))
- (%gec-element-vars space xs n ind var level))))
-
-(defun gec-element-const (space list ind var level)
- (let ((n (length list)))
- (with-foreign-object (xs :int n)
- (dotimes (i n)
- (setf (mem-aref xs :int i) (nth i list)))
- (%gec-element-const space xs n ind var level))))
+;;; GecolSpace
+(defun make-gecolspace (&key
+ (intnum 0)
+ (intmin 0)
+ (intmax 2)
+ (boolnum 0)
+ (setnum 0)
+ (bab-intvar-ind 0)
+ (bab-intreltype :irt->))
+ (%make-gecolspace intnum intmin intmax boolnum setnum bab-intvar-ind bab-intreltype))
+
+;;; DFS
+(defun make-dfs-space-int-int-stop (space &key (c-d 1) (a-d 1) (stop (cffi:null-pointer)))
+ (%make-dfs-space-int-int-stop space c-d a-d stop))
+
+;;; BAB
+(defun make-bab-space-int-int-stop (space &key (c-d 1) (a-d 1) (stop (cffi:null-pointer)))
+ (%make-bab-space-int-int-stop space c-d a-d stop))
;;; Sets
-
(defun gec-fs-enumerate-lower-bound (set)
(unless (zerop (gec-fs-glb-size set))
(iter
@@ -107,3 +83,34 @@
(setf (cffi:mem-aref ,array :int i) elt))
,@body))))
+(defcstruct var-arg-array
+ "actually a lispy version of it, made up for wrapping the original VarArgArray"
+ (size :int)
+ (array :pointer))
+
+(export 'with-var-arg-array)
+;;; TODO - we will use this /a lot/. So you should
+;;; try to make the generated code as small as possible.
+(defmacro with-var-arg-array ((list var &key (type :pointer)) &body body)
+ (check-type var symbol)
+ (let ((=list= (gensym "LIST")))
+ `(let* ((,=list= ,list)
+ (list-len (length ,=list=)))
+ (with-foreign-object (array* ,type list-len)
+ (iter
+ (for elt in ,=list=)
+ (for i upfrom 0)
+ (setf (mem-aref array* ,type i) elt))
+ (with-foreign-object (,var 'var-arg-array)
+ (with-foreign-slots ((size array) ,var var-arg-array)
+ (setf size list-len
+ array array*)
+ ,@body))))))
+
+(defun gec-minus (space a b c)
+ "a - b = c"
+ (with-var-arg-array ('(1 -1) coeffs :type :int)
+ (with-var-arg-array ((list a b) a-b)
+ (gecol:linear-intargs-intvarargs-intreltype-intvar-intconlevel
+ space coeffs a-b :irt-= c :icl-def))))
+
diff -rN -u old-gecol/glue.cpp new-gecol/glue.cpp
--- old-gecol/glue.cpp 2014-07-23 02:53:25.000000000 -0700
+++ new-gecol/glue.cpp 2014-07-23 02:53:25.000000000 -0700
@@ -33,103 +33,200 @@
using namespace Gecode;
-// TODO avoid using void pointer for Space ?
-
-class Simple : public Space {
+class GecolSpace : public Space {
protected:
- IntVarArray vars;
+ IntVarArray ints;
BoolVarArray bools;
SetVarArray sets;
+ int bab_intvar_ind;
+ IntRelType bab_intreltype;
public:
- Simple(int varnum, int varmin, int varmax,
- int boolnum,
- int setnum) : vars(this, varnum, varmin, varmax),
- bools(this, boolnum, 0, 1),
- sets(this,setnum)
+ GecolSpace(int intnum, int intmin, int intmax,
+ int boolnum,
+ int setnum,
+ int arg_bab_intvar_ind, IntRelType arg_bab_intreltype)
+ : ints(this, intnum, intmin, intmax),
+ bools(this, boolnum, 0, 1),
+ sets(this,setnum),
+ bab_intvar_ind(arg_bab_intvar_ind),
+ bab_intreltype(arg_bab_intreltype)
{
}
- /// Constructor for cloning \a s
- Simple(bool share, Simple& s) : Space(share,s) {
- vars.update(this, share, s.vars);
+ // Constructor for cloning a s
+ GecolSpace(bool share, GecolSpace &s) : Space(share,s) {
+ ints.update(this, share, s.ints);
bools.update(this, share, s.bools);
sets.update(this, share, s.sets);
+ // TODO maybe specialize GecolBABSpace
+ // so we dont always copy these
+ bab_intvar_ind = s.bab_intvar_ind;
+ bab_intreltype = s.bab_intreltype;
}
- /// Copy during cloning
+ // Copy during cloning
virtual Space*
copy(bool share) {
- return new Simple(share,*this);
- }
- // TODO clean this up
- IntVarArray* get_vars () {
- return &vars;
+ return new GecolSpace(share,*this);
}
- IntVarArray get_vars2 () {
- return vars;
+ IntVarArray getInts () {
+ return ints;
}
- BoolVarArray get_bools2 () {
+ BoolVarArray getBools () {
return bools;
}
- SetVarArray get_sets () {
+ SetVarArray getSets () {
return sets;
}
+ // TODO use here the 'more complicated' version
+ // like in gecode examples?
+ void constrain(GecolSpace* latest) {
+ rel(this, this->getInts()[bab_intvar_ind], bab_intreltype, latest->getInts()[bab_intvar_ind]);
+ }
+};
+
+struct lisp_SetVarArgs
+{
+ int size;
+ SetVar** array[];
+};
+
+struct lisp_IntVarArgs
+{
+ int size;
+ IntVar** array[];
+};
+
+struct lisp_BoolVarArgs
+{
+ int size;
+ BoolVar** array[];
+};
+
+struct lisp_IntArgs
+{
+ int size;
+ int* array[];
};
extern "C" {
- void* create_space(int varnum, int varmin, int varmax, int boolnum, int setnum);
- void dispose_space(void* space);
- void* create_search_engine(void* space);
- void dispose_search_engine(void* engine);
- void* search_next(void* engine);
- bool gec_int_assigned(void* space, int x);
- bool gec_bool_assigned(void* space, int x);
- int space_read_int(void* space, int index);
- int space_read_bool(void* space, int index);
- void gec_branch_vars_min(void* space);
- void gec_branch_vars_med(void* space);
- void gec_branch_vars_max(void* space);
-
- void gec_rel_var(void* space, int x, int type, int y, int level);
- void gec_rel_const(void* space, int x, int type, int c, int level);
- void gec_rel_reif(void* space, int x, int type, int y, int b, int level);
- void gec_dom_var(void* space, int x, int min, int max, int level);
- void gec_dom_var_set(void* space, int x, int* d, int n, int level);
- void gec_linear_var(void* space, int res, int type, int* xs, int n, int level);
- void gec_linear_const(void* space, int res, int type, int* xs, int n, int level);
- void gec_distinct(void* space, int* xs, int n, int level);
- void gec_distance(void* space, int res, int a, int b);
- void gec_distance_const(void* space, int res, int a, int b);
- void gec_min(void* space, int res, int a, int b, int level);
- void gec_max(void* space, int res, int a, int b, int level);
- void gec_mult(void* space, int a, int b, int res, int level);
- void gec_minus(void* space, int res, int a, int b, int level);
-
- void gec_bool_eq(void* space, int a, int b, int level);
- void gec_bool_eq_const(void* space, int a, int b, int level);
- void gec_bool_not(void* space, int a, int res, int level);
- void gec_bool_and(void* space, int a, int b, int res, int level);
- void gec_bool_and_const(void* space, int a, int b, int res, int level);
- void gec_bool_or(void* space, int a, int b, int res, int level);
- void gec_bool_or_const(void* space, int a, int b, int res, int level);
- void gec_bool_xor(void* space, int a, int b, int res, int level);
- void gec_bool_xor_const(void* space, int a, int b, int res, int level);
- void gec_bool_imp(void* space, int a, int b, int res, int level);
- void gec_bool_imp_const(void* space, int a, int b, int res, int level);
- void gec_bool_eqv(void* space, int a, int b, int res, int level);
- void gec_bool_eqv_const(void* space, int a, int b, int res, int level);
-
- void gec_element_const(void* space, int* ns, int n, int x0, int x1, int level);
- void gec_element_vars(void* space, int* xs, int n, int x0, int x1, int level);
-
- void gec_mod_12(void* space, int x, int m);
+ // IntSet
+ IntSet *make_IntSet_int_int(int n, int m);
+ IntSet *make_IntSet_intarray_int(const int r[], int n);
+ int IntSet_size(IntSet *intset);
+ int IntSet_min_int(IntSet *intset, int i);
+ int IntSet_max_int(IntSet *intset, int i);
+ unsigned int IntSet_width_int(IntSet *intset, int i);
+ int IntSet_min(IntSet *intset);
+ int IntSet_max(IntSet *intset);
+ void delete_IntSet(IntSet *intset);
+ // IntVar
+ IntVar *make_IntVar_Space_int_int(Space* home, int min, int max);
+ bool IntVar_assigned(IntVar* intvar);
+ int IntVar_val(IntVar* intvar);
+ void delete_IntVar(IntVar *v);
+ // GecolSpace
+ GecolSpace* make_GecolSpace(int intnum, int intmin, int intmax, int boolnum, int setnum,
+ int bab_intvar_ind, IntRelType bab_intreltype);
+ void delete_GecolSpace(GecolSpace* space);
+ IntVar* GecolSpace_getInt_int(GecolSpace* space, int ind);
+ BoolVar* GecolSpace_getBool_int(GecolSpace* space, int ind);
+ SetVar* GecolSpace_getSet_int(GecolSpace* space, int ind);
+ void GecolSpace_putSet_int_SetVar(GecolSpace* space, int ind, SetVar* set);
+ // DFS
+ DFS<GecolSpace>* make_DFS_Space_int_int_Stop(GecolSpace* space, int c_d, int a_d, Search::Stop* st);
+ void delete_DFS(DFS<GecolSpace>* dfs);
+ GecolSpace* DFS_next(DFS<GecolSpace>* dfs);
+ // BAB
+ BAB<GecolSpace>* make_BAB_Space_int_int_Stop(GecolSpace* space, int c_d, int a_d, Search::Stop* st);
+ void delete_BAB(BAB<GecolSpace>* bab);
+ GecolSpace* BAB_next(BAB<GecolSpace>* bab);
+
+ ////////////
+
+ void branch_intvarargs_bvarsel_bvalsel(Space *home, const lisp_IntVarArgs *x, BvarSel vars, BvalSel vals);
+ void linear_intvarargs_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, int c, IntConLevel icl);
+ void linear_intvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl);
+ void linear_intvarargs_intreltype_int_boolvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, int c, BoolVar *b, IntConLevel icl);
+ void linear_intvarargs_intreltype_intvar_boolvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, BoolVar *b, IntConLevel icl);
+ void linear_intargs_intvarargs_intreltype_int_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, int c, IntConLevel icl);
+ void linear_intargs_intvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl);
+ void linear_intargs_intvarargs_intreltype_int_boolvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, int c, BoolVar *b, IntConLevel icl);
+ void linear_intargs_intvarargs_intreltype_intvar_boolvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, BoolVar *b, IntConLevel icl);
+ void linear_boolvarargs_intreltype_int_intconlevel(Space *home, const lisp_BoolVarArgs *x, IntRelType r, int c, IntConLevel icl);
+ void linear_boolvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_BoolVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl);
+ void cumulatives_intvarargs_intvarargs_intvarargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intargs_intvarargs_intvarargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intvarargs_intvarargs_intargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intargs_intvarargs_intargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intvarargs_intvarargs_intvarargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intargs_intvarargs_intvarargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intvarargs_intvarargs_intargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void cumulatives_intargs_intvarargs_intargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl);
+ void eq_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntConLevel icl);
+ void eq_intvar_int_intconlevel(Space *home, IntVar *x, int n, IntConLevel icl);
+ void eq_intvar_intvar_boolvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, BoolVar *b, IntConLevel icl);
+ void eq_intvar_int_boolvar_intconlevel(Space *home, IntVar *x, int n, BoolVar *b, IntConLevel icl);
+ void eq_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntConLevel icl);
+ void count_intvarargs_int_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int n, IntRelType r, int m, IntConLevel icl);
+ void count_intvarargs_intvar_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntRelType r, int m, IntConLevel icl);
+ void count_intvarargs_int_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, int n, IntRelType r, IntVar *z, IntConLevel icl);
+ void count_intvarargs_intvar_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntRelType r, IntVar *z, IntConLevel icl);
+ void gcc_intvarargs_intargs_int_int_int_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *c, int m, int unspec_low, int unspec_up, int min, int max, IntConLevel icl);
+ void gcc_intvarargs_intargs_int_int_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *c, int m, int unspec, int min, int max, IntConLevel icl);
+ void gcc_intvarargs_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int lb, int ub, IntConLevel icl);
+ void gcc_intvarargs_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int ub, IntConLevel icl);
+ void gcc_intvarargs_intvarargs_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *c, int min, int max, IntConLevel icl);
+ void gcc_intvarargs_intargs_intvarargs_int_int_int_bool_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *v, const lisp_IntVarArgs *c, int m, int unspec_low, int unspec_up, bool all, int min, int max, IntConLevel icl);
+ void gcc_intvarargs_intargs_intvarargs_int_int_bool_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *v, const lisp_IntVarArgs *c, int m, int unspec, bool all, int min, int max, IntConLevel icl);
+ void channel_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, IntConLevel icl);
+ void dom_intvar_int_int_intconlevel(Space *home, IntVar *x, int l, int m, IntConLevel icl);
+ void dom_intvarargs_int_int_intconlevel(Space *home, lisp_IntVarArgs *x, int l, int m, IntConLevel icl);
+ void dom_intvar_intset_intconlevel(Space *home, IntVar *x, const IntSet *s, IntConLevel icl);
+ void dom_intvarargs_intset_intconlevel(Space *home, lisp_IntVarArgs *x, const IntSet *s, IntConLevel icl);
+ void dom_intvar_int_int_boolvar_intconlevel(Space *home, IntVar *x, int l, int m, BoolVar *b, IntConLevel icl);
+ void dom_intvar_intset_boolvar_intconlevel(Space *home, IntVar *x, const IntSet *s, BoolVar *b, IntConLevel icl);
+ void bool_not_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, IntConLevel icl);
+ void bool_eq_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, IntConLevel icl);
+ void bool_and_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl);
+ void bool_and_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl);
+ void bool_and_boolvarargs_boolvar_intconlevel(Space *home, const lisp_BoolVarArgs *b, BoolVar *c, IntConLevel icl);
+ void bool_and_boolvarargs_bool_intconlevel(Space *home, const lisp_BoolVarArgs *b, bool c, IntConLevel icl);
+ void bool_or_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl);
+ void bool_or_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl);
+ void bool_or_boolvarargs_boolvar_intconlevel(Space *home, const lisp_BoolVarArgs *b, BoolVar *c, IntConLevel icl);
+ void bool_or_boolvarargs_bool_intconlevel(Space *home, const lisp_BoolVarArgs *b, bool c, IntConLevel icl);
+ void bool_imp_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl);
+ void bool_imp_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl);
+ void bool_eqv_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl);
+ void bool_eqv_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl);
+ void bool_xor_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl);
+ void bool_xor_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl);
+ void sortedness_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, IntConLevel icl);
+ void sortedness_intvarargs_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, const lisp_IntVarArgs *z, IntConLevel icl);
+ void distinct_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntConLevel icl);
+ void distinct_intargs_intvarargs_intconlevel(Space *home, const lisp_IntArgs *n, const lisp_IntVarArgs *x, IntConLevel icl);
+ void element_intargs_intvar_intvar_intconlevel(Space *home, const lisp_IntArgs *n, IntVar *x0, IntVar *x1, IntConLevel icl);
+ void element_intvarargs_intvar_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y0, IntVar *y1, IntConLevel icl);
+ void rel_intvar_intreltype_intvar_intconlevel(Space *home, IntVar *x0, IntRelType r, IntVar *x1, IntConLevel icl);
+ void rel_intvar_intreltype_int_intconlevel(Space *home, IntVar *x, IntRelType r, int c, IntConLevel icl);
+ void rel_intvar_intreltype_intvar_boolvar_intconlevel(Space *home, IntVar *x0, IntRelType r, IntVar *x1, BoolVar *b, IntConLevel icl);
+ void rel_intvar_intreltype_int_boolvar_intconlevel(Space *home, IntVar *x, IntRelType r, int c, BoolVar *b, IntConLevel icl);
+ void rel_intvarargs_intreltype_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, const lisp_IntVarArgs *y, IntConLevel icl);
+ void min_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl);
+ void min_intvarargs_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntConLevel icl);
+ void max_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl);
+ void max_intvarargs_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntConLevel icl);
+ void abs_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntConLevel icl);
+ void mult_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl);
+
+
+
// Sets
- void gec_fs_space_put(Simple* space, int ind, SetVar* set);
- SetVar* gec_fs_space_get(Simple* space, int ind);
- SetVar* gec_fs_make_const(Simple* space, int card, int *dom);
- SetVar* gec_fs_make_bounds(Simple* space,
+ SetVar* gec_fs_make_const(GecolSpace* space, int card, int *dom);
+ SetVar* gec_fs_make_bounds(GecolSpace* space,
int lower_card, int *lower_dom,
int upper_card, int *upper_dom);
- SetVar* gec_fs_make_lower_bound(Simple* space, int lower_card, int *lower_dom);
- SetVar* gec_fs_make_upper_bound(Simple* space, int upper_card, int *upper_dom);
+ SetVar* gec_fs_make_lower_bound(GecolSpace* space, int lower_card, int *lower_dom);
+ SetVar* gec_fs_make_upper_bound(GecolSpace* space, int upper_card, int *upper_dom);
unsigned int gec_fs_glb_size(SetVar* set);
unsigned int gec_fs_lub_size(SetVar* set);
unsigned int gec_fs_unknown_size(SetVar* set);
@@ -142,372 +239,889 @@
bool gec_fs_contains(SetVar* set, int x);
bool gec_fs_not_contains(SetVar* set, int x);
bool gec_fs_assigned(SetVar* set);
- void gec_fs_cardinality_const(Simple* space, SetVar* set, unsigned int min, unsigned int max);
- void gec_fs_cardinality(Simple* space, SetVar* set, int x);
- void gec_fs_rel_setvar_setreltype_setvar(Simple* space, SetVar* x, SetRelType r, SetVar* y);
- void gec_fs_rel_intvar_setreltype_setvar(Simple* space, int x, SetRelType r, SetVar* y);
- void gec_fs_rel_setvar_setoptype_setvar_setreltype_setvar(Simple* space, SetVar* x, SetOpType op, SetVar* y, SetRelType r, SetVar* z);
- void gec_fs_min(Simple* space, SetVar* s, int x);
- void gec_fs_max(Simple* space, SetVar* s, int x);
+
+ void atmostOne_setvarargs_unsigned_int(Space *home, const lisp_SetVarArgs *x, unsigned int c);
+ void distinct_setvarargs_unsigned_int(Space *home, const lisp_SetVarArgs *x, unsigned int c);
+ void min_setvar_intvar(Space *home, SetVar *s, IntVar *x);
+ void max_setvar_intvar(Space *home, SetVar *s, IntVar *x);
+ void match_setvar_intvarargs(Space *home, SetVar *s, const lisp_IntVarArgs *x);
+ void channel_intvarargs_setvarargs(Space *home, const lisp_IntVarArgs *x, const lisp_SetVarArgs *y);
+ void cardinality_setvar_intvar(Space *home, SetVar *s, IntVar *x);
+ void weights_intargs_intargs_setvar_intvar(Space *home, const lisp_IntArgs *elements, const lisp_IntArgs *weights, SetVar *x, IntVar *y);
+ void convex_setvar(Space *home, SetVar *x);
+ void convexHull_setvar_setvar(Space *home, SetVar *x, SetVar *y);
+ void selectUnion_setvarargs_setvar_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z);
+ void selectInter_setvarargs_setvar_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z);
+ void selectInterIn_setvarargs_setvar_setvar_intset(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z, const IntSet *universe);
+ void selectDisjoint_setvarargs_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y);
+ void selectSet_setvarargs_intvar_setvar(Space *home, const lisp_SetVarArgs *x, IntVar *y, SetVar *z);
+ void rel_setvar_setreltype_setvar(Space *home, SetVar *x, SetRelType r, SetVar *y);
+ void rel_setvar_setreltype_setvar_boolvar(Space *home, SetVar *x, SetRelType r, SetVar *y, BoolVar *b);
+ void rel_setvar_setreltype_intvar(Space *home, SetVar *s, SetRelType r, IntVar *x);
+ void rel_intvar_setreltype_setvar(Space *home, IntVar *x, SetRelType r, SetVar *s);
+ void rel_setvar_setreltype_intvar_boolvar(Space *home, SetVar *s, SetRelType r, IntVar *x, BoolVar *b);
+ void rel_intvar_setreltype_setvar_boolvar(Space *home, IntVar *x, SetRelType r, SetVar *s, BoolVar *b);
+ void rel_setvar_intreltype_intvar(Space *home, SetVar *s, IntRelType r, IntVar *x);
+ void rel_intvar_intreltype_setvar(Space *home, IntVar *x, IntRelType r, SetVar *s);
+ void rel_setvar_setoptype_setvar_setreltype_setvar(Space *home, SetVar *x, SetOpType op, SetVar *y, SetRelType r, SetVar *z);
+ void rel_setoptype_setvarargs_setvar(Space *home, SetOpType op, const lisp_SetVarArgs *x, SetVar *y);
+ void rel_setoptype_intvarargs_setvar(Space *home, SetOpType op, const lisp_IntVarArgs *x, SetVar *y);
+ void rel_intset_setoptype_setvar_setreltype_setvar(Space *home, const IntSet *x, SetOpType op, SetVar *y, SetRelType r, SetVar *z);
+ void rel_setvar_setoptype_intset_setreltype_setvar(Space *home, SetVar *x, SetOpType op, const IntSet *y, SetRelType r, SetVar *z);
+ void rel_setvar_setoptype_setvar_setreltype_intset(Space *home, SetVar *x, SetOpType op, SetVar *y, SetRelType r, const IntSet *z);
+ void rel_intset_setoptype_intset_setreltype_setvar(Space *home, const IntSet *x, SetOpType op, const IntSet *y, SetRelType r, SetVar *z);
+ void rel_intset_setoptype_setvar_setreltype_intset(Space *home, const IntSet *x, SetOpType op, SetVar *y, SetRelType r, const IntSet *z);
+ void rel_setvar_setoptype_intset_setreltype_intset(Space *home, SetVar *x, SetOpType op, const IntSet *y, SetRelType r, const IntSet *z);
+ void sequence_setvarargs(Space *home, const lisp_SetVarArgs *x);
+ void sequentialUnion_setvarargs_setvar(Space *home, const lisp_SetVarArgs *y, SetVar *x);
+ void dom_setvar_setreltype_int(Space *home, SetVar *x, SetRelType r, int i);
+ void dom_setvar_setreltype_int_int(Space *home, SetVar *x, SetRelType r, int i, int j);
+ void dom_setvar_setreltype_intset(Space *home, SetVar *x, SetRelType r, const IntSet *s);
+ void dom_setvar_setreltype_int_boolvar(Space *home, SetVar *x, SetRelType r, int i, BoolVar *b);
+ void dom_setvar_setreltype_int_int_boolvar(Space *home, SetVar *x, SetRelType r, int i, int j, BoolVar *b);
+ void dom_setvar_setreltype_intset_boolvar(Space *home, SetVar *x, SetRelType r, const IntSet *s, BoolVar *b);
+ void cardinality_setvar_unsigned_int_unsigned_int(Space *home, SetVar *x, unsigned int i, unsigned int j);
+
+
}
-void* create_space(int varnum, int varmin, int varmax, int boolnum, int setnum)
+// IntSet
+
+IntSet *make_IntSet_int_int(int n, int m)
{
- Simple* s = new Simple(varnum, varmin, varmax, boolnum, setnum);
- return (void*)s;
+ return new IntSet(n,m);
}
-void dispose_space(void* space)
+IntSet *make_IntSet_intarray_int(const int r[], int n)
{
- delete (Simple*)space;
+ return new IntSet(r,n);
}
-void* create_search_engine(void* space)
+int IntSet_size(IntSet *intset)
{
- Simple* s = (Simple*)space;
- DFS<Simple>* e = new DFS<Simple>(s,1,1);
- return (void*)e;
+ return intset->size();
}
-void dispose_search_engine(void* engine)
+int IntSet_min_int(IntSet *intset, int i)
{
- delete (DFS<Simple>*)engine;
+ return intset->min(i);
}
-void* search_next(void* engine)
+int IntSet_max_int(IntSet *intset, int i)
{
- DFS<Simple>* e = (DFS<Simple>*)engine;
- return (void*)e->next();
+ return intset->max(i);
}
-// TODO ch to get_vars2
-int space_read_int(void* space, int index)
+unsigned int IntSet_width_int(IntSet *intset, int i)
{
- Simple* s = (Simple*)space;
- IntVarArray* array = s->get_vars();
- IntVar x = (*array)[index];
- return x.val();
+ return intset->width(i);
}
-int space_read_bool(void* space, int index)
+int IntSet_min(IntSet *intset)
{
- Simple* s = (Simple*)space;
- BoolVarArray array = s->get_bools2();
- BoolVar x = array[index];
- return x.val();
+ return intset->min();
}
-void gec_branch_vars_min(void* space)
+int IntSet_max(IntSet *intset)
{
- branch((Simple*)space,(*((Simple*)space)->get_vars()),BVAR_NONE,BVAL_MIN);
+ return intset->max();
}
-void gec_branch_vars_med(void* space)
+void delete_IntSet(IntSet *intset)
{
- branch((Simple*)space,(*((Simple*)space)->get_vars()),BVAR_NONE,BVAL_MED);
+ delete intset;
}
-void gec_branch_vars_max(void* space)
+// IntVar
+IntVar *make_IntVar_Space_int_int(Space* home, int min, int max)
{
- branch((Simple*)space,(*((Simple*)space)->get_vars()),BVAR_NONE,BVAL_MAX);
+ return new IntVar(home, min, max);
}
-void gec_rel_var(void* space, int x, int type, int y, int level)
+bool IntVar_assigned(IntVar* intvar)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- rel(s, vars[x], (IntRelType)type, vars[y], (IntConLevel)level);
+ return intvar->assigned();
}
-void gec_rel_const(void* space, int x, int type, int c, int level)
+int IntVar_val(IntVar* intvar)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- rel(s, vars[x], (IntRelType)type, c, (IntConLevel)level);
+ return intvar->val();
}
-void gec_rel_reif(void* space, int x, int type, int y, int b, int level)
+void delete_IntVar(IntVar *v)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- BoolVarArray bools = s->get_bools2();
- rel(s, vars[x], (IntRelType)type, vars[y], bools[b], (IntConLevel)level);
+ delete v;
}
-void gec_dom_var(void* space, int x, int min, int max, int level)
+// GecolSpace
+GecolSpace* make_GecolSpace(int intnum, int intmin, int intmax, int boolnum, int setnum,
+ int bab_intvar_ind, IntRelType bab_intreltype)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- dom(s, vars[x], min, max, (IntConLevel)level);
+ return new GecolSpace(intnum, intmin, intmax, boolnum, setnum,
+ bab_intvar_ind, bab_intreltype);
}
-void gec_dom_var_set(void* space, int x, int* d, int n, int level)
+void delete_GecolSpace(GecolSpace* space)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntSet set(d, n);
- dom(s, vars[x], set, (IntConLevel)level);
+ delete space;
}
-void gec_linear_var(void* space, int res, int type, int* xs, int n, int level)
+// Providing these as if they were GecolSpace methods
+IntVar* GecolSpace_getInt_int(GecolSpace* space, int ind)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVarArgs a = IntVarArgs(n);
- int i;
- for(i=0;i<n;i++) {
- IntVar q;
- q = vars[xs[i]];
- a[i] = q;
- }
- linear(s, a, (IntRelType)type, vars[res], (IntConLevel)level);
+ IntVarArray ints = space->getInts();
+ return &(ints[ind]);
}
-void gec_linear_const(void* space, int res, int type, int* xs, int n, int level)
+BoolVar* GecolSpace_getBool_int(GecolSpace* space, int ind)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVarArgs a = IntVarArgs(n);
- int i;
- for(i=0;i<n;i++) {
- IntVar q;
- q = vars[xs[i]];
- a[i] = q;
- }
- linear(s, a, (IntRelType)type, res, (IntConLevel)level);
+ BoolVarArray bools = space->getBools();
+ return &(bools[ind]);
}
-void gec_distinct(void* space, int* xs, int n, int level)
+SetVar* GecolSpace_getSet_int(GecolSpace* space, int ind)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVarArgs a = IntVarArgs(n);
- int i;
- for(i=0;i<n;i++) {
- IntVar q;
- q = vars[xs[i]];
- a[i] = q;
- }
- distinct(s, a, (IntConLevel)level);
+ SetVarArray sets = space->getSets();
+ return &(sets[ind]);
}
-void gec_distance(void* space, int res, int a, int b)
+void GecolSpace_putSet_int_SetVar(GecolSpace* space, int ind, SetVar* set)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVar m;
- m = minus(s, vars[a], vars[b], ICL_DEF);
- abs(s, m, vars[res], ICL_DEF);
+ SetVarArray sets = space->getSets();
+ sets[ind] = *set;
}
-void gec_distance_const(void* space, int res, int a, int b)
+// DFS
+DFS<GecolSpace>* make_DFS_Space_int_int_Stop(GecolSpace* space, int c_d, int a_d, Search::Stop* st)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVar m;
- IntVar resvar = IntVar(s, res, res);
- m = minus(s, vars[a], vars[b], ICL_DEF);
- abs(s, m, resvar, ICL_DEF);
+ return new DFS<GecolSpace>(space, c_d, a_d, st);
}
+void delete_DFS(DFS<GecolSpace>* dfs)
+{
+ delete dfs;
+}
-void gec_min(void* space, int res, int a, int b, int level)
+GecolSpace* DFS_next(DFS<GecolSpace>* dfs)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- min(s, vars[a], vars[b], vars[res], (IntConLevel)level);
+ return dfs->next();
}
-void gec_max(void* space, int res, int a, int b, int level)
+// BAB
+BAB<GecolSpace>* make_BAB_Space_int_int_Stop(GecolSpace* space, int c_d, int a_d, Search::Stop* st)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- max(s, vars[a], vars[b], vars[res], (IntConLevel)level);
+ return new BAB<GecolSpace>(space, c_d, a_d, st);
}
-void gec_mult(void* space, int a, int b, int res, int level)
+void delete_BAB(BAB<GecolSpace>* bab)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- mult(s, vars[a], vars[b], vars[res], (IntConLevel)level);
+ delete bab;
}
-void gec_minus(void* space, int res, int a, int b, int level)
-{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVar x = vars[a];
- IntVar y = vars[b];
- IntVar z = vars[res];
- dom(s, z, x.min()-y.max(), x.max()-y.min(), (IntConLevel)level);
- Int::Linear::Term ts[3];
- ts[0].a = 1; ts[0].x = x;
- ts[1].a = -1; ts[1].x = y;
- ts[2].a = -1; ts[2].x = z;
- Int::Linear::post(s, ts, 3, IRT_EQ, 0, (IntConLevel)level);
+GecolSpace* BAB_next(BAB<GecolSpace>* bab)
+{
+ return bab->next();
}
-void gec_bool_eq(void* space, int a, int b, int level)
+////////
+
+void branch_intvarargs_bvarsel_bvalsel(Space *home, const lisp_IntVarArgs *x, BvarSel vars, BvalSel vals)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_eq(s, bools[a], bools[b], (IntConLevel)level);
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::branch(home, x_IntVarArgs, vars, vals);
}
-void gec_bool_eq_const(void* space, int a, int b, int level)
+void linear_intvarargs_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, int c, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- rel(s, bools[a], IRT_EQ, b, (IntConLevel)level);
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_IntVarArgs, r, c, icl);
}
-void gec_bool_not(void* space, int a, int res, int level)
+void linear_intvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_not(s, bools[a], bools[res], (IntConLevel)level);
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_IntVarArgs, r, *y, icl);
}
-void gec_bool_and(void* space, int a, int b, int res, int level)
+void linear_intvarargs_intreltype_int_boolvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, int c, BoolVar *b, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_and(s, bools[a], bools[b], bools[res], (IntConLevel)level);
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_IntVarArgs, r, c, *b, icl);
}
-void gec_bool_and_const(void* space, int a, int b, int res, int level)
+void linear_intvarargs_intreltype_intvar_boolvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, BoolVar *b, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_and(s, bools[a], bools[b], res, (IntConLevel)level);
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_IntVarArgs, r, *y, *b, icl);
}
-void gec_bool_or(void* space, int a, int b, int res, int level)
+void linear_intargs_intvarargs_intreltype_int_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, int c, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_or(s, bools[a], bools[b], bools[res], (IntConLevel)level);
+ IntArgs a_IntArgs(a->size);
+ for(int i=0;i<a->size;i++)
+ a_IntArgs[i] = (*(a->array))[i];
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, a_IntArgs, x_IntVarArgs, r, c, icl);
}
-void gec_bool_or_const(void* space, int a, int b, int res, int level)
+void linear_intargs_intvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_or(s, bools[a], bools[b], res, (IntConLevel)level);
+ IntArgs a_IntArgs(a->size);
+ for(int i=0;i<a->size;i++)
+ a_IntArgs[i] = (*(a->array))[i];
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, a_IntArgs, x_IntVarArgs, r, *y, icl);
}
-void gec_bool_xor(void* space, int a, int b, int res, int level)
+void linear_intargs_intvarargs_intreltype_int_boolvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, int c, BoolVar *b, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_xor(s, bools[a], bools[b], bools[res], (IntConLevel)level);
+ IntArgs a_IntArgs(a->size);
+ for(int i=0;i<a->size;i++)
+ a_IntArgs[i] = (*(a->array))[i];
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, a_IntArgs, x_IntVarArgs, r, c, *b, icl);
}
-void gec_bool_xor_const(void* space, int a, int b, int res, int level)
+void linear_intargs_intvarargs_intreltype_intvar_boolvar_intconlevel(Space *home, const lisp_IntArgs *a, const lisp_IntVarArgs *x, IntRelType r, IntVar *y, BoolVar *b, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_xor(s, bools[a], bools[b], res, (IntConLevel)level);
+ IntArgs a_IntArgs(a->size);
+ for(int i=0;i<a->size;i++)
+ a_IntArgs[i] = (*(a->array))[i];
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, a_IntArgs, x_IntVarArgs, r, *y, *b, icl);
}
-void gec_bool_imp(void* space, int a, int b, int res, int level)
+void linear_boolvarargs_intreltype_int_intconlevel(Space *home, const lisp_BoolVarArgs *x, IntRelType r, int c, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_imp(s, bools[a], bools[b], bools[res], (IntConLevel)level);
+ BoolVarArgs x_BoolVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_BoolVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_BoolVarArgs, r, c, icl);
}
-void gec_bool_imp_const(void* space, int a, int b, int res, int level)
+void linear_boolvarargs_intreltype_intvar_intconlevel(Space *home, const lisp_BoolVarArgs *x, IntRelType r, IntVar *y, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_imp(s, bools[a], bools[b], res, (IntConLevel)level);
+ BoolVarArgs x_BoolVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_BoolVarArgs[i] = *((*(x->array))[i]);
+ Gecode::linear(home, x_BoolVarArgs, r, *y, icl);
}
-void gec_bool_eqv(void* space, int a, int b, int res, int level)
+void cumulatives_intvarargs_intvarargs_intvarargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_eqv(s, bools[a], bools[b], bools[res], (IntConLevel)level);
+ IntVarArgs machine_IntVarArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntVarArgs[i] = *((*(machine->array))[i]);
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntVarArgs duration_IntVarArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntVarArgs[i] = *((*(duration->array))[i]);
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntVarArgs height_IntVarArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntVarArgs[i] = *((*(height->array))[i]);
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntVarArgs, start_IntVarArgs, duration_IntVarArgs, end_IntVarArgs, height_IntVarArgs, limit_IntArgs, at_most, icl);
}
-void gec_bool_eqv_const(void* space, int a, int b, int res, int level)
+void cumulatives_intargs_intvarargs_intvarargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- bool_eqv(s, bools[a], bools[b], res, (IntConLevel)level);
+ IntArgs machine_IntArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntArgs[i] = (*(machine->array))[i];
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntVarArgs duration_IntVarArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntVarArgs[i] = *((*(duration->array))[i]);
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntVarArgs height_IntVarArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntVarArgs[i] = *((*(height->array))[i]);
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntArgs, start_IntVarArgs, duration_IntVarArgs, end_IntVarArgs, height_IntVarArgs, limit_IntArgs, at_most, icl);
}
-bool gec_int_assigned(void* space, int x)
+void cumulatives_intvarargs_intvarargs_intargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- return (vars[x]).assigned();
+ IntVarArgs machine_IntVarArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntVarArgs[i] = *((*(machine->array))[i]);
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntArgs duration_IntArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntArgs[i] = (*(duration->array))[i];
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntVarArgs height_IntVarArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntVarArgs[i] = *((*(height->array))[i]);
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntVarArgs, start_IntVarArgs, duration_IntArgs, end_IntVarArgs, height_IntVarArgs, limit_IntArgs, at_most, icl);
}
-bool gec_bool_assigned(void* space, int x)
+void cumulatives_intargs_intvarargs_intargs_intvarargs_intvarargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntVarArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- BoolVarArray bools = s->get_bools2();
- return (bools[x]).assigned();
+ IntArgs machine_IntArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntArgs[i] = (*(machine->array))[i];
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntArgs duration_IntArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntArgs[i] = (*(duration->array))[i];
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntVarArgs height_IntVarArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntVarArgs[i] = *((*(height->array))[i]);
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntArgs, start_IntVarArgs, duration_IntArgs, end_IntVarArgs, height_IntVarArgs, limit_IntArgs, at_most, icl);
}
-void gec_element_const(void* space, int* ns, int n, int x0, int x1, int level)
+void cumulatives_intvarargs_intvarargs_intvarargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntArgs a = IntArgs(n);
- int i;
- for(i=0;i<n;i++) {
- a[i] = ns[i];
- }
- element(s, a, vars[x0], vars[x1], (IntConLevel)level);
+ IntVarArgs machine_IntVarArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntVarArgs[i] = *((*(machine->array))[i]);
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntVarArgs duration_IntVarArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntVarArgs[i] = *((*(duration->array))[i]);
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntArgs height_IntArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntArgs[i] = (*(height->array))[i];
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntVarArgs, start_IntVarArgs, duration_IntVarArgs, end_IntVarArgs, height_IntArgs, limit_IntArgs, at_most, icl);
}
-void gec_element_vars(void* space, int* xs, int n, int x0, int x1, int level)
+void cumulatives_intargs_intvarargs_intvarargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntVarArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVarArgs a = IntVarArgs(n);
- int i;
- for(i=0;i<n;i++) {
- IntVar q;
- q = vars[xs[i]];
- a[i] = q;
- }
- element(s, a, vars[x0], vars[x1], (IntConLevel)level);
+ IntArgs machine_IntArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntArgs[i] = (*(machine->array))[i];
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntVarArgs duration_IntVarArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntVarArgs[i] = *((*(duration->array))[i]);
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntArgs height_IntArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntArgs[i] = (*(height->array))[i];
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntArgs, start_IntVarArgs, duration_IntVarArgs, end_IntVarArgs, height_IntArgs, limit_IntArgs, at_most, icl);
}
-void gec_mod_12(void* space, int x, int m)
+void cumulatives_intvarargs_intvarargs_intargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntVarArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- Simple* s = (Simple*)space;
- IntVarArray vars = s->get_vars2();
- IntVar twelve(s, 12, 12);
- IntVar oct(s, 1, 11);
- IntVar start = minus(s, vars[x], vars[m], ICL_DOM);
- mult(s, oct, twelve, start, ICL_DOM);
+ IntVarArgs machine_IntVarArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntVarArgs[i] = *((*(machine->array))[i]);
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntArgs duration_IntArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntArgs[i] = (*(duration->array))[i];
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntArgs height_IntArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntArgs[i] = (*(height->array))[i];
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntVarArgs, start_IntVarArgs, duration_IntArgs, end_IntVarArgs, height_IntArgs, limit_IntArgs, at_most, icl);
}
-// Sets
-void gec_fs_space_put(Simple* space, int ind, SetVar* set)
+void cumulatives_intargs_intvarargs_intargs_intvarargs_intargs_intargs_bool_intconlevel(Space *home, const lisp_IntArgs *machine, const lisp_IntVarArgs *start, const lisp_IntArgs *duration, const lisp_IntVarArgs *end, const lisp_IntArgs *height, const lisp_IntArgs *limit, bool at_most, IntConLevel icl)
{
- SetVarArray sets = space->get_sets();
- sets[ind] = *set;
+ IntArgs machine_IntArgs(machine->size);
+ for(int i=0;i<machine->size;i++)
+ machine_IntArgs[i] = (*(machine->array))[i];
+ IntVarArgs start_IntVarArgs(start->size);
+ for(int i=0;i<start->size;i++)
+ start_IntVarArgs[i] = *((*(start->array))[i]);
+ IntArgs duration_IntArgs(duration->size);
+ for(int i=0;i<duration->size;i++)
+ duration_IntArgs[i] = (*(duration->array))[i];
+ IntVarArgs end_IntVarArgs(end->size);
+ for(int i=0;i<end->size;i++)
+ end_IntVarArgs[i] = *((*(end->array))[i]);
+ IntArgs height_IntArgs(height->size);
+ for(int i=0;i<height->size;i++)
+ height_IntArgs[i] = (*(height->array))[i];
+ IntArgs limit_IntArgs(limit->size);
+ for(int i=0;i<limit->size;i++)
+ limit_IntArgs[i] = (*(limit->array))[i];
+ Gecode::cumulatives(home, machine_IntArgs, start_IntVarArgs, duration_IntArgs, end_IntVarArgs, height_IntArgs, limit_IntArgs, at_most, icl);
}
-SetVar* gec_fs_space_get(Simple* space, int ind)
+void eq_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntConLevel icl)
{
- SetVarArray sets = space->get_sets();
- return &(sets[ind]);
+ Gecode::eq(home, *x0, *x1, icl);
+}
+
+void eq_intvar_int_intconlevel(Space *home, IntVar *x, int n, IntConLevel icl)
+{
+ Gecode::eq(home, *x, n, icl);
+}
+
+void eq_intvar_intvar_boolvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, BoolVar *b, IntConLevel icl)
+{
+ Gecode::eq(home, *x0, *x1, *b, icl);
+}
+
+void eq_intvar_int_boolvar_intconlevel(Space *home, IntVar *x, int n, BoolVar *b, IntConLevel icl)
+{
+ Gecode::eq(home, *x, n, *b, icl);
+}
+
+void eq_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::eq(home, x_IntVarArgs, icl);
+}
+
+void count_intvarargs_int_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int n, IntRelType r, int m, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::count(home, x_IntVarArgs, n, r, m, icl);
+}
+
+void count_intvarargs_intvar_intreltype_int_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntRelType r, int m, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::count(home, x_IntVarArgs, *y, r, m, icl);
+}
+
+void count_intvarargs_int_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, int n, IntRelType r, IntVar *z, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::count(home, x_IntVarArgs, n, r, *z, icl);
+}
+
+void count_intvarargs_intvar_intreltype_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntRelType r, IntVar *z, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::count(home, x_IntVarArgs, *y, r, *z, icl);
+}
+
+void gcc_intvarargs_intargs_int_int_int_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *c, int m, int unspec_low, int unspec_up, int min, int max, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntArgs c_IntArgs(c->size);
+ for(int i=0;i<c->size;i++)
+ c_IntArgs[i] = (*(c->array))[i];
+ Gecode::gcc(home, x_IntVarArgs, c_IntArgs, m, unspec_low, unspec_up, min, max, icl);
+}
+
+void gcc_intvarargs_intargs_int_int_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *c, int m, int unspec, int min, int max, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntArgs c_IntArgs(c->size);
+ for(int i=0;i<c->size;i++)
+ c_IntArgs[i] = (*(c->array))[i];
+ Gecode::gcc(home, x_IntVarArgs, c_IntArgs, m, unspec, min, max, icl);
+}
+
+void gcc_intvarargs_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int lb, int ub, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::gcc(home, x_IntVarArgs, lb, ub, icl);
+}
+
+void gcc_intvarargs_int_intconlevel(Space *home, const lisp_IntVarArgs *x, int ub, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::gcc(home, x_IntVarArgs, ub, icl);
+}
+
+void gcc_intvarargs_intvarargs_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *c, int min, int max, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntVarArgs c_IntVarArgs(c->size);
+ for(int i=0;i<c->size;i++)
+ c_IntVarArgs[i] = *((*(c->array))[i]);
+ Gecode::gcc(home, x_IntVarArgs, c_IntVarArgs, min, max, icl);
+}
+
+void gcc_intvarargs_intargs_intvarargs_int_int_int_bool_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *v, const lisp_IntVarArgs *c, int m, int unspec_low, int unspec_up, bool all, int min, int max, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntArgs v_IntArgs(v->size);
+ for(int i=0;i<v->size;i++)
+ v_IntArgs[i] = (*(v->array))[i];
+ IntVarArgs c_IntVarArgs(c->size);
+ for(int i=0;i<c->size;i++)
+ c_IntVarArgs[i] = *((*(c->array))[i]);
+ Gecode::gcc(home, x_IntVarArgs, v_IntArgs, c_IntVarArgs, m, unspec_low, unspec_up, all, min, max, icl);
+}
+
+void gcc_intvarargs_intargs_intvarargs_int_int_bool_int_int_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntArgs *v, const lisp_IntVarArgs *c, int m, int unspec, bool all, int min, int max, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntArgs v_IntArgs(v->size);
+ for(int i=0;i<v->size;i++)
+ v_IntArgs[i] = (*(v->array))[i];
+ IntVarArgs c_IntVarArgs(c->size);
+ for(int i=0;i<c->size;i++)
+ c_IntVarArgs[i] = *((*(c->array))[i]);
+ Gecode::gcc(home, x_IntVarArgs, v_IntArgs, c_IntVarArgs, m, unspec, all, min, max, icl);
+}
+
+void channel_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntVarArgs y_IntVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_IntVarArgs[i] = *((*(y->array))[i]);
+ Gecode::channel(home, x_IntVarArgs, y_IntVarArgs, icl);
+}
+
+void dom_intvar_int_int_intconlevel(Space *home, IntVar *x, int l, int m, IntConLevel icl)
+{
+ Gecode::dom(home, *x, l, m, icl);
+}
+
+void dom_intvarargs_int_int_intconlevel(Space *home, lisp_IntVarArgs *x, int l, int m, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::dom(home, x_IntVarArgs, l, m, icl);
+}
+
+void dom_intvar_intset_intconlevel(Space *home, IntVar *x, const IntSet *s, IntConLevel icl)
+{
+ Gecode::dom(home, *x, *s, icl);
+}
+
+void dom_intvarargs_intset_intconlevel(Space *home, lisp_IntVarArgs *x, const IntSet *s, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::dom(home, x_IntVarArgs, *s, icl);
+}
+
+void dom_intvar_int_int_boolvar_intconlevel(Space *home, IntVar *x, int l, int m, BoolVar *b, IntConLevel icl)
+{
+ Gecode::dom(home, *x, l, m, *b, icl);
+}
+
+void dom_intvar_intset_boolvar_intconlevel(Space *home, IntVar *x, const IntSet *s, BoolVar *b, IntConLevel icl)
+{
+ Gecode::dom(home, *x, *s, *b, icl);
+}
+
+void bool_not_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, IntConLevel icl)
+{
+ Gecode::bool_not(home, *b0, *b1, icl);
+}
+
+void bool_eq_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, IntConLevel icl)
+{
+ Gecode::bool_eq(home, *b0, *b1, icl);
+}
+
+void bool_and_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl)
+{
+ Gecode::bool_and(home, *b0, *b1, *b2, icl);
+}
+
+void bool_and_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl)
+{
+ Gecode::bool_and(home, *b0, *b1, b2, icl);
+}
+
+void bool_and_boolvarargs_boolvar_intconlevel(Space *home, const lisp_BoolVarArgs *b, BoolVar *c, IntConLevel icl)
+{
+ BoolVarArgs b_BoolVarArgs(b->size);
+ for(int i=0;i<b->size;i++)
+ b_BoolVarArgs[i] = *((*(b->array))[i]);
+ Gecode::bool_and(home, b_BoolVarArgs, *c, icl);
+}
+
+void bool_and_boolvarargs_bool_intconlevel(Space *home, const lisp_BoolVarArgs *b, bool c, IntConLevel icl)
+{
+ BoolVarArgs b_BoolVarArgs(b->size);
+ for(int i=0;i<b->size;i++)
+ b_BoolVarArgs[i] = *((*(b->array))[i]);
+ Gecode::bool_and(home, b_BoolVarArgs, c, icl);
+}
+
+void bool_or_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl)
+{
+ Gecode::bool_or(home, *b0, *b1, *b2, icl);
+}
+
+void bool_or_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl)
+{
+ Gecode::bool_or(home, *b0, *b1, b2, icl);
+}
+
+void bool_or_boolvarargs_boolvar_intconlevel(Space *home, const lisp_BoolVarArgs *b, BoolVar *c, IntConLevel icl)
+{
+ BoolVarArgs b_BoolVarArgs(b->size);
+ for(int i=0;i<b->size;i++)
+ b_BoolVarArgs[i] = *((*(b->array))[i]);
+ Gecode::bool_or(home, b_BoolVarArgs, *c, icl);
+}
+
+void bool_or_boolvarargs_bool_intconlevel(Space *home, const lisp_BoolVarArgs *b, bool c, IntConLevel icl)
+{
+ BoolVarArgs b_BoolVarArgs(b->size);
+ for(int i=0;i<b->size;i++)
+ b_BoolVarArgs[i] = *((*(b->array))[i]);
+ Gecode::bool_or(home, b_BoolVarArgs, c, icl);
+}
+
+void bool_imp_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl)
+{
+ Gecode::bool_imp(home, *b0, *b1, *b2, icl);
+}
+
+void bool_imp_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl)
+{
+ Gecode::bool_imp(home, *b0, *b1, b2, icl);
+}
+
+void bool_eqv_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl)
+{
+ Gecode::bool_eqv(home, *b0, *b1, *b2, icl);
+}
+
+void bool_eqv_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl)
+{
+ Gecode::bool_eqv(home, *b0, *b1, b2, icl);
+}
+
+void bool_xor_boolvar_boolvar_boolvar_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, BoolVar *b2, IntConLevel icl)
+{
+ Gecode::bool_xor(home, *b0, *b1, *b2, icl);
+}
+
+void bool_xor_boolvar_boolvar_bool_intconlevel(Space *home, BoolVar *b0, BoolVar *b1, bool b2, IntConLevel icl)
+{
+ Gecode::bool_xor(home, *b0, *b1, b2, icl);
+}
+
+void sortedness_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntVarArgs y_IntVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_IntVarArgs[i] = *((*(y->array))[i]);
+ Gecode::sortedness(home, x_IntVarArgs, y_IntVarArgs, icl);
+}
+
+void sortedness_intvarargs_intvarargs_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, const lisp_IntVarArgs *y, const lisp_IntVarArgs *z, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntVarArgs y_IntVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_IntVarArgs[i] = *((*(y->array))[i]);
+ IntVarArgs z_IntVarArgs(z->size);
+ for(int i=0;i<z->size;i++)
+ z_IntVarArgs[i] = *((*(z->array))[i]);
+ Gecode::sortedness(home, x_IntVarArgs, y_IntVarArgs, z_IntVarArgs, icl);
+}
+
+void distinct_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::distinct(home, x_IntVarArgs, icl);
+}
+
+void distinct_intargs_intvarargs_intconlevel(Space *home, const lisp_IntArgs *n, const lisp_IntVarArgs *x, IntConLevel icl)
+{
+ IntArgs n_IntArgs(n->size);
+ for(int i=0;i<n->size;i++)
+ n_IntArgs[i] = (*(n->array))[i];
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::distinct(home, n_IntArgs, x_IntVarArgs, icl);
}
-SetVar* gec_fs_make_const(Simple* space, int card, int *dom)
+void element_intargs_intvar_intvar_intconlevel(Space *home, const lisp_IntArgs *n, IntVar *x0, IntVar *x1, IntConLevel icl)
+{
+ IntArgs n_IntArgs(n->size);
+ for(int i=0;i<n->size;i++)
+ n_IntArgs[i] = (*(n->array))[i];
+ Gecode::element(home, n_IntArgs, *x0, *x1, icl);
+}
+
+void element_intvarargs_intvar_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y0, IntVar *y1, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::element(home, x_IntVarArgs, *y0, *y1, icl);
+}
+
+void rel_intvar_intreltype_intvar_intconlevel(Space *home, IntVar *x0, IntRelType r, IntVar *x1, IntConLevel icl)
+{
+ Gecode::rel(home, *x0, r, *x1, icl);
+}
+
+void rel_intvar_intreltype_int_intconlevel(Space *home, IntVar *x, IntRelType r, int c, IntConLevel icl)
+{
+ Gecode::rel(home, *x, r, c, icl);
+}
+
+void rel_intvar_intreltype_intvar_boolvar_intconlevel(Space *home, IntVar *x0, IntRelType r, IntVar *x1, BoolVar *b, IntConLevel icl)
+{
+ Gecode::rel(home, *x0, r, *x1, *b, icl);
+}
+
+void rel_intvar_intreltype_int_boolvar_intconlevel(Space *home, IntVar *x, IntRelType r, int c, BoolVar *b, IntConLevel icl)
+{
+ Gecode::rel(home, *x, r, c, *b, icl);
+}
+
+void rel_intvarargs_intreltype_intvarargs_intconlevel(Space *home, const lisp_IntVarArgs *x, IntRelType r, const lisp_IntVarArgs *y, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ IntVarArgs y_IntVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_IntVarArgs[i] = *((*(y->array))[i]);
+ Gecode::rel(home, x_IntVarArgs, r, y_IntVarArgs, icl);
+}
+
+void min_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl)
+{
+ Gecode::min(home, *x0, *x1, *x2, icl);
+}
+
+void min_intvarargs_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::min(home, x_IntVarArgs, *y, icl);
+}
+
+void max_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl)
+{
+ Gecode::max(home, *x0, *x1, *x2, icl);
+}
+
+void max_intvarargs_intvar_intconlevel(Space *home, const lisp_IntVarArgs *x, IntVar *y, IntConLevel icl)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::max(home, x_IntVarArgs, *y, icl);
+}
+
+void abs_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntConLevel icl)
+{
+ Gecode::abs(home, *x0, *x1, icl);
+}
+
+void mult_intvar_intvar_intvar_intconlevel(Space *home, IntVar *x0, IntVar *x1, IntVar *x2, IntConLevel icl)
+{
+ Gecode::mult(home, *x0, *x1, *x2, icl);
+}
+
+
+
+// Sets
+SetVar* gec_fs_make_const(GecolSpace* space, int card, int *dom)
{
IntSet d(dom, card);
return new SetVar(space, d, d);
}
-SetVar* gec_fs_make_bounds(Simple* space,
+SetVar* gec_fs_make_bounds(GecolSpace* space,
int lower_card, int *lower_dom,
int upper_card, int *upper_dom)
{
@@ -516,14 +1130,14 @@
return new SetVar(space, ld, ud);
}
-SetVar* gec_fs_make_lower_bound(Simple* space,
+SetVar* gec_fs_make_lower_bound(GecolSpace* space,
int lower_card, int *lower_dom)
{
IntSet ld(lower_dom, lower_card);
return new SetVar(space, ld, IntSet::empty);
}
-SetVar* gec_fs_make_upper_bound(Simple* space,
+SetVar* gec_fs_make_upper_bound(GecolSpace* space,
int upper_card, int *upper_dom)
{
IntSet ud(upper_dom, upper_card);
@@ -590,46 +1204,258 @@
return set->assigned();
}
-void gec_fs_cardinality_const(Simple* space, SetVar* set, unsigned int min, unsigned int max)
+//////
+
+void atmostOne_setvarargs_unsigned_int(Space *home, const lisp_SetVarArgs *x, unsigned int c)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::atmostOne(home, x_SetVarArgs, c);
+}
+
+void distinct_setvarargs_unsigned_int(Space *home, const lisp_SetVarArgs *x, unsigned int c)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::distinct(home, x_SetVarArgs, c);
+}
+
+void min_setvar_intvar(Space *home, SetVar *s, IntVar *x)
+{
+ Gecode::min(home, *s, *x);
+}
+
+void max_setvar_intvar(Space *home, SetVar *s, IntVar *x)
+{
+ Gecode::max(home, *s, *x);
+}
+
+void match_setvar_intvarargs(Space *home, SetVar *s, const lisp_IntVarArgs *x)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::match(home, *s, x_IntVarArgs);
+}
+
+void channel_intvarargs_setvarargs(Space *home, const lisp_IntVarArgs *x, const lisp_SetVarArgs *y)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ SetVarArgs y_SetVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_SetVarArgs[i] = *((*(y->array))[i]);
+ Gecode::channel(home, x_IntVarArgs, y_SetVarArgs);
+}
+
+void cardinality_setvar_intvar(Space *home, SetVar *s, IntVar *x)
+{
+ Gecode::cardinality(home, *s, *x);
+}
+
+void weights_intargs_intargs_setvar_intvar(Space *home, const lisp_IntArgs *elements, const lisp_IntArgs *weights, SetVar *x, IntVar *y)
+{
+ IntArgs elements_IntArgs(elements->size);
+ for(int i=0;i<elements->size;i++)
+ elements_IntArgs[i] = (*(elements->array))[i];
+ IntArgs weights_IntArgs(weights->size);
+ for(int i=0;i<weights->size;i++)
+ weights_IntArgs[i] = (*(weights->array))[i];
+ Gecode::weights(home, elements_IntArgs, weights_IntArgs, *x, *y);
+}
+
+void convex_setvar(Space *home, SetVar *x)
{
- cardinality(space, *set, min, max);
+ Gecode::convex(home, *x);
}
-void gec_fs_cardinality(Simple* space, SetVar* set, int x)
+void convexHull_setvar_setvar(Space *home, SetVar *x, SetVar *y)
{
- IntVarArray vars = space->get_vars2();
- cardinality(space, *set, vars[x]);
+ Gecode::convexHull(home, *x, *y);
}
-void gec_fs_rel_setvar_setreltype_setvar(Simple* space, SetVar* x, SetRelType r, SetVar* y)
+void selectUnion_setvarargs_setvar_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z)
{
- rel(space, *x, r, *y);
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::selectUnion(home, x_SetVarArgs, *y, *z);
}
-void gec_fs_rel_intvar_setreltype_setvar(Simple* space, int x, SetRelType r, SetVar* y)
+void selectInter_setvarargs_setvar_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z)
{
- IntVarArray vars = space->get_vars2();
- rel(space, vars[x], r, *y);
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::selectInter(home, x_SetVarArgs, *y, *z);
}
-// TODO ...
+void selectInterIn_setvarargs_setvar_setvar_intset(Space *home, const lisp_SetVarArgs *x, SetVar *y, SetVar *z, const IntSet *universe)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::selectInterIn(home, x_SetVarArgs, *y, *z, *universe);
+}
+
+void selectDisjoint_setvarargs_setvar(Space *home, const lisp_SetVarArgs *x, SetVar *y)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::selectDisjoint(home, x_SetVarArgs, *y);
+}
+
+void selectSet_setvarargs_intvar_setvar(Space *home, const lisp_SetVarArgs *x, IntVar *y, SetVar *z)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::selectSet(home, x_SetVarArgs, *y, *z);
+}
+
+void rel_setvar_setreltype_setvar(Space *home, SetVar *x, SetRelType r, SetVar *y)
+{
+ Gecode::rel(home, *x, r, *y);
+}
+
+void rel_setvar_setreltype_setvar_boolvar(Space *home, SetVar *x, SetRelType r, SetVar *y, BoolVar *b)
+{
+ Gecode::rel(home, *x, r, *y, *b);
+}
+
+void rel_setvar_setreltype_intvar(Space *home, SetVar *s, SetRelType r, IntVar *x)
+{
+ Gecode::rel(home, *s, r, *x);
+}
-// operation/relation
-void gec_fs_rel_setvar_setoptype_setvar_setreltype_setvar(Simple* space, SetVar* x, SetOpType op, SetVar* y, SetRelType r, SetVar* z)
+void rel_intvar_setreltype_setvar(Space *home, IntVar *x, SetRelType r, SetVar *s)
{
- rel(space, *x, op, *y, r, *z);
+ Gecode::rel(home, *x, r, *s);
}
-// TODO ...
+void rel_setvar_setreltype_intvar_boolvar(Space *home, SetVar *s, SetRelType r, IntVar *x, BoolVar *b)
+{
+ Gecode::rel(home, *s, r, *x, *b);
+}
-void gec_fs_min(Simple* space, SetVar* s, int x)
+void rel_intvar_setreltype_setvar_boolvar(Space *home, IntVar *x, SetRelType r, SetVar *s, BoolVar *b)
{
- IntVarArray vars = space->get_vars2();
- min(space, *s, vars[x]);
+ Gecode::rel(home, *x, r, *s, *b);
}
-void gec_fs_max(Simple* space, SetVar* s, int x)
+void rel_setvar_intreltype_intvar(Space *home, SetVar *s, IntRelType r, IntVar *x)
{
- IntVarArray vars = space->get_vars2();
- max(space, *s, vars[x]);
+ Gecode::rel(home, *s, r, *x);
}
+
+void rel_intvar_intreltype_setvar(Space *home, IntVar *x, IntRelType r, SetVar *s)
+{
+ Gecode::rel(home, *x, r, *s);
+}
+
+void rel_setvar_setoptype_setvar_setreltype_setvar(Space *home, SetVar *x, SetOpType op, SetVar *y, SetRelType r, SetVar *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_setoptype_setvarargs_setvar(Space *home, SetOpType op, const lisp_SetVarArgs *x, SetVar *y)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::rel(home, op, x_SetVarArgs, *y);
+}
+
+void rel_setoptype_intvarargs_setvar(Space *home, SetOpType op, const lisp_IntVarArgs *x, SetVar *y)
+{
+ IntVarArgs x_IntVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_IntVarArgs[i] = *((*(x->array))[i]);
+ Gecode::rel(home, op, x_IntVarArgs, *y);
+}
+
+void rel_intset_setoptype_setvar_setreltype_setvar(Space *home, const IntSet *x, SetOpType op, SetVar *y, SetRelType r, SetVar *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_setvar_setoptype_intset_setreltype_setvar(Space *home, SetVar *x, SetOpType op, const IntSet *y, SetRelType r, SetVar *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_setvar_setoptype_setvar_setreltype_intset(Space *home, SetVar *x, SetOpType op, SetVar *y, SetRelType r, const IntSet *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_intset_setoptype_intset_setreltype_setvar(Space *home, const IntSet *x, SetOpType op, const IntSet *y, SetRelType r, SetVar *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_intset_setoptype_setvar_setreltype_intset(Space *home, const IntSet *x, SetOpType op, SetVar *y, SetRelType r, const IntSet *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void rel_setvar_setoptype_intset_setreltype_intset(Space *home, SetVar *x, SetOpType op, const IntSet *y, SetRelType r, const IntSet *z)
+{
+ Gecode::rel(home, *x, op, *y, r, *z);
+}
+
+void sequence_setvarargs(Space *home, const lisp_SetVarArgs *x)
+{
+ SetVarArgs x_SetVarArgs(x->size);
+ for(int i=0;i<x->size;i++)
+ x_SetVarArgs[i] = *((*(x->array))[i]);
+ Gecode::sequence(home, x_SetVarArgs);
+}
+
+void sequentialUnion_setvarargs_setvar(Space *home, const lisp_SetVarArgs *y, SetVar *x)
+{
+ SetVarArgs y_SetVarArgs(y->size);
+ for(int i=0;i<y->size;i++)
+ y_SetVarArgs[i] = *((*(y->array))[i]);
+ Gecode::sequentialUnion(home, y_SetVarArgs, *x);
+}
+
+void dom_setvar_setreltype_int(Space *home, SetVar *x, SetRelType r, int i)
+{
+ Gecode::dom(home, *x, r, i);
+}
+
+void dom_setvar_setreltype_int_int(Space *home, SetVar *x, SetRelType r, int i, int j)
+{
+ Gecode::dom(home, *x, r, i, j);
+}
+
+void dom_setvar_setreltype_intset(Space *home, SetVar *x, SetRelType r, const IntSet *s)
+{
+ Gecode::dom(home, *x, r, *s);
+}
+
+void dom_setvar_setreltype_int_boolvar(Space *home, SetVar *x, SetRelType r, int i, BoolVar *b)
+{
+ Gecode::dom(home, *x, r, i, *b);
+}
+
+void dom_setvar_setreltype_int_int_boolvar(Space *home, SetVar *x, SetRelType r, int i, int j, BoolVar *b)
+{
+ Gecode::dom(home, *x, r, i, j, *b);
+}
+
+void dom_setvar_setreltype_intset_boolvar(Space *home, SetVar *x, SetRelType r, const IntSet *s, BoolVar *b)
+{
+ Gecode::dom(home, *x, r, *s, *b);
+}
+
+void cardinality_setvar_unsigned_int_unsigned_int(Space *home, SetVar *x, unsigned int i, unsigned int j)
+{
+ Gecode::cardinality(home, *x, i, j);
+}
+
diff -rN -u old-gecol/package.lisp new-gecol/package.lisp
--- old-gecol/package.lisp 2014-07-23 02:53:25.000000000 -0700
+++ new-gecol/package.lisp 2014-07-23 02:53:25.000000000 -0700
@@ -30,55 +30,15 @@
(in-package :cl-user)
(defpackage :gecol
- (:documentation "This is the gecol package, providing bindings to work with GECODE.")
+ (:documentation "Provides bindings to GECODE.")
(:use :cl :iterate :cffi)
(:export
- #:create-search-engine
- #:create-space
- #:dispose-search-engine
- #:dispose-space
- #:search-next
- #:space-read-int
- #:space-read-bool
- ;; propagators
- #:gec-bool-and
- #:gec-bool-and-const
- #:gec-bool-assigned
- #:gec-bool-eq
- #:gec-bool-eq-const
- #:gec-bool-eqv
- #:gec-bool-eqv-const
- #:gec-bool-imp
- #:gec-bool-imp-const
- #:gec-bool-not
- #:gec-bool-or
- #:gec-bool-or-const
- #:gec-bool-xor
- #:gec-bool-xor-const
- #:gec-branch-vars-max
- #:gec-branch-vars-med
- #:gec-branch-vars-min
- #:gec-distance
- #:gec-distance-const
- #:gec-distinct
- #:gec-dom-var
- #:gec-dom-var-set
- #:gec-element-const
- #:gec-element-vars
- #:gec-int-assigned
- #:gec-linear-const
- #:gec-linear-var
- #:gec-max
- #:gec-min
+ #:make-gecolspace
+ #:make-dfs-space-int-int-stop
+ #:make-bab-space-int-int-stop
+ ;; Ints
#:gec-minus
- #:gec-mod-12
- #:gec-mult
- #:gec-rel-const
- #:gec-rel-reif
- #:gec-rel-var
;; Sets
- #:gec-fs-space-put
- #:gec-fs-space-get
#:gec-fs-make-const
#:gec-fs-make-bounds
#:gec-fs-make-lower-bound
@@ -99,16 +59,6 @@
#:gec-fs-enumerate-lower-bound
#:gec-fs-enumerate-upper-bound
#:gec-fs-value
- #:gec-fs-cardinality-const
- #:gec-fs-cardinality
- #:gec-fs-rel-setvar-setreltype-setvar
- #:gec-fs-rel-setvar-setreltype-setvar-boolvar
- #:gec-fs-rel-intvar-setreltype-setvar
- #:gec-fs-rel-intvar-setreltype-setvar-boolvar
- #:gec-fs-rel-setvar-setoptype-setvar-setreltype-setvar
- #:gec-fs-min
- #:gec-fs-max
-
;;; utils
#:with-list-as-int-array
))