Crates.io | pddl-ish-parser |
lib.rs | pddl-ish-parser |
version | 0.0.4 |
source | src |
created_at | 2023-11-18 00:01:24.484445 |
updated_at | 2023-11-18 00:07:01.347576 |
description | A Rust library for parsing a relaxed version of the Planning Domain Definition Language (PDDL), designed to handle PDDL-like inputs generated by autoregressive language models like ChatGPT. |
homepage | |
repository | |
max_upload_size | |
id | 1039998 |
size | 62,205 |
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.
To install the PDDL-ish Parser, you can use cargo add
command:
cargo add pddl-ish-parser
Or add the following to your Cargo.toml file:
pddl-ish-parser = "0.0.3"
You may want to check on the latest available version on crates.io.
Here is a basic example of how to use the PDDL-ish Parser:
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),
}
}
The library includes tests that you can run to ensure the parser works as expected:
cargo test
Contributions are welcome! Please open an issue or pull request on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.