A cpmpy-based library for constraint acquisition.
Project description
PyConA: Constraint Acquisition in Python
PyConA (https://github.com/PyConA/pycona) is a python-based, open-source package for Constraint Acquisition (CA). In CA, the goal is to assist the user in modeling Constraint Programming (CP) problems, by learning the constraints through user interaction.
PyConA is based on the powerful CPMpy Constraint Programming and Modeling library in python (https://github.com/CPMpy/cpmpy), which is used for modeling the constraint problems.
Currently, only interactive CA methods are implemented in PyConA; passive CA methods might be added later.
Interactive Constraint Acquisition
In interactive CA, the system interacts with an Oracle, which can be a human user or a software system. The CA system asks queries and based on the answers of the oracle it either learns or excludes constraints.
PyConA is a generic CA library implementing a range of interactive CA methods, using the following modules:
- Interactive CA Algorithm: The top-level algorithm to be used.
- Query Generation: The query generation system to be used to generate top-level queries.
- FindScope: The FindScope system to be used for finding the scope of violated constraints.
- FindConstraint: The FindConstraint system to be used for finding the exact violated constraints in the given scopes.
A detailed presentation of CA methods can be found at:
Features
The repository has implemented various approaches and methods from the literature:
- Algorithms: QuAcq [1-2], MQuAcq [3-4], MQuAcq-2 [5], GrowAcq [6], P-QuAcq[7], G-QuAcq [8]
- Query Generation: TQ-Gen [9], PQ-Gen [6]
- FindScope: FindScope [1], Findscope-2 [2, 4]
- FindC: FindC [1], FindC-2 [2]
- ML-based CA system and query generation objectives from [10]
Installation
Clone and Install from this Repo
Download PyConA from the GitHub repository and install it as follows:
git clone -b main --depth 1 https://github.com/PyConA/PyConA.git
pip install PyConA.
Basics
In PyConA, the ProblemInstance class represents the instance of the problem the user wants to acquire the constraints for. It must be initialized with the variables of the problem and a language. A CA system is then used to acquire the constraints. PyConA currently implements only interactive CA algorithms (module .active_algorithms). The core of PyConA is the CA system (CASystem class). A CASystem can be run on a given ProblemInstance. The ProblemInstance class represents the instance of the problem the user wants to acquire the constraints for. It must be initialized with the variables of the problem and a language.
Basic Tutorials
Coming very soon
Documentation
Coming soon
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.