#include "PLN.h"#include "rules/Rules.h"#include "rules/RuleProvider.h"#include "AtomSpaceWrapper.h"#include "BackInferenceTreeNode.h"#include "PLNShell.h"#include "ForwardChainer.h"#include <opencog/util/Logger.h>#include <opencog/adaptors/tulip/TulipWriter.h>#include <boost/foreach.hpp>#include <stdlib.h>#include <time.h>

Go to the source code of this file.
Namespaces | |
| namespace | haxx |
| namespace | opencog |
| namespace | opencog::pln |
| namespace | test |
Classes | |
| struct | min_conf |
| struct | inhlink |
| struct | compareStrength |
| Used by forward chainer. More... | |
Defines | |
| #define | BackInferenceTreeRootT BITNodeRoot |
Functions | |
| void | PLNShell_RunLoop (int argc, char **args) |
| int | main (int argc, char **args) |
| PLNShell is intended to be used with PseudoCore. Main run loop is here. | |
| void | PLNhelp () |
| void | save_log () |
| void | initTests () |
| string | printTV (Handle h) |
| void | printOutgoing (Handle out) |
| void | fw_beta (void) |
Variables | |
| int | currentDebugLevel |
| debug level, | |
| multimap< Handle, Handle > | haxx::childOf |
| bool | haxx::AllowFW_VARIABLENODESinCore |
| bool | haxx::ArchiveTheorems |
| bool | haxx::printRealAtoms |
| opencog::pln::iAtomSpaceWrapper * | haxx::defaultAtomSpaceWrapper |
| bool | opencog::pln::RECORD_TRAILS |
| int | opencog::pln::addlinks = 0 |
| int | opencog::pln::gethandles = 0 |
| FILE * | test::logfile |
| int | test::_test_count = 0 |
| bool | test::debugger_control = false |
| map< int, Btr< vtree > > | tests |
| #define BackInferenceTreeRootT BITNodeRoot |
GENERAL PLN SOURCE CODE NOTES:
Bad Performance:
NOTE:
Once I substitute A<tv2> for X, I get Implies<tv1> And<tv3> F A<tv2> A<tv2>.
But in order to find out tv3, I must also FindTV of And F A<tv2>.
NOTE 5: On Unification 0. A "simple MP" = an atom A that is not a MP, but will implicitly be considered as the complex MP "EqualTo(A)". Also an MP atom whose outgoing set contains no variables is considered a simple one, since it can no longer be used as a "real" MP. 1. While BW-chaining, the proof of formulas that are simple MPs but contain variables is never attempted. 2. The Unifier rule produces, for the desired output, the non-redundant set of all possible combinations of static and variable structures that would, upon unification, produce the output. All these structures will be simple MPs. 3. No "actual" unification will take place - the results of the inverted Unifier rule will be looked for, and if they aren't found, the proof path is cut. 4. When a query is made for a MP, it is first considered a simple MP and then a complex one. Ie. first we query the atom table for whether the exact atom designated by the MP exists, and if it doesn't, then we try to actually "run" the MP (in case it has a complex aspect, too), ie. seek atoms that fulfill the MP.
Definition at line 129 of file PLNShell.cc.
| void fw_beta | ( | void | ) |
Definition at line 733 of file PLNShell.cc.
References opencog::pln::AtomSpaceWrapper::addLink(), opencog::pln::AtomSpaceWrapper::addLinkDC(), opencog::pln::AtomSpaceWrapper::addNode(), opencog::pln::AtomSpaceWrapper::fakeToRealHandle(), opencog::pln::ForwardChainer::fwdChainStack(), GET_ASW, opencog::pln::AtomSpaceWrapper::getHandleSet(), opencog::pln::AtomSpaceWrapper::loadAxioms(), NULL_VERSION_HANDLE, opencog::pln::ForwardChainer::probGlobal, opencog::pln::ForwardChainer::probStack, opencog::pln::AtomSpaceWrapper::removeAtom(), opencog::pln::AtomSpaceWrapper::reset(), opencog::pln::ForwardChainer::seedStack, v, and opencog::TulipWriter::write().
| void initTests | ( | ) |
| int main | ( | int | argc, | |
| char ** | args | |||
| ) |
PLNShell is intended to be used with PseudoCore. Main run loop is here.
Definition at line 196 of file PLNShell.cc.
References PLNShell_RunLoop().
| void PLNhelp | ( | ) |
StrictCrispUnification is currently buggy and cannot be used! Anyway, if you use it, bool PREVENT_LOOPS = false must hold! CrispUnification may be ok, but does not cover all cases!
WHen using exhaustive inference tree expansion, there may arise pathological Rule combinations. Known examples are:
Definition at line 1114 of file PLNShell.cc.
| void PLNShell_RunLoop | ( | int | argc, | |
| char ** | args | |||
| ) |
Definition at line 202 of file PLNShell.cc.
References haxx::ArchiveTheorems, opencog::cogserver(), currentDebugLevel, opencog::Logger::debug(), haxx::defaultAtomSpaceWrapper, opencog::Logger::error(), GET_ASW, opencog::pln::AtomSpaceWrapper::loadAxioms(), LOG, opencog::logger(), haxx::printRealAtoms, opencog::pln::RECORD_TRAILS, opencog::server(), and ThePLNShell.

| void printOutgoing | ( | Handle | out | ) |
Definition at line 699 of file PLNShell.cc.
References GET_ASW, opencog::pln::AtomSpaceWrapper::getName(), opencog::pln::AtomSpaceWrapper::getOutgoing(), opencog::pln::AtomSpaceWrapper::getType(), and printTV().
| string printTV | ( | Handle | h | ) |
Definition at line 687 of file PLNShell.cc.
References GET_ASW, opencog::TruthValue::getCount(), opencog::TruthValue::getMean(), opencog::pln::AtomSpaceWrapper::getTV(), and opencog::TruthValue::isNullTv().

| void save_log | ( | ) |
Definition at line 319 of file PLNShell.cc.
1.5.6