{ "info": { "author": "Javier Romero", "author_email": "javier@cs.uni-potsdam.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development :: Build Tools" ], "description": "# asprin\n> A general framework for qualitative and quantitative optimization in answer set programming.\n\n## Description\n`asprin` is a general framework for optimization in ASP that allows:\n* computing optimal stable models of logic programs with preferences, and\n* defining new preference types in a very easy way.\nSome preference types (`subset`, `pareto`...) are already defined in `asprin`'s library,\nbut many more can be defined simply writing a logic program.\n\nFor a formal description of `asprin`, please read our [paper](http://www.cs.uni-potsdam.de/wv/pdfformat/brderosc15a.pdf) ([bibtex](http://www.cs.uni-potsdam.de/wv/bibtex/brderosc15a.bib)).\n\nStarting with version 3, `asprin` is documented in the [Potassco guide](https://github.com/potassco/guide/releases/).\nOlder versions are documented in the [Potassco guide on Sourceforge](https://sourceforge.net/projects/potassco/files/guide/).\n\n\n## Usage\n```bash\n$ asprin [number_of_models] [options] [files]\n```\nBy default, `asprin` loads its library `asprin_lib.lp`. This may be disabled with option `--no-asprin-lib`.\n\nOption `--help` prints help.\n\nOptions `--approximation=weak` and `--approximation=heuristic` activate solving modes different than the basic ones, \nand are often faster than it.\n\nOption `--meta=query` can be used to compute optimal models that contain the atom `query`. \n\nOptions `--meta=simple` or `--meta=combine` should be used to compute many optimal models using\nnon stratified preference programs (in `asprin`'s library this can only happen with CP nets, see below).\n\nOption `--on-opt-heur` can be used to enumerate diverse (or similar) optimal stable models. \nFor example, try with `--on-opt-heur=+,p,1,false --on-opt-heur=-,p,1,true`.\n\nOption `--improve-limit` can be used to enumerate close to optimal stable models.\nFor example, try with `--improve-limit 2,1000`.\n\n## Building\n\n\nThe easiest way to obtain `asprin` is using Anaconda. \nPackages are available in the Potassco channel.\nFirst install either Anaconda or Miniconda and then run: \n`conda install -c potassco asprin`.\n\n\n`asprin` can also be installed with [pip](https://pip.pypa.io) via\n```pip install asprin```. \nFor a local installation, add option ```--user```.\nIn this case, setting environment variable `PYTHONUSERBASE` to `dir` before running `pip`, \n`asprin` will be installed in `dir/bin/asprin`.\n\n\nIf that does not work, \nyou can always download the sources from \n[here](https://github.com/potassco/asprin/releases/download/v3.1.0/asprin-3.1.0.tar.gz) in some directory `dir`,\nand run `asprin` with `python dir/asprin/asprin/asprin.py`.\n\n\nSystem tests may be run with ```asprin --test``` and ```asprin --test --all```.\n\n`asprin` has been tested with `Python 2.7.13` and `3.5.3`, using `clingo 5.3.0`.\n\n```asprin``` uses the `ply` library, version `3.11`,\nwhich is bundled in [asprin/src/spec_parser/ply](https://github.com/potassco/asprin/tree/master/asprin/src/spec_parser/ply),\nand was retrieved from http://www.dabeaz.com/ply/.\n\n## Examples\n```\n$ cat examples/example1.lp\ndom(1..3).\n1 { a(X) : dom(X) }.\n#show a/1.\n\n#preference(p,subset) { \n a(X)\n}.\n#optimize(p).\n\n\n$ asprin examples/example1.lp 0\nasprin version 3.0.0\nReading from examples/example1.lp\nSolving...\nAnswer: 1\na(3)\nOPTIMUM FOUND\nAnswer: 2\na(2)\nOPTIMUM FOUND\nAnswer: 3\na(1)\nOPTIMUM FOUND\n\nModels : 3\n Optimum : yes\n Optimal : 3\n\n$ cat examples/example2.lp\n%\n% base program\n%\n\ndom(1..3).\n1 { a(X) : dom(X) } 2.\n1 { b(X) : dom(X) } 2.\n#show a/1.\n#show b/1.\n\n%\n% basic preference statements\n%\n\n#preference(p(1),subset){\n a(X)\n}.\n\n#preference(p(2),less(weight)){\n X :: b(X)\n}.\n\n#preference(p(3),aso){\n a(X) >> not a(X) || b(X)\n}.\n\n#preference(p(4),poset){\n a(X);\n b(X);\n a(X) >> b(X)\n}.\n\n%\n% composite preference statements\n%\n\n#preference(q,pareto){\n **p(X)\n}.\n\n#preference(r,neg){\n **q\n}.\n\n%\n% optimize statement\n%\n\n#optimize(r).\n\n$ asprin examples/example2.lp \nasprin version 3.0.0\nReading from examples/example2.lp\nSolving...\nAnswer: 1\na(3) b(1)\nOPTIMUM FOUND\n\nModels : 1+\n Optimum : yes\n```\n\n## CP nets\n\n`asprin` preference library implements the preference type `cp`,\nthat stands for *CP nets*.\n\nCP nets where introduced in the following paper:\n* Craig Boutilier, Ronen I. Brafman, Carmel Domshlak, Holger H. Hoos, David Poole:\nCP-nets: A Tool for Representing and Reasoning with Conditional Ceteris Paribus Preference Statements. \nJ. Artif. Intell. Res. 21: 135-191 (2004)\n\nPropositional preference elements of type `cp` have one of the following forms:\n1. `a >> not a || { l1; ...; ln }`, or\n2. `not a >> a || { l1; ...; ln }`\n\nwhere `a` is an atom and `l1`, ..., `ln` are literals.\n\nThe semantics is defined using the notion of improving flips.\nLet `X` and `Y` be two interpretations of a logic program.\nThere is an improving flip from `X` to `Y` if \nthere is some preference element such that `X` and `Y` satisfy all `li`'s, and either\nthe element has the form (1) and `Y` is the union of `X` and `{a}`, \nor \nthe element has the form (2) and `Y` is `X` minus `{a}`.\nThen, `W` is better than `Z` if there is a sequence of improving flips from `W` to `Z`.\nA CP net is consistent if there is no interpretation `X` such that `X` is better than `X`.\n\n\nWe provide various encoding and solving techniques for CP nets, \nthat can be applied depending on the structure of the CP net.\nFor tree-like CP nets, see example [cp_tree.lp](https://github.com/potassco/asprin/blob/master/asprin/examples/cp_tree.lp).\nFor acyclic CP nets, see example [cp_acyclic.lp](https://github.com/potassco/asprin/blob/master/asprin/examples/cp_acyclic.lp).\nFor general CP nets, see example [cp_general.lp](https://github.com/potassco/asprin/blob/master/asprin/examples/cp_general.lp).\n\n`asprin` implementation of CP nets is correct only for consistent CP nets.\nNote that tree-like and acyclic CP nets are always consistent, but this does not hold in general.\n\n\n## Contributors\n\n* Javier Romero\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/potassco/asprin", "keywords": "logic answer set programming preference optimization", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "asprin", "package_url": "https://pypi.org/project/asprin/", "platform": "", "project_url": "https://pypi.org/project/asprin/", "project_urls": { "Homepage": "https://github.com/potassco/asprin" }, "release_url": "https://pypi.org/project/asprin/3.1.0/", "requires_dist": null, "requires_python": "", "summary": "Qualitative and quantitative optimization in answer set programming", "version": "3.1.0" }, "last_serial": 4486629, "releases": { "3.0.0.5": [ { "comment_text": "", "digests": { "md5": "8d0af48b25827b8d6f59eb2722fee7f1", "sha256": "57de905a3de87be02092bacf428e670253660b969116309be5b7725a4650c6f6" }, "downloads": -1, "filename": "asprin-3.0.0.5-py2-none-any.whl", "has_sig": false, "md5_digest": "8d0af48b25827b8d6f59eb2722fee7f1", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 145728, "upload_time": "2017-07-15T10:53:08", "url": "https://files.pythonhosted.org/packages/1e/f5/290403975106f0e2279a86deeeb4df14d147911afb3ae02c4e50949045be/asprin-3.0.0.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f3a295df98ad97c488037a8165c1761", "sha256": "7cbeebf10a42337bee7f350274c105a68546b1f9a08de0d593bf3a2d56cb6d93" }, "downloads": -1, "filename": "asprin-3.0.0.5.tar.gz", "has_sig": false, "md5_digest": "9f3a295df98ad97c488037a8165c1761", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 92628, "upload_time": "2017-07-15T10:53:10", "url": "https://files.pythonhosted.org/packages/94/ab/f098df2191f835520993b92e966a529d2b1fc30b4a5c8ede3f89cb0b5b17/asprin-3.0.0.5.tar.gz" } ], "3.0.0.6": [ { "comment_text": "", "digests": { "md5": "d90d5f214fd2998bca5329c89f5c8ac2", "sha256": "4866efcfe79b44b4b3ea82f14547aca4250c7a83d2e2c5a6255cc60afe2fb728" }, "downloads": -1, "filename": "asprin-3.0.0.6-py2-none-any.whl", "has_sig": false, "md5_digest": "d90d5f214fd2998bca5329c89f5c8ac2", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 177670, "upload_time": "2017-09-15T12:35:31", "url": "https://files.pythonhosted.org/packages/29/63/baa62f3903abe6236d28338d78dfdb8d8557b02f0fe0dfc16033c4d0a26a/asprin-3.0.0.6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "87b20b97345f81f738846d162a2c4984", "sha256": "9bd08b82f906b2078b4eb2dba73dc08bc87f0028867d6a0fd42c5a87813dbdaa" }, "downloads": -1, "filename": "asprin-3.0.0.6.tar.gz", "has_sig": false, "md5_digest": "87b20b97345f81f738846d162a2c4984", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 116113, "upload_time": "2017-09-15T12:35:34", "url": "https://files.pythonhosted.org/packages/37/5c/6c5243b4cdfa842c9171981456d5478cca5652401d5cf0828461478a443a/asprin-3.0.0.6.tar.gz" } ], "3.0.1": [ { "comment_text": "", "digests": { "md5": "734f1d8889220fb2e0b075652e95a7fc", "sha256": "0932c29c192ed8463ffde144553ae23603170d9ce794846bd1f1915fd2a52bd8" }, "downloads": -1, "filename": "asprin-3.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "734f1d8889220fb2e0b075652e95a7fc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 177686, "upload_time": "2017-10-06T13:50:47", "url": "https://files.pythonhosted.org/packages/84/12/fd0d6d0b5bee977836ed43c3df4cc08232638945fa27cc4ada1e31a3b807/asprin-3.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "76c6b072db6c348310580b5943b879c7", "sha256": "c234598f9b89a5d4c5542bee2e7eacf333c92bd9f7277a28c5808778c3726886" }, "downloads": -1, "filename": "asprin-3.0.1.tar.gz", "has_sig": false, "md5_digest": "76c6b072db6c348310580b5943b879c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 116152, "upload_time": "2017-10-06T13:50:50", "url": "https://files.pythonhosted.org/packages/ab/2c/8be369b7f16431a185f911af49d95466ff0db81861ecc847e585b7375837/asprin-3.0.1.tar.gz" } ], "3.0.2": [ { "comment_text": "", "digests": { "md5": "30f7aed63954c8863203fc36aade4ec9", "sha256": "bb8a88bd8ce403390bbd4fc22272ea1f5dd4098235c56aaef5c0a18fe93ccac9" }, "downloads": -1, "filename": "asprin-3.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "30f7aed63954c8863203fc36aade4ec9", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 180257, "upload_time": "2017-10-31T07:18:10", "url": "https://files.pythonhosted.org/packages/ef/70/e503708f27c8cc31da8e36765080ebcc0e3cf95c438ffbff61257c62f41c/asprin-3.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e33e012a5366bced5453ee284bbf3bd", "sha256": "529452589c63e2bc71c4deeb19490c91b45ddad37b4eab88f1d35ff6d8f8215e" }, "downloads": -1, "filename": "asprin-3.0.2.tar.gz", "has_sig": false, "md5_digest": "8e33e012a5366bced5453ee284bbf3bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 117414, "upload_time": "2017-10-31T07:18:12", "url": "https://files.pythonhosted.org/packages/ca/23/fbc20234b26f3711319133f1b61034736713d7738ad4ce96e7be6c111593/asprin-3.0.2.tar.gz" } ], "3.0.99": [ { "comment_text": "", "digests": { "md5": "4c7d2947f5bb4b4f02c2da0515ef11a2", "sha256": "2af5674e1218ccba38ab0eed3a315c3cd288f1959fb54f42bc7420699a8f0ce2" }, "downloads": -1, "filename": "asprin-3.0.99-py2-none-any.whl", "has_sig": false, "md5_digest": "4c7d2947f5bb4b4f02c2da0515ef11a2", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 214880, "upload_time": "2018-09-22T17:17:44", "url": "https://files.pythonhosted.org/packages/d8/1c/0c7ad80fbb5a2a6c389519c31781ec8178396ac65ce9a54a3ae1130ce54c/asprin-3.0.99-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31994851e5a710b04a9c320595e7a0a3", "sha256": "bbf8d1734b6f7504837d63a8c616f7f4fae1290b844a010f0bc4a1232c28b251" }, "downloads": -1, "filename": "asprin-3.0.99.tar.gz", "has_sig": false, "md5_digest": "31994851e5a710b04a9c320595e7a0a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 142329, "upload_time": "2018-09-22T17:17:46", "url": "https://files.pythonhosted.org/packages/7a/37/54631190a6c278bdbabd14f52f5c73fca1878a01696fb14baca95ab8b14a/asprin-3.0.99.tar.gz" } ], "3.0.999": [ { "comment_text": "", "digests": { "md5": "706e594bc85da0536a33de1daa04f738", "sha256": "2cacbf3be180f7f918bc9a7c4e6ed352e8ea4e4afb7f0c7b344bb3175119e080" }, "downloads": -1, "filename": "asprin-3.0.999-py2-none-any.whl", "has_sig": false, "md5_digest": "706e594bc85da0536a33de1daa04f738", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 214894, "upload_time": "2018-09-23T22:52:35", "url": "https://files.pythonhosted.org/packages/3b/7c/e5d574a2efeed5ec9a4ede232e959544dd8367bbedbd74177851177e6d16/asprin-3.0.999-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c8a7c0d29ef19c15c2f144b801daca4", "sha256": "739237d72b74c30484ee8dd18fab15485b9215acebca7f31527c4c46dc9c0331" }, "downloads": -1, "filename": "asprin-3.0.999.tar.gz", "has_sig": false, "md5_digest": "8c8a7c0d29ef19c15c2f144b801daca4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 142333, "upload_time": "2018-09-23T22:52:37", "url": "https://files.pythonhosted.org/packages/08/78/60967e1d2d9f25bb0ad9c9b90a01a657fb9e053d2ea264691a68109e5337/asprin-3.0.999.tar.gz" } ], "3.1.0": [ { "comment_text": "", "digests": { "md5": "b982cb87ffd16e9132d7820a11cd994f", "sha256": "92bb82fe7cc4e550c071c706074b6982edc4a8cf2f1600ea69aff4cc11850647" }, "downloads": -1, "filename": "asprin-3.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "b982cb87ffd16e9132d7820a11cd994f", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 212351, "upload_time": "2018-11-14T18:41:10", "url": "https://files.pythonhosted.org/packages/17/2a/fc97b3cf2f472df57d1e6a15fd28d221064eb2828f125b4b5c65db95f71f/asprin-3.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "30052614e0461c95172b200db94d35a0", "sha256": "2ea10d8484223acbefbccf92e420d4b9de3a3010d079bc9b7fa138da64e6d385" }, "downloads": -1, "filename": "asprin-3.1.0.tar.gz", "has_sig": false, "md5_digest": "30052614e0461c95172b200db94d35a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 143070, "upload_time": "2018-11-14T18:41:13", "url": "https://files.pythonhosted.org/packages/86/cf/a1c31561320da8842abc571f45420eb702d394a6efb79e13c6487d4fa0a9/asprin-3.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b982cb87ffd16e9132d7820a11cd994f", "sha256": "92bb82fe7cc4e550c071c706074b6982edc4a8cf2f1600ea69aff4cc11850647" }, "downloads": -1, "filename": "asprin-3.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "b982cb87ffd16e9132d7820a11cd994f", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 212351, "upload_time": "2018-11-14T18:41:10", "url": "https://files.pythonhosted.org/packages/17/2a/fc97b3cf2f472df57d1e6a15fd28d221064eb2828f125b4b5c65db95f71f/asprin-3.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "30052614e0461c95172b200db94d35a0", "sha256": "2ea10d8484223acbefbccf92e420d4b9de3a3010d079bc9b7fa138da64e6d385" }, "downloads": -1, "filename": "asprin-3.1.0.tar.gz", "has_sig": false, "md5_digest": "30052614e0461c95172b200db94d35a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 143070, "upload_time": "2018-11-14T18:41:13", "url": "https://files.pythonhosted.org/packages/86/cf/a1c31561320da8842abc571f45420eb702d394a6efb79e13c6487d4fa0a9/asprin-3.1.0.tar.gz" } ] }