23 #include <opencog/atomspace/atom_types.h>
29 using namespace opencog;
45 throw InvalidParamException(TRACE_INFO,
"Expecting a PlusLink");
63 throw InvalidParamException(TRACE_INFO,
"Expecting a PlusLink");
72 throw InvalidParamException(TRACE_INFO,
"Expecting a PlusLink");
94 return nnn->get_value();
102 if (NUMBER_NODE == fi->
getType() and
122 if (fj->
getType() == TIMES_LINK)
129 Handle exx = jlp->getOutgoingAtom(0);
140 else if (fi->
getType() == TIMES_LINK and
141 ilp->getOutgoingAtom(0) == exx)
143 const HandleSeq& ilpo = ilp->getOutgoingSet();
144 size_t ilpsz = ilpo.size();
145 for (
size_t k=1; k<ilpsz; k++)
146 rest.push_back(ilpo[k]);
152 const HandleSeq& jlpo = jlp->getOutgoingSet();
153 size_t jlpsz = jlpo.size();
154 for (
size_t k=1; k<jlpsz; k++)
155 rest.push_back(jlpo[k]);
165 Handle a_plus(ap->reduce());
AtomSpace * getAtomSpace(void)
std::vector< Handle > HandleSeq
a list of handles
std::shared_ptr< TruthValue > TruthValuePtr
std::shared_ptr< AttentionValue > AttentionValuePtr
virtual double konsd(double, double) const
std::shared_ptr< Link > LinkPtr
ClassServer & classserver(ClassServerFactory *=ClassServer::createInstance)
static NodePtr NodeCast(const Handle &h)
std::shared_ptr< NumberNode > NumberNodePtr
static double get_double(const Handle &h)
static PlusLinkPtr PlusLinkCast(const Handle &h)
virtual Handle reorder(void)
static LinkPtr LinkCast(const Handle &h)
static NumberNodePtr NumberNodeCast(const Handle &h)
PlusLink(Type, const HandleSeq &oset, TruthValuePtr tv=TruthValue::NULL_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
std::shared_ptr< PlusLink > PlusLinkPtr
virtual Handle kons(const Handle &, const Handle &)
unsigned short Type
type of Atoms, represented as short integer (16 bits)
Handle add_atom(AtomPtr atom, bool async=false)