From e7c4c5ba498c001302230faed719fbea2439b093 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Sun, 3 Jun 2018 12:27:42 -0700 Subject: [PATCH] misc/aqe: thinking about inference --- NOTES.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 +++ 2 files changed, 64 insertions(+) create mode 100644 NOTES.txt diff --git a/NOTES.txt b/NOTES.txt new file mode 100644 index 0000000..c749a6e --- /dev/null +++ b/NOTES.txt @@ -0,0 +1,61 @@ +Inference example: + +Given +airport_kb = kb.from_facts([ + ('is', 'N29EO', 'Plane'), + ('at', 'N29EO', 'dia'), + ('is', 'N10IV', 'Plane'), + ('at', 'N10IV', 'oak'), + ('is', 'N33FR', 'Plane'), + ('at', 'N33FR', 'lga'), + ('is', 'dia', 'Airport'), + ('is', 'lga', 'Airport'), + ('is', 'oak', 'Airport'), +]) + +fly = actions.Action( + [('is', '?subject', 'Plane'), ('is', '?object', 'Airport')], + [('at', '?subject', '?object'),], + [('at', '?subject', '?current'),], + [('at', '?subject', '?object')]) + +Should be able to do something like: +> infer(airport_kb, [fly], ('at', 'N10IV', 'lga')) +('fly', 'N10IV', 'lga') + + +------------------------------------------------------------------------------ + +Inference search example: + +airport_kb = [ + ('is', 'N29EO', 'Plane'), + ('at', 'N29EO', 'dia'), + ('is', 'N10IV', 'Plane'), + ('at', 'N10IV', 'oak'), + ('is', 'N33FR', 'Plane'), + ('at', 'N33FR', 'lga'), + ('is', '1Z12345E0205271688', 'Package'), + ('at', '1Z12345E0205271688', 'dia'), + ('is', '1Z12345E6605272234', 'Package'), + ('at', '1Z12345E6605272234', 'dia'), + ('is', '1Z12345E0305271640', 'Package'), + ('at', '1Z12345E0305271640', 'oak'), + ('is', '1Z12345E1305277940', 'Package'), + ('at', '1Z12345E1305277940', 'lga'), + ('is', '1Z12345E6205277936', 'Package'), + ('at', '1Z12345E6205277936', 'lga'), + ('is', 'dia', 'Airport'), + ('is', 'lga', 'Airport'), + ('is', 'oak', 'Airport'), +] + +fly = actions.Action( + [('is', '?subject', 'Plane'), ('is', '?object', 'Airport')], + [('at', '?subject', '?object'),], + [('at', '?subject', '?current'),], + [('at', '?subject', '?object')]) + +Trying to define load which requires that both package and airplane are +at the same place: how can this be expressed? + diff --git a/README.md b/README.md index 438c17b..e6a3eae 100644 --- a/README.md +++ b/README.md @@ -38,4 +38,7 @@ There are a few key points: ### TODO ++ Inference: given a list of actions, how to go from one state to + another. The first step would be single-step, then integrating + a search into the inference. + Rewrite in C++?