potassco / potassco/constraint-handler
Provide an API to execute precomputation and solving separately
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3
- Forks
- 0
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 20
Description
Draft of the API
| ch | The constraint-handler library |
| CHPC | The Precomputer |
| ModelData | This are just CH input facts. It should include information which variables can later be set by presets and which variables have a dynamic domain. |
| Context | This are tables and provided python functions like getPLMTable. |
| Mode | The solve mode: solution/brave/cautious/optimization |
| PCD | This is the precompiled/grounded data that can be serialized/stored. |
| CHS | The Solver |
| Presets | The preset data used to set externals or add new facts. |
| Criteria | The optimization criteria |
| SolveHandle | A clingo SolveHandle |
ch.create_precomputer() -> CHPC # Create a the Precomputer
CHPC.add(ModelData) # Load model data into the Precomputer
CHPC.add_context(Context) # similar to current ch.add_to_control(...)
CHPC.set_mode(Mode) # Set solve mode
CHPC.precompute() -> PCD # Perform precomputation (grounding) and return a PCD
ch.load_solver(PCD) -> CHS # Create a Solver and load it with the PCD data
CHS.preset(Presets) # Load preset data
CHS.add_context(Context) # Load dynamic context (not sure if necessary)
CHS.solve() -> SolveHandle # start solving
# - add new facts new preset values and optimization criteria
# - do additional incremental grounding
# - set presets - externals
# - solve
What do we precompute?
- domain facts
- and fact representation of reified rules
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed create_precomputer, precompute, load_solver, and solve entry points, and compare them with the current ch.add_to_control behavior referenced in the issue. The issue is still a draft, so done requires settling the API and its handling of precomputed data, contexts, presets, and solving before implementation can be scoped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100