Package: hexlite
Hexlite - Solver for a fragment of HEXThis is a solver for a fragment of the HEX language and for Python-based plugins
which is based on Python interfaces of Clingo and does not contain any C++ code itself.The intention is to provide a lightweight system for an easy start with HEX.The vision is that HEXLite can use existing Python plugins and runs based on
the Clingo python interface, without realizing the full power of HEX.The system is currently under development and only works for certain programs:External atoms with only constant inputs are evaluated during grounding in GringoExternal atoms with predicate input(s) and no constant outputs are evaluated during solving in a clasp PropagatorExternal atoms with predicate input(s) and constant outputs that have a domain predicate can also be evaluatedLiberal Safety is not implementedProperties of external atoms are not usedIf it has a finite grounding, it will terminate, otherwise, it will not - as usual with GringoFLP Check is implemented explicitly and does not work with strong negation and weak constraintsFLP Check can be deactivatedThere is a Java Plugin API (see below)The system is described in the following publication.Peter Schüller (2019)
The Hexlite Solver.
In: Logics in Artificial Intelligence. JELIA 2019. Lecture Notes in Computer Science, vol 11468. Springer, Chamhttps://doi.org/10.1007/978-3-030-19570-0_39In case of bugs please report an issue here:https://github.com/hexhex/hexlite/issuesLicense: MITAuthor: Peter Schüllerschueller.p@gmail.comAvailable at PyPi:https://pypi.python.org/pypi/hexliteInstallation with Conda:The easiest way to installhexliteis Conda.$ conda install -c peterschueller -c potassco -c conda-forge hexlite(We need thepotasscochannel forclingoand theconda-forgechannel forjpype1.)Then you test hexlite:$ hexlite -hInstallation with pip:This will download, build, and locally install Python-enabledclingomodules.If you do not have it: installpython-pip: for example under Ubuntu via$ sudo apt-get install python-pipInstall hexlite:$ pip install hexlite --userSetup Python to use the "Userinstall" environment that allows you
to install Python programs without overwriting system packages:Add the following to your.profileor.bashrcfile:export PYTHONUSERBASE=~/.local/
export PATH=$PATH:~/.local/binRun hexlite the first time.$ hexliteThe first run of hexlite might ask you to enter the sudo password
to install several packages.
(You can do this manually. Simply abort and later runhexliteagain.)Ubuntu 16.04 is testedDebian 8.6 (jessie) is testedUbuntu 14.04 can not work without manual installation of cmake 3.1 or higher (for buildling clingo)Using the Java APIBuilding the JAVA API is not automated, you need to installmavenand runmvn clean compile package installSee also.travis.ymlhow to build and install and test the Java plugin.Using the Docker imageThere is a Dockerfile that builds a docker image where hexlite and its source code is installed.Build the image with$ ./build-docker-image.shRun the image and start a shell in the image with$ ./run-docker-image.shIn the image, run an example:# hexlite --pluginpath /opt/hexlite/plugins/ --plugin testplugin -- /opt/hexlite/tests/inputs/extatom2.hexShould give the following output (it is a set, the order of items does not matter):{prefix("test:"),more("a","b","c"),complete("test: a b c")}Running Hexlite on Examples in the RepositoryIfhexliteby itself shows the help, you can run it on some examples in the repository.Hexlite needs to know where to find plugins and what is the name of the Python modules of these pluginsThe path for plugins is given as argument--pluginpath <path>.This argument can be given multiple times. You can use absolute or relative paths.The python modules to load are given as argument--plugin <module> [<argument1> <argument2>].Multiple plugins can be loaded.
Each plugin can have arguments.!ATTENTION!:
If you specify the HEX input file after--plugin <module>, it becomes the argument of the plugin.
In this case, you need tospecify the HEX input filesbeforethe other arguments
orindicate end of the argument list with the--option.To run one of the examples in thetests/directory you can use one of the following methods to call hexlite:$ hexlite --pluginpath ./plugins/ --plugin testplugin -- tests/inputs/extatom3.hex
$ hexlite tests/inputs/extatom3.hex --pluginpath ./plugins/ --plugin testplugin
$ hexlite --pluginpath=./plugins/ --plugin=testplugin tests/inputs/extatom3.hexDeveloper ReadmeFor developing hexlite without uploading to anaconda repository:Install clingo with conda or pip, but but donotinstall hexlite with conda.$ conda install -c potassco clingoor$ pip install clingocheckout hexlite with git$ git clone git@github.com:hexhex/hexlite.gitinstallhexlitein develop mode into your user-defined Python space:$ python3 setup.py develop --userIf you want to remove this development installation:$ python3 setup.py develop --uninstall --user
$ rm ~/.local/bin/hexlite(Installed scripts are not automatically uninstalled.)ReleasingFor building and uploading a new version to pip and conda (Note: conda requires to upload to pip first)Update version insetup.py.Build pypi source package$ python setup.py sdistVerify that dist/ contains the right archives with the right content (no wheels etc.)Upload to pypi (the twine in Ubuntu 18.04 does not work, you must install viapip3 install twine)$ twine upload dist/*Update version inmeta.yaml.Build for anaconda cloudFirst, some conda packages need to be installed viaconda install conda-build conda-verify anaconda.$ conda build . -c potasscoor$ conda build . -c potassco --no-verify --no-test(get upload command from last lines of output, check output, then re-run without the last two arguments.)If conda is installed on an encrypted /home/ or similar, this will abort with a permission error.
You can make it work by creating a new directory on an unencrypted/tmp/, for example/tmp/conda-build,
and run conda build as follows:$ conda build --croot /tmp/conda-build/ .  -c potasscoVerify that archive to upload contains the right content (and no backup files, experimental results, etc...)$ anaconda upload <path-from-conda-build>