concepts.pdsketch.parsers.pdsketch_parser.PDSketchParser#
- class PDSketchParser[source]#
Bases:
object
Parser for PDSketch domain and problem files. Users should not use this class directly. Instead, use the following functions:
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_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.
- __new__(**kwargs)#
- incremental_define_domain(domain, tree)[source]#
Incrementally define a PDSketch domain from a tree.
- Parameters:
domain (Domain)
tree (Tree)
- Return type:
None
- load(file)[source]#
Load a domain or problem file and return the corresponding tree.
- Return type:
Tree
- loads(string)[source]#
Load a domain or problem string and return the corresponding tree.
- Return type:
Tree
- make_expression(domain, tree, variables=None)[source]#
Construct a PDSketch expression from a tree.
- Parameters:
- Return type:
- make_problem(tree, domain, ignore_unknown_predicates=False)[source]#
Construct a PDSketch problem from a tree.
- grammar_file = '/Users/jiayuanm/Projects/Concepts/concepts/pdsketch/parsers/pdsketch-v2.grammar'#
The grammar definition for PDSketch.