#parser #domain #problem #pddl #robust #goal #object

yanked spingus

A simple, fast, and robust PDDL parser

1 unstable release

0.1.0 Jan 31, 2024

#8 in #pddl

MIT license

61KB
1.5K SLoC

Spingus

A simple, fast, and robust PDDL parser

Spingus has three goals:

  • Robust - Is tested on commenly used PDDL domains and problems
  • Fast - Optimised and benchmarked to be as fast as possible
  • Simple - Avoids rarely used PDDL syntax in favor of easy of use

Example

use spingus::problem::objects::Object;
let input = "(define (problem prob)
                  (:objects o1)
                  (:init (p o1))
                  (:goal (not (p o3)))
             )";
let problem = spingus::problem::parse(&input);
assert_eq!(problem.name, Some("prob"));
assert_eq!(problem.domain, None);
assert_eq!(problem.objects, Some(vec![Object { name: "o1", type_name: None }]));
//...

Benchmark

Benchmarked on a i5-13600k with Criterion

Throughput Time to Parse (see here)
Domain 96 MiB/s 4 µs
Problem 726 MiB/s 726 ns
Plan 727 MiB/s 378 ns

Dependencies

~4MB
~40K SLoC