Applied Category Theory Special Session
AMS Joint Mathematics Meeting 2025
Ph.D. in Computer Science
University of Maryland, College Park
January 8, 2025
Transfer plan from the source (left) to the target (right) planning domain
Humanoid robot
Arms
Bins
Mobile robot
Lift
Box
Problem: Designing planning problems and running planners is time-consuming.
(Alnazer and Georgievski 2023) (Ingrand and Ghallab 2017)
\[ \newcommand{\N}{\mathbb{N}} \newcommand{\R}{\mathbb{R}} \newcommand{\cat}[1]{\mathsf{#1}} \newcommand{\CAT}[1]{\mathsf{#1}} \newcommand{\Set}{\CAT{Set}} \DeclareMathOperator{\Path}{Path} \newcommand{\catSet}[1]{\cat{#1}\text{-}\Set} \DeclareMathOperator{\Ob}{Ob} \DeclareMathOperator{\Hom}{Hom} \]
Informal Definition: (Analogical Plan Transfer) Analogical plan transfer identifies structural similarities, or analogies, between planning domains and leverages these analogies to adapt plans from one domain to another. (Aguinaldo 2024)
Why analogies?
(Wilkins and DesJardins 2001) argued that an ideal planning system should mimic human behavior by using analogies to transfer solutions from one problem to another.
What are analogies?
According to (Gentner 1983), analogies:
Analogies can be mathematically formalized as functors
and analogical transfer as functorial data migrations.
Delta Data Migration
A delta data migration, \(\Delta_F: \catSet{C} \rightarrow \catSet{C^{\prime}}\), is defined by a functor \(F: \cat{C}^{\prime} \rightarrow \cat{C}\). Explicitly:
For a given object \(X\) in \(\catSet{C}\),
\(\Delta_F(X) = X \circ F\)
For a given morphism \(\alpha: X \rightarrow Y\) in \(\catSet{C}\), \(\Delta_F\) acts on \(\alpha\) to produce the following morphism in \(\catSet{C^{\prime}}\)—
\(\Delta_F(\alpha)_{c^{\prime}}: X(F(c^{\prime})) \rightarrow Y(F(c^{\prime}))\) for \(c^{\prime} \in \cat{C^{\prime}}\)
Quick view of Delta Data Migration
\(\Delta_F : \cat{C}^{\prime} \xrightarrow{F} \cat{C} \xrightarrow{X} \cat{Set}\)
Conjunctive Data Migration
A conjunctive data migration, \(\Delta_F: \catSet{C} \rightarrow \catSet{C^{\prime}}\), is defined by a functor \(F: \cat{C}^{\prime} \rightarrow \cat{Diag^{op}(C)}\). Explicitly:
For a given object \(X\) in \(\catSet{C}\),
\(\Delta_F(X) = F^\ast(X) \circ F\) where,
\(F^\ast(X): \cat{Diag^{op}(C)} \xrightarrow{\cat{Diag^{op}(X)}} \cat{\cat{Diag^{op}(Set)}} \xrightarrow{\mathrm{lim}} \cat{Set}\)
For a given morphism \(\alpha: X \rightarrow Y\) in \(\catSet{C}\), \(\Delta_F\) acts on \(\alpha\) to produce the following morphism in \(\catSet{C^{\prime}}\)—
\(\Delta_F(\alpha)_{c^{\prime}}: F^\ast(X)(c^{\prime}) \rightarrow F^\ast(Y)(c^{\prime})\) for \(c^{\prime} \in \cat{C}^{\prime}\)
Quick view of Conjunctive Data Migration
\(\Delta_F : \cat{C}^{\prime} \xrightarrow{F} \cat{Diag^{op}(C)} \xrightarrow{F^\ast(X)} \cat{Set}\)
PDDL1 does not have built-in support for domain comparison or domain ontology alignment. Therefore, a new planning language that supports these capabilities is a prerequisite for analogical plan transfer. (Aguinaldo 2024)
State Transition System Model for Planning
Definition: (\(\cat{C}\)-set, schema category) A \(\cat{C}\)-set is a functor from \(\cat{C} \rightarrow \cat{Set}\). \(\cat{C}\) is referred to as the schema category (i.e. ontology). \(\cat{Set}\) is a category whose objects are sets and whose morphisms are set function maps.
Example:
A \(\cat{C}\)-set, \(X\), that stores data about what boxes are on which surface.
The category of elements construction (Riehl 2016) makes \(X\) interoperable with RDF triple syntax (subject, predicate, object), facilitating its use in knowledge graphs (David I. Spivak and Kent 2012).
Definition: (\(\catSet{C}\)) The category \(\catSet{C}\) is a category whose objects are \(\cat{C}\)-set functors and whose morphisms are natural transformations.
A span in \(\catSet{C}\) is a diagram of shape (\(\bullet \leftarrow \bullet \rightarrow \bullet\)) in \(\catSet{C}\).
Actions are spans (\(\mathrm{Pre} \hookleftarrow \mathrm{Keep} \rightarrow \mathrm{Eff}\)) in \(\catSet{C}\)
Actions are applied to state \(X\) to produce state \(Y\) using Double-Pushout (DPO) Rewriting
\(\hookleftarrow\) is a monomorphism (e.g. injective function in \(\cat{Set}\)). \(\urcorner\) and \(\ulcorner\) is a pushout (e.g. quotiented disjoint union in \(\cat{Set}\)).
Existing state-space planning algorithms can be adapted to work with this planning representation.
Example: ForwardPlan()
executes depth-first search (DFS) to find a sequence of actions.
function ForwardPlan(world::ACSet, goal::ACSet, actions::Dict,
action_limits::Dict, action_usage::Dict,
plan::List)
# Exit criteria: goal is reached if there is a monic morphism from goal to world
if homomorphism(goal, world, monic=true) !== nothing
println("Goal reached.")
return plan
end
# Find applicable actions for the current world state
applicable = find_applicable_actions(world, actions)
# Backtrack criteria: no applicable actions
if length(applicable) <= 0
throw("No applicable actions found! Terminate path...")
end
# Iterate over all applicable actions
for action in applicable
action_name = action.first
match_morphism = action.second
# Backtrack criteria: action applied too many times
try
if action_usage[action_name] >= action_limits[action_name]
println("Abort path. Action used too many times.")
continue
end
catch
# Initialize action usage if it doesn't exist
action_usage[action_name] = 1
end
# Save current world state for backtracking
prev_world = world
selected_action = action[action_name].rule
# Apply the selected action to the current world state
try
world = rewrite(selected_action, world)
catch e
throw("Could not apply action!")
end
# Record the action and corresponding match morphism in the current plan
append!(plan, [selected_action => match_morphism])
try
# Recursively call ForwardPlan with updated world state
plan = ForwardPlan(world, goal, actions, action_limits,
action_usage, plan)
return plan
catch e
# Backtrack to previous world state if path fails
world = prev_world
pop!(plan)
println("Path failed. Try a different path.")
end
end
# If no valid plan is found, report failure
println("No plan found.")
end
High-level Steps in Analogical Plan Transfer
Kitchenworld ontology derived from AI2-Thor Object Type Documentation
(Allen Institute for Artificial Intelligence 2024)
Uses an ontology alignment map that is functorial
Kitchenworld simulation from AI2-Thor (Allen Institute for Artificial Intelligence 2024)
Advantages
Limitations
Scaling Studies: Empirical and Theoretical
A Software Tool for Category Theory-Based Planning and Transfer
Knowrob (Tenorth and Beetz 2017) and Factory of the Future (Schäfer et al. 2021) ontologies
Collaborators and Mentors
Funding
Category theory (Eilenberg and MacLane 1945) is often referred to as the “mathematics of mathematics”.
Connects different areas of mathematics by studying the relationships between structures.
Category theory has been applied in many domains outside mathematics1, and such works contribute to the field of Applied Category Theory (ACT).
Definition: (Category) A category, \(\cat{C}\), consists of:
satisfying the associativity law \(h \circ (g \circ f) = (h \circ g) \circ f\) and unitality laws \(f \circ 1_x = f\) and \(1_y \circ f = f\) whenever these equations make sense.
Functors map, e.g. \(\; F: \cat{P(\{1,2\})} \rightarrow \cat{\mathbb{N}_{\leq}}\):
Functors map, e.g. \(\; F: \cat{P(\{1,2\})} \rightarrow \cat{\mathbb{N}_{\leq}}\):
Natural transformations map functors, e.g. \(\alpha: F \rightarrow G\):
Angeline Aguinaldo - AMS JMM Applied Category Theory - January 8, 2025