Skip to content

Instantly share code, notes, and snippets.

@primaryobjects
Last active August 28, 2022 08:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save primaryobjects/6cb0d14b3bbef3388b7a to your computer and use it in GitHub Desktop.
Save primaryobjects/6cb0d14b3bbef3388b7a to your computer and use it in GitHub Desktop.
Output from parsing PDDL STRIPS grammar, using pegjs parser. The PDDL grammar (https://gist.github.com/primaryobjects/22363e71112d716ea183) has been parsed and run against a pddl domain (https://spark-public.s3.amazonaws.com/aiplan/resources/random-domain.txt) and the output has been converted to json. See https://gist.github.com/primaryobjects/…
{
"domain":"random-domain",
"requirements":[
"strips",
"typing"
],
"actions":[
{
"action":"op1",
"parameters":[
"x1",
"x2",
"x3"
],
"precondition":[
{
"operation":"and",
"action":"S",
"parameters":[
"x1",
"x2"
]
},
{
"operation":"",
"action":"R",
"parameters":[
"x3",
"x1"
]
}
],
"effect":[
{
"operation":"and",
"action":"S",
"parameters":[
"x2",
"x1"
]
},
{
"operation":"",
"action":"S",
"parameters":[
"x1",
"x3"
]
},
{
"operation":"not",
"action":"R",
"parameters":[
"x3",
"x1"
]
}
]
},
{
"action":"op2",
"parameters":[
"x1",
"x2",
"x3"
],
"precondition":[
{
"operation":"and",
"action":"S",
"parameters":[
"x3",
"x1"
]
},
{
"operation":"",
"action":"R",
"parameters":[
"x2",
"x2"
]
}
],
"effect":[
{
"operation":"and",
"action":"S",
"parameters":[
"x1",
"x3"
]
},
{
"operation":"not",
"action":"S",
"parameters":[
"x3",
"x1"
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment