concepts.dm.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

grammar_file

The grammar definition for PDSketch.

__init__()[source]#
__new__(**kwargs)#
incremental_define_domain(domain, tree)[source]#

Incrementally define a PDSketch domain from a tree.

Parameters:
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_domain(tree, domain_file_paths=tuple())[source]#

Construct a PDSketch domain from a tree.

Parameters:
Return type:

Domain

make_expression(domain, tree, variables=None)[source]#

Construct a PDSketch expression from a tree.

Parameters:
Return type:

Expression

make_problem(tree, domain, ignore_unknown_predicates=False)[source]#

Construct a PDSketch problem from a tree.

Parameters:
  • tree (Tree)

  • domain (Domain)

  • ignore_unknown_predicates (bool)

Return type:

Problem

grammar_file = '/Users/jiayuanm/Projects/Concepts/concepts/dm/pdsketch/parsers/pdsketch-v2.grammar'#

The grammar definition for PDSketch.