Commit [r8479] Maximize Restore History

- updated onmodel example

rkaminski 2014-06-07

added /trunk/gringo/examples/onmodel/README
added /trunk/gringo/examples/onmodel/onmodel-lua.lp
copied /trunk/gringo/examples/onmodel/onmodel.lp -> /trunk/gringo/examples/onmodel/onmodel-py.lp
/trunk/gringo/examples/onmodel/README Diff Switch to side-by-side view
Loading...
/trunk/gringo/examples/onmodel/onmodel-lua.lp Diff Switch to side-by-side view
Loading...
/trunk/gringo/examples/onmodel/onmodel.lp to /trunk/gringo/examples/onmodel/onmodel-py.lp
--- a/trunk/gringo/examples/onmodel/onmodel.lp
+++ b/trunk/gringo/examples/onmodel/onmodel-py.lp
@@ -5,17 +5,17 @@
 def main(prg):
     def onModel(m):
         print "shown"
-        print "  positive:", m.atoms(gringo.Model.SHOWN)
-        print "  negative:", m.atoms(gringo.Model.SHOWN | gringo.Model.COMP)
+        print "  positive:", ", ".join(map(str, m.atoms(gringo.Model.SHOWN)))
+        print "  negative:", ", ".join(map(str, m.atoms(gringo.Model.SHOWN | gringo.Model.COMP)))
         print "csp"
-        print "  positive:", m.atoms(gringo.Model.CSP)
-        print "  negative:", m.atoms(gringo.Model.CSP | gringo.Model.COMP)
+        print "  positive:", ", ".join(map(str, m.atoms(gringo.Model.CSP)))
+        print "  negative:", ", ".join(map(str, m.atoms(gringo.Model.CSP | gringo.Model.COMP)))
         print "atoms"
-        print "  positive:", m.atoms(gringo.Model.ATOMS)
-        print "  negative:", m.atoms(gringo.Model.ATOMS | gringo.Model.COMP)
+        print "  positive:", ", ".join(map(str, m.atoms(gringo.Model.ATOMS)))
+        print "  negative:", ", ".join(map(str, m.atoms(gringo.Model.ATOMS | gringo.Model.COMP)))
         print "terms"
-        print "  positive:", m.atoms(gringo.Model.TERMS)
-        print "  negative:", m.atoms(gringo.Model.TERMS | gringo.Model.COMP)
+        print "  positive:", ", ".join(map(str, m.atoms(gringo.Model.TERMS)))
+        print "  negative:", ", ".join(map(str, m.atoms(gringo.Model.TERMS | gringo.Model.COMP)))
 
     prg.ground("base", [])
     prg.solve(onModel = onModel)