Towards a New Planning Domain Definition Language #28
AdamSobieski
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
Hello @AdamSobieski, very interesting, if daunting. I have got some questions for you below:
What would be very valuable at this stage is to see a simple PPI (like the instance 4-1 from the classic Blocks World IPC domain) implemented with this language. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a sketch of a new language for planning domains, problems, and solutions. This language is inspired by logic programming and by C, C++, C#, Java, and JavaScript. This language is not intended to be compiled but, instead, to be transpiled to a Semantic Web destination format, e.g., TriG.
By transpiling to a Semantic Web destination format, other new languages, e.g., one inspired by Python, can be similarly explored and created, transpiling to the same destination format, utilizing the same ontologies. In this way, multiple new planning domain definition languages can come to exist, alongside one another, solvers and planning algorithms consuming data from the destination format.
Defining Planning Domains
Predicates
This language supports first-class predicates and expressions.
Rules
This language supports first-class rules.
A logical equivalence rule could resemble:
A first kind of logical implication rule could resemble:
A second kind of logical implication rule could utilize a SPARQL-based language-integrated
query { ... }
construct:A third kind of logical implication rule could utilize SHACL-based shape constraints:
A fourth kind of logical implication rule could utilize JavaScript:
Sets
This language supports first-class sets.
Knowledgebases
This language supports first-class knowledgebases, rules-enhanced collections of expressions.
Queries
This language supports first-class queries. Queries could be utilized in some kinds of rules and could also be utilized as reusable language constructs outside of rules. Queries will support working with multiple local and remote knowledgebases. Queries will be nestable.
Language-integrated querying will probably be based on SPARQL/SPARUL and transpile using SPIN.
Operators
This language supports first-class operators.
Properties can be defined to exist on actions, instantiated operators, and accessor implementations can be provided, e.g., using JavaScript.
Classes
This language supports first-class classes or type definitions.
Properties
This language might support first-class properties which extend binary predicates.
or
Attributes
This language supports first-class attributes. Attribute definitions can augment or modify the transpilation output for attributed or decorated language constructs.
It remains to be determined whether the contents of constructs (e.g., sections, expressions, or rules) can be decorated, in particular if they are to be reified during transpilation.
In the following example, the attributes
[world]
,[output]
, and[target]
decorate the<>
parameters so that they can, when omitted, be automatically bound to the correct arguments.Templates
This language supports first-class templates. Each language construct can be contained in a template. Templates can be nested.
Example JavaScript for accessing and utilizing the above content to create an action instance might resemble:
Due to the expressiveness provided by first-class templates, both generic programming and dependent types are relevant.
Scripting
This language supports scripting, e.g., with JavaScript.
Notes
URI Mappings
Using the attribute/decorator system described above, a goal is that this language can express mappings to and from existing Semantic Web schemas and ontologies, e.g.,
[uri(<...>)]
. One possiblity, in these regards, is simply utilizingowl:sameAs
.There are multiple methodologies for obtaining URIs for language constructs. These will be useful for scenarios including transpiling expressions like:
type(?x, example_template<123>.Widget)
.And/or Scope Brackets
Nestable and/or brackets, e.g.,
and { ... }
,or { ... }
, andand { ... or { ... } ... }
, could be language features.Parameterization
Can utilize the
<>
brackets on arbitrary language constructs, e.g., rules, for declaring parameters. Each construct, then, should also be able to have apreconditions
section for declaring constraints on these parameters.Utilizing an attribute-based parameter modification system, e.g.,
[world]
, for describing explicit world parameters, as shown throughout the examples. These special attributes modify<>
parameters so that they can, when omitted, be automatically bound to the correct arguments. Examples of these special attributes include:[world]
,[self]
,[element]
,[this]
,[target]
,[output]
,[domain]
,[range]
,[solver]
, and[state]
.Decorators, Scopes, Binding, and Rules
It is noteworthy that, by utilizing binding-related decorators on the example rule definition, we can safely omit the
<>
arguments when utilizing rules in the set definition context:For reduced typing,
[world]
could be defined as having those semantics of[auto][world][bind(*, system.world)]
.Interestingly, could utilize first-class resuable rules in binding-related metadata.
Templated Strings and URIs
A desired feature is to be able to utilize templated strings,
$"..."
, and templated URIs,$<...>
.Object-oriented Logic Programming
Logtalk is a useful reference material with respect to object-oriented logic programming.
Inheritance
There should be support for inheritance scenarios for at least the language constructs of
class
andproperty
.Modularity
This language will support multi-file modularity, the project structures of modern integrated development environments, and interoperation with Web-based resources. Digitally-signed compressed archives, e.g., OCF, could be of use for bundling modular planning domains and resources together.
Reification
A predicate can be described as a function which accepts as input a sequence of arguments (which meet preconditions) and outputs an element of a predicate-specific set of expressions. Each predicate-specific set of expressions is a subset of the set of all expressions. The set of all expressions could be related to the set
rdf:Statement
.The indicated approach allows for a strongly typed, preconditions capable, predicate calculus model which supports reification and nestable expressions, e.g.,
foo(thing_1, thing_2, baz(thing_3))
.Forms of Rules
Utilizing a special builtin unary predicate, e.g.,
isvalid(?plan)
,isvalid(?self)
, orisvalid(?this)
, rules could be utilized for defining class invariants, plan preferences, and plan constraints.It appears that there are forms of rules. As just mentioned, one form of rule uses
holds(?world, { isvalid(?x); });
and another form of rule usesholds(?world, { contains(?set, ?element); });
. Might these special forms of rules inherit from or extend a base form ofrule
resembling howproperty
could inherit from or extendpredicate
?Metalanguage and Metaprogramming
This language should provide the expressiveness for developers to be able to define new language constructs utilizing metalanguage and metaprogramming.
The
property
construct, for instance, resembles a binarypredicate
and adds the contextual keywords of?domain
and?range
. Similarly, the constructclass
could be defined by extendingset
.This language intends to provide developers with metalanguage and metaprogramming features while simultaneously providing expressiveness for specifying transpilation outputs for new constructs. This could be accomplished by means of using attributes and decorators.
For most scenarios pertaining to the modeling of planning domains, problems, and solutions, developers could access and utilize those language constructs, described above, by means of typing
using system;
. For more advanced scenarios, developers could, instead or in addition, use metalanguage and metaprogramming capabilities to define their own first-class language constructs.Sets, Concepts, and Categories
First-class sets could contain sections with which to define their indicator functions, membership functions, intensional definitions, or semantic descriptions.
Complex sets', concepts', or categories' definitions could, for instance, involve the utilization of one or more local or remote knowledgebases and, thus, the processing and combination of multiple implication-based, query-based, or scripting-based rules.
There are also to consider the computer-lexical definitions of abstract concepts and of concepts which might vary contextually. Concepts, sets, and categories can be considered with definitions involving systems' or intelligent agents' contexts, states, beliefs, desires, or intentions as arguments.
Modeling and Reasoning about Plans
Plans can be more than sequences of actions, they can resemble workflow or business process diagrams, containing, for instance, control flow constructs.
A plan ontology could enable more complex preferences and constraints to be be defined utilizing rules and queries.
Machine Ethics
Machine ethics is a part of the ethics of artificial intelligence concerned with adding or ensuring moral behaviors of man-made machines that use artificial intelligence, otherwise known as artificial intelligent agents. The capability for intelligent agents to reason about plans, stories, and other descriptions of activities and behavior, and abstractions thereof, could be useful for approaches to machine ethics.
Natural-language Processing
Natural-language processing scenarios will be supported by this language.
Natural-language Generation
Natural-language generation scenarios will be supported by this language.
In a simplification, planners could be provided with an input knowledgebase for contents to be said and an output knowledgebase, initially empty, for contents already said. The goal state, in this simplification, could be described as having an empty to-be-said knowledgebase and a filled already-said knowledgebase. The planning domain would include a large set of operators which produce natural language while moving contents from the one knowledgebase to the other.
More advanced models and approaches might include additional knowledgebases for: context-related data, models of the speaker, models of the intended audience, and stylistic and sentiment-related hints with which to vary the natural-language output. These hints pertaining to how to say portions of content could also be placed alongside those contents to be said.
Language-design topics include ensuring the capability for developers to create multi-stage pipelines which migrate contents through a series of intermediate representations en route to natural-language output. Per the macro-planning (a.k.a. document planning) and micro-planning stages of natural-language generation, contents to be said might, initially, be stored in one large set, one large knowledgebase, and, subsequently, stored in a sequence of sets, each then smaller set representing the contents of a to-be-said section, paragraph, or sentence. Contents to be said could also be subsequently formulated into a hierarchical document outline, with each section and subsection potentially adorned with metadata such as intentions, objectives, or questions to be answered in generated text.
Language-design topics also include ensuring the capability for developers to create anytime algorithms for story and natural-language generation. Anytime algorithms are algorithms which produce initial solutions and which are expected to produce increasingly better solutions when provided with more computing time. In writing, the process of working with existing solutions and improving upon them is called revision.
Story Generation
Story generation scenarios will be supported by this language.
Story generation, abstractly, can be described as containing three stages or components: fabula generation (determining what happens in a story), syuzhet generation (determining how the story is told), and text rendering (generating the natural language).
External Components for Metrics, Scoring, and Evaluation
This language will support solvers' utilization of external components for the multicriteria evaluation of potential plans and outputs, in particular natural-language and story outputs.
Debugging and Tracing
The transpiling process and related ontologies should support the capability of attaching references to selections of source code files to transpiler output.
Ontologies for debugging, provenance, tracing, event logs, narrative, and process mining could be useful for supporting software development and debugging scenarios. These technologies under discussion could be additionally useful for training developers who are new to projects, providing them with interactive means of learning about projects' codebases, models, domains, data, and functionalities.
When automated planning solvers are utilized to produce outputs, e.g., natural-language generation and story generation, developers could be provided with means of navigating from selections of output content to relevant explanations of computational processes and to relevant highlighted selections of source code, models, domains, and data. Towards enabling these scenarios, natural-language and story outputs could be hypertext documents instead of text strings.
Other Features
Other features could result from brainstorming with syntactic options including:
${...}
,%{...}
,@{...}
,{{...}}
, and{(...)}
. For example,%{...}
could be utilized to indicate a scope for probabilistic language constructs and content.Beta Was this translation helpful? Give feedback.
All reactions