Programs#
Draco loads its programs from the asp directory that contains the Draco knowledge base as answer set programs. Draco exposes the following programs.
definitions: loads fromdefine.lpthat declares the domains to visualization attributes.constraints: loads fromconstraints.lpthat restricts the search space to follow the correct draco general description language.generate: loads fromgenerate.lpthat sets up the search space.hard: loads fromhard.lpthat restricts the search space to only well-formed and expressive specifications.helpers: loads fromhelpers.lpthat defines useful helper functions.
Additionally, the asp directory contains a soft.lp
that defines soft constraints in the form of violation/1 and violation/2 predicates. By themselves, these predicates
don’t change the search.
Options for Each Program#
- draco.programs#
Each program has both the program as well as the program as a dictionary of blocks. Blocks allow you to pick and choose parts of a program and access documentation.
- class draco.programs.Program(program, blocks)#
Class for an Answer Set Programming (ASP) program.
- Attributes:
- program:
The complete program.
- blocks:
The blocks in the program.
- class draco.asp_utils.Block(block_type, description, program)#
Class for a code block.
- Attributes:
- block_type:
The type of code block.
- description:
Short description of the code block.
- program:
The program in Answer Set Programming (ASP).