concepts.dm.pdsketch.parsers.csp_parser.PDSketchCSPParser#
- class PDSketchCSPParser[source]#
Bases:
PDSketchParser
Parser for PDSketch domain and problem files. Users should not use this class directly. Instead, use the following functions:
load_domain_file()
load_domain_string()
Methods
incremental_define_domain
(domain, tree)Incrementally define a PDSketch domain from a tree.
load
(file)Load a domain or problem file and return the corresponding tree.
loads
(string)Load a domain or problem string and return the corresponding tree.
make_csp_problem
(tree, domain[, ...])Construct a PDSketch problem from a tree.
make_domain
(tree[, domain_file_paths])Construct a PDSketch domain from a tree.
make_expression
(domain, tree[, variables])Construct a PDSketch expression from a tree.
make_problem
(tree, domain[, ...])Construct a PDSketch problem from a tree.
Attributes
The grammar definition for PDSketch.
- __init__()#
- __new__(**kwargs)#
- incremental_define_domain(domain, tree)#
Incrementally define a PDSketch domain from a tree.
- Parameters:
domain (Domain)
tree (Tree)
- Return type:
None
- load(file)#
Load a domain or problem file and return the corresponding tree.
- Return type:
Tree
- loads(string)#
Load a domain or problem string and return the corresponding tree.
- Return type:
Tree
- make_csp_problem(tree, domain, ignore_unknown_predicates=False)[source]#
Construct a PDSketch problem from a tree.
- Parameters:
- Return type:
- make_domain(tree, domain_file_paths=tuple())#
Construct a PDSketch domain from a tree.
- make_expression(domain, tree, variables=None)#
Construct a PDSketch expression from a tree.
- Parameters:
- Return type:
- make_problem(tree, domain, ignore_unknown_predicates=False)#
Construct a PDSketch problem from a tree.
- grammar_file = '/Users/jiayuanm/Projects/Concepts/concepts/dm/pdsketch/parsers/pdsketch-v2.grammar'#
The grammar definition for PDSketch.