Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dcspark/pddl-ish-parser


https://github.com/dcspark/pddl-ish-parser

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# PDDL-ish Parser

The PDDL-ish Parser is a Rust library designed for parsing a relaxed version of the Planning Domain Definition Language (PDDL). This parser is particularly tailored for handling PDDL-like inputs that may be generated by autoregressive language models such as ChatGPT.

## Features

- Parse non-standard PDDL files with flexibility.
- Extract domains, objects, and actions from PDDL-like structured text.
- Error handling to provide context for parsing failures.
- Support for common PDDL constructs with leniency in syntax.

## Installation

To install the PDDL-ish Parser, you can use `cargo add` command:

```bash
cargo add pddl-ish-parser
```

Or add the following to your Cargo.toml file:
```toml
pddl-ish-parser = "0.0.3"
```

You may want to check on the latest available version on [crates.io](https://crates.io/crates/pddl-ish-parser).

## Usage

Here is a basic example of how to use the PDDL-ish Parser:

```rust
use pddl_ish_parser::parser::problem_parser::parse_problem;

fn main() {
let input = r#"(define (problem your-problem)
...
)"#;

match parse_problem(input) {
Ok((_, problem)) => println!("{:?}", problem),
Err(e) => eprintln!("Error parsing problem: {:?}", e),
}

let domain_input = r#"(define (domain your-domain)
...
)"#;

match parse_domain_types(domain_input) {
Ok((_, domain_types)) => println!("Parsed domain types: {:?}", domain_types),
Err(e) => eprintln!("Error parsing domain types: {:?}", e),
}
}
```

## Testing

The library includes tests that you can run to ensure the parser works as expected:

```bash
cargo test
```

## Contributions

Contributions are welcome! Please open an issue or pull request on GitHub.

## License

This project is licensed under the MIT License - see the LICENSE file for details.