support for gecode 4, reification, initial floats

This commit is contained in:
vsc
2013-09-04 04:50:32 -05:00
parent 76ca8c31df
commit 6ab396ee85
18 changed files with 15685 additions and 15417 deletions

View File

@@ -195,6 +195,9 @@ class PredGenerator(DeclsLoader):
"VarBranchOptions",
"ValBranchOptions",
"TieBreakVarBranch<IntVarBranch>",
"TieBreak<IntVarBranch>",
"TieBreak<FloatVarBranch>",
"TieBreak<SetVarBranch>",
"TieBreakVarBranchOptions",
"TieBreakVarBranch<SetVarBranch>")
@@ -616,16 +619,21 @@ class CCDescriptor(object):
print "{"
i = 1
args = []
has_space = False
for t in self.argtypes:
v = "X%d" % i
a = "YAP_ARG%d" % i
if t=="Space":
v = "*space"
print " GenericSpace* space = gecode_Space_from_term(%s);" % a
has_space = True
else:
extra = ""
if t in ("IntVar","BoolVar","SetVar","IntVarArgs","BoolVarArgs","SetVarArgs"):
if t in ("IntVar","BoolVar","SetVar","FloatVar","IntVarArgs","BoolVarArgs","SetVarArgs","FloatVarArgs"):
extra = "space,"
if has_space == False:
print " GenericSpace* space = gecode_Space_from_term(%s);" % a
has_space = True
print " %s %s = gecode_%s_from_term(%s%s);" % (t,v,t,extra,a)
args.append(v)
i += 1

View File

@@ -9,6 +9,8 @@ all: $(PROTOTYPES) $(ENUMS)
$(PROTOTYPES): % : xml/namespaceGecode.xml extract-prototypes.xsl
cat notice.hh > $@ || { rm -f $@; exit 1; }
xsltproc extract-prototypes.xsl $< \
| grep EXPORT \
| grep -v Symmetry \
| sed 's/Gecode:://g' \
| sed 's/< /</g' \
| sed 's/ >/>/g' \
@@ -16,6 +18,7 @@ $(PROTOTYPES): % : xml/namespaceGecode.xml extract-prototypes.xsl
| sed 's/, /,/g' \
| sed 's/forceinline //g' \
| sed 's/GECODE_INT_EXPORT //g' \
| sed 's/GECODE_FLOAT_EXPORT //g' \
| sed 's/GECODE_SET_EXPORT //g' \
| grep -v '*' | sort >> $@ || { rm -f $@; exit 1; }