OpenCog Framework
Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
|
#include <SchemeSmob.h>
Static Public Member Functions | |
static void | init () |
static AtomSpace * | ss_get_env_as (const char *) |
static SCM | handle_to_scm (Handle) |
static Handle | scm_to_handle (SCM) |
static std::string | to_string (Handle) |
static std::string | as_to_string (const AtomSpace *) |
static std::string | av_to_string (const AttentionValue *) |
static std::string | tv_to_string (const TruthValue *) |
Private Types | |
enum | { COG_UUID = 1, COG_HANDLE, COG_TV, COG_AV, COG_AS, COG_EXTEND } |
Private Member Functions | |
SchemeSmob () | |
Static Private Member Functions | |
static void | register_procs (void *) |
static void | register_proc (const char *, int, int, int, scm_t_subr) |
static void | init_smob_type (void) |
static int | print_misc (SCM, SCM, scm_print_state *) |
static SCM | equalp_misc (SCM, SCM) |
static SCM | mark_misc (SCM) |
static size_t | free_misc (SCM) |
static SCM | ss_new_node (SCM, SCM, SCM) |
static SCM | ss_new_link (SCM, SCM) |
static SCM | ss_node (SCM, SCM, SCM) |
static SCM | ss_link (SCM, SCM) |
static SCM | ss_delete (SCM, SCM) |
static SCM | ss_delete_recursive (SCM, SCM) |
static SCM | ss_purge (SCM, SCM) |
static SCM | ss_purge_recursive (SCM, SCM) |
static SCM | ss_atom_p (SCM) |
static SCM | ss_node_p (SCM) |
static SCM | ss_link_p (SCM) |
static SCM | ss_atom (SCM) |
static SCM | ss_handle (SCM) |
static SCM | ss_undefined_handle (void) |
static SCM | ss_set_av (SCM, SCM) |
static SCM | ss_set_tv (SCM, SCM) |
static SCM | ss_inc_vlti (SCM) |
static SCM | ss_dec_vlti (SCM) |
static SCM | ss_name (SCM) |
static SCM | ss_type (SCM) |
static SCM | ss_arity (SCM) |
static SCM | ss_av (SCM) |
static SCM | ss_tv (SCM) |
static SCM | ss_incoming_set (SCM) |
static SCM | ss_outgoing_set (SCM) |
static SCM | ss_map_type (SCM, SCM) |
static SCM | ss_get_types (void) |
static SCM | ss_get_type (SCM) |
static SCM | ss_type_p (SCM) |
static SCM | ss_node_type_p (SCM) |
static SCM | ss_link_type_p (SCM) |
static SCM | ss_get_subtypes (SCM) |
static SCM | ss_subtype_p (SCM, SCM) |
static SCM | ss_new_stv (SCM, SCM) |
static SCM | ss_new_ctv (SCM, SCM, SCM) |
static SCM | ss_new_itv (SCM, SCM, SCM) |
static SCM | ss_new_ptv (SCM, SCM, SCM) |
static SCM | ss_new_ftv (SCM, SCM) |
static SCM | ss_tv_p (SCM) |
static SCM | tv_p (SCM, TruthValueType) |
static SCM | ss_stv_p (SCM) |
static SCM | ss_ctv_p (SCM) |
static SCM | ss_itv_p (SCM) |
static SCM | ss_ptv_p (SCM) |
static SCM | ss_ftv_p (SCM) |
static SCM | take_tv (TruthValue *) |
static SCM | tv_to_scm (TruthValuePtr) |
static SCM | ss_tv_get_value (SCM) |
static SCM | ss_new_as (SCM) |
static SCM | ss_as_p (SCM) |
static SCM | ss_get_as (void) |
static SCM | ss_set_as (SCM) |
static SCM | take_as (AtomSpace *) |
static SCM | make_as (AtomSpace *) |
static AtomSpace * | ss_to_atomspace (SCM) |
static void | as_ref_count (SCM, AtomSpace *) |
static SCM | ss_new_av (SCM, SCM, SCM) |
static SCM | ss_av_p (SCM) |
static SCM | take_av (AttentionValue *) |
static SCM | ss_av_get_value (SCM) |
static SCM | ss_af_boundary (void) |
static SCM | ss_set_af_boundary (SCM) |
static SCM | ss_af (void) |
static SCM | ss_ad_hoc (SCM, SCM) |
static std::string | to_string (SCM) |
static TruthValuePtr | to_tv (SCM) |
static std::string | handle_to_string (SCM) |
static std::string | handle_to_string (Handle, int) |
static std::string | misc_to_string (SCM) |
static TruthValue * | get_tv_from_list (SCM) |
static AttentionValue * | get_av_from_list (SCM) |
static AtomSpace * | get_as_from_list (SCM) |
static void | throw_exception (const char *, const char *) |
static Type | verify_atom_type (SCM, const char *, int pos=1) |
static Handle | verify_handle (SCM, const char *, int pos=1) |
static TruthValue * | verify_tv (SCM, const char *, int pos=1) |
static AttentionValue * | verify_av (SCM, const char *, int pos=1) |
static std::vector< Handle > | verify_handle_list (SCM, const char *, int pos=1) |
static std::string | verify_string (SCM, const char *, int pos=1, const char *msg="expecting string") |
static int | verify_int (SCM, const char *, int pos=1, const char *msg="expecting integer") |
static void | ss_set_env_as (AtomSpace *) |
Static Private Attributes | |
static std::atomic_flag | is_inited = ATOMIC_FLAG_INIT |
static scm_t_bits | cog_misc_tag |
static SCM | _radix_ten |
static std::mutex | as_mtx |
static std::map< AtomSpace *, int > | deleteable_as |
static SCM | atomspace_fluid |
Friends | |
class | SchemeEval |
class | PrimitiveEnviron |
template<typename TT > | |
class | SchemePrimitive |
Definition at line 36 of file SchemeSmob.h.
|
private |
Enumerator | |
---|---|
COG_UUID | |
COG_HANDLE | |
COG_TV | |
COG_AV | |
COG_AS | |
COG_EXTEND |
Definition at line 44 of file SchemeSmob.h.
|
private |
Definition at line 56 of file SchemeSmob.cc.
References init().
|
staticprivate |
The current atomspace for the current thread must not be deleted under any circumstances. Thus each thread increments a use-count on the atomspace (stored in deleteable_as). Atomspaces that are not current in any thread, and also have no SCM mobs pointing at them may be deleted by the gc. This will cause atoms to disappear, if the user is not careful ...
Oh, wait: only atomspaces that were interanlly created (i.e. created by a scheme call) are eligible for deletion. We may also be given atomspaces that magically appeared from the outside world — we do NOT track those for deletion.
Definition at line 139 of file SchemeSmobAS.cc.
References as_mtx, deleteable_as, and ss_to_atomspace().
|
static |
Definition at line 30 of file SchemeSmobAS.cc.
References BUFLEN.
|
static |
Definition at line 50 of file SchemeSmobAV.cc.
References BUFLEN, opencog::AttentionValue::getLTI(), opencog::AttentionValue::getSTI(), and opencog::AttentionValue::getVLTI().
|
staticprivate |
Definition at line 80 of file SchemeSmob.cc.
References av, COG_AS, COG_AV, COG_EXTEND, COG_HANDLE, cog_misc_tag, COG_TV, and scm_to_handle().
|
staticprivate |
Free the memory associated with an opencog guile object. This routine is called by the guile garbage collector, from time to time. For testing purposes, you can force the garbage collector to run by saying (gc), while, for stats, try (gc-stats) and (gc-live-object-stats). The later should show both "opencog-handle" and "opencog-misc" stats.
Definition at line 57 of file SchemeSmobGC.cc.
References as_mtx, av, COG_AS, COG_AV, COG_EXTEND, COG_HANDLE, COG_TV, deleteable_as, opencog::PrimitiveEnviron::get_size(), and tv.
|
staticprivate |
Search for an atomspace in a list of values. Return the atomspace if found, else return null. Throw errors if the list is not stictly just key-value pairs
Definition at line 205 of file SchemeSmobAS.cc.
References ss_to_atomspace().
|
staticprivate |
Search for an attention value in a list of values. Return the attention value if found, else return null. Throw errors if the list is not stictly just key-value pairs
Definition at line 25 of file SchemeSmobAV.cc.
References COG_AV, and cog_misc_tag.
|
staticprivate |
Search for a truth value in a list of values. Return the truth value if found, else return null. Throw errors if the list is not stictly just key-value pairs
Definition at line 103 of file SchemeSmobTV.cc.
References cog_misc_tag, and COG_TV.
|
static |
Wrapper – given a handle, return the corresponding scheme object. Note that smobs hold the integer value of the handle, and not the C++ handle object itself.
Definition at line 130 of file SchemeSmobNew.cc.
References COG_HANDLE, and cog_misc_tag.
|
staticprivate |
Definition at line 117 of file SchemeSmobNew.cc.
References scm_to_handle().
|
staticprivate |
Definition at line 50 of file SchemeSmobNew.cc.
References av, av_to_string(), opencog::classserver(), opencog::AttentionValue::DEFAULT_AV(), opencog::Atom::getAttentionValue(), opencog::Atom::getTruthValue(), opencog::Atom::getType(), opencog::ClassServer::getTypeName(), handle_to_string(), opencog::LinkCast(), opencog::NodeCast(), tv, tv_to_string(), and opencog::Handle::UNDEFINED.
|
static |
Definition at line 43 of file SchemeSmob.cc.
References _radix_ten, atomspace_fluid, init_smob_type(), is_inited, and register_procs().
|
staticprivate |
Definition at line 68 of file SchemeSmob.cc.
References cog_misc_tag, equalp_misc(), free_misc(), and print_misc().
|
staticprivate |
Create SCM object wrapping the atomspace. Do NOT take over memory management of it!
Definition at line 44 of file SchemeSmobAS.cc.
References COG_AS, and cog_misc_tag.
|
staticprivate |
Definition at line 20 of file SchemeSmobGC.cc.
References COG_AS, COG_AV, COG_EXTEND, COG_HANDLE, and COG_TV.
|
staticprivate |
Definition at line 125 of file SchemeSmobGC.cc.
References as_to_string(), av_to_string(), COG_AS, COG_AV, COG_EXTEND, COG_HANDLE, COG_TV, opencog::PrimitiveEnviron::get_name(), handle_to_string(), and tv_to_string().
|
staticprivate |
Definition at line 166 of file SchemeSmobGC.cc.
References misc_to_string().
|
staticprivate |
|
staticprivate |
Definition at line 187 of file SchemeSmob.cc.
References C, register_proc(), ss_af(), ss_af_boundary(), ss_arity(), ss_as_p(), ss_atom(), ss_atom_p(), ss_av(), ss_av_get_value(), ss_av_p(), ss_ctv_p(), ss_dec_vlti(), ss_delete(), ss_delete_recursive(), ss_ftv_p(), ss_get_as(), ss_get_subtypes(), ss_get_type(), ss_get_types(), ss_handle(), ss_inc_vlti(), ss_incoming_set(), ss_itv_p(), ss_link(), ss_link_p(), ss_link_type_p(), ss_map_type(), ss_name(), ss_new_as(), ss_new_av(), ss_new_ctv(), ss_new_ftv(), ss_new_itv(), ss_new_link(), ss_new_node(), ss_new_ptv(), ss_new_stv(), ss_node(), ss_node_p(), ss_node_type_p(), ss_outgoing_set(), ss_ptv_p(), ss_purge(), ss_purge_recursive(), ss_set_af_boundary(), ss_set_as(), ss_set_av(), ss_set_tv(), ss_stv_p(), ss_subtype_p(), ss_tv(), ss_tv_get_value(), ss_tv_p(), ss_type(), ss_type_p(), and ss_undefined_handle().
|
static |
Definition at line 144 of file SchemeSmobNew.cc.
References COG_HANDLE, cog_misc_tag, and opencog::Handle::UNDEFINED.
|
staticprivate |
Dispatcher to invoke various miscellaneous C++ riff-raff from scheme code.
Definition at line 22 of file SchemeAdHoc.cc.
References python.atom_type_names::atomspace, handle_to_scm(), verify_handle(), and verify_string().
|
staticprivate |
Return the list of atoms in the AttentionalFocus
Definition at line 61 of file SchemeSmobAF.cc.
References python.atom_type_names::atomspace, opencog::AtomSpace::get_handle_set_in_attentional_focus(), handle_to_scm(), and ss_get_env_as().
|
staticprivate |
Return AttentionalFocus Boundary
Definition at line 38 of file SchemeSmobAF.cc.
References python.atom_type_names::atomspace, opencog::AtomSpace::get_attentional_focus_boundary(), and ss_get_env_as().
|
staticprivate |
Definition at line 72 of file SchemeSmobAtom.cc.
References opencog::LinkCast(), and verify_handle().
|
staticprivate |
Return true if the scm is an atom space
Definition at line 84 of file SchemeSmobAS.cc.
References COG_AS, and cog_misc_tag.
|
staticprivate |
Create a new scheme object, holding the atom uuid
Definition at line 162 of file SchemeSmobNew.cc.
References handle_to_scm().
|
staticprivate |
Return true if s is an atom
Definition at line 197 of file SchemeSmobNew.cc.
References COG_HANDLE, and cog_misc_tag.
|
staticprivate |
Definition at line 102 of file SchemeSmobAtom.cc.
References opencog::Atom::getAttentionValue(), take_av(), and verify_handle().
|
staticprivate |
Return association list holding contents of an attention value
Definition at line 137 of file SchemeSmobAV.cc.
References av, opencog::AttentionValue::getLTI(), opencog::AttentionValue::getSTI(), opencog::AttentionValue::getVLTI(), and verify_av().
|
staticprivate |
Return true if the scm is an attention value
Definition at line 102 of file SchemeSmobAV.cc.
References COG_AV, and cog_misc_tag.
|
staticprivate |
Definition at line 326 of file SchemeSmobTV.cc.
References opencog::COUNT_TRUTH_VALUE, and tv_p().
|
staticprivate |
Definition at line 126 of file SchemeSmobAtom.cc.
References opencog::Atom::decVLTI(), and verify_handle().
|
staticprivate |
Delete the atom, but only if it has no incoming links. Return SCM_BOOL_T if the atom was deleted, else return SCM_BOOL_F This deletes the atom from both the atomspace, and any attached backing store; thus deletion is permanent!
Definition at line 513 of file SchemeSmobNew.cc.
References python.atom_type_names::atomspace, get_as_from_list(), opencog::Atom::getIncomingSetSize(), opencog::AtomSpace::remove_atom(), ss_get_env_as(), opencog::Handle::UNDEFINED, and verify_handle().
|
staticprivate |
Delete the atom, and everything pointing to it. This deletes the atom from both the atomspace, and any attached backing store; thus deletion is permanent!
Definition at line 547 of file SchemeSmobNew.cc.
References python.atom_type_names::atomspace, get_as_from_list(), opencog::AtomSpace::remove_atom(), ss_get_env_as(), opencog::Handle::UNDEFINED, and verify_handle().
|
staticprivate |
Definition at line 341 of file SchemeSmobTV.cc.
References opencog::FUZZY_TRUTH_VALUE, and tv_p().
|
staticprivate |
Definition at line 122 of file SchemeSmobAS.cc.
References atomspace_fluid.
|
static |
Definition at line 188 of file SchemeSmobAS.cc.
References atomspace_fluid, and ss_to_atomspace().
|
staticprivate |
Return a list of the subtypes of the indicated type
Definition at line 233 of file SchemeSmobAtom.cc.
References opencog::classserver(), opencog::ClassServer::getChildren(), opencog::ClassServer::getTypeName(), python.undocumented.blocksworld::t, and verify_atom_type().
|
staticprivate |
Return integer value corresponding to the string type name.
Definition at line 255 of file SchemeSmobAtom.cc.
References opencog::classserver(), opencog::ClassServer::getType(), and python.undocumented.blocksworld::t.
|
staticprivate |
Return a list of all of the atom types in the system.
Definition at line 213 of file SchemeSmobAtom.cc.
References opencog::classserver(), opencog::ClassServer::getNumberOfClasses(), opencog::ClassServer::getTypeName(), and python.undocumented.blocksworld::t.
|
staticprivate |
Return uuid of atom
Definition at line 176 of file SchemeSmobNew.cc.
References scm_to_handle(), opencog::Handle::UNDEFINED, and opencog::Handle::value().
|
staticprivate |
Definition at line 118 of file SchemeSmobAtom.cc.
References opencog::Atom::incVLTI(), and verify_handle().
|
staticprivate |
Convert the incoming set of an atom into a list; return the list.
Definition at line 162 of file SchemeSmobAtom.cc.
References opencog::Atom::getIncomingSet(), handle_to_scm(), and verify_handle().
|
staticprivate |
Definition at line 331 of file SchemeSmobTV.cc.
References opencog::INDEFINITE_TRUTH_VALUE, and tv_p().
|
staticprivate |
Return the indicated link, of named type stype, holding the indicated atom list, if it exists; else return nil if it does not exist.
Definition at line 479 of file SchemeSmobNew.cc.
References python.atom_type_names::atomspace, av, opencog::AttentionValue::clone(), opencog::TruthValue::clone(), get_as_from_list(), get_av_from_list(), opencog::AtomSpace::get_handle(), get_tv_from_list(), handle_to_scm(), ss_get_env_as(), python.undocumented.blocksworld::t, tv, opencog::Handle::UNDEFINED, verify_atom_type(), and verify_handle_list().
|
staticprivate |
Return true if s is a link
Definition at line 226 of file SchemeSmobNew.cc.
References opencog::LinkCast(), scm_to_handle(), and opencog::Handle::UNDEFINED.
|
staticprivate |
Return true if stype is a link type
Definition at line 328 of file SchemeSmobAtom.cc.
References opencog::classserver(), opencog::ClassServer::getType(), and python.undocumented.blocksworld::t.
|
staticprivate |
Apply proceedure proc to all atoms of type stype If the proceedure returns something other than #f, terminate the loop.
Definition at line 185 of file SchemeSmobAtom.cc.
References python.atom_type_names::atomspace, opencog::AtomSpace::get_handles_by_type(), handle_to_scm(), ss_get_env_as(), python.undocumented.blocksworld::t, and verify_atom_type().
|
staticprivate |
Return the string name of the atom
Definition at line 51 of file SchemeSmobAtom.cc.
References opencog::NodeCast(), and verify_handle().
|
staticprivate |
Create a new atom space. The parent argument might not be present – its optional.
Definition at line 69 of file SchemeSmobAS.cc.
References deleteable_as, ss_to_atomspace(), and take_as().
|
staticprivate |
Create a new attention value, with indicated sti/lti/vlti
Definition at line 80 of file SchemeSmobAV.cc.
|
staticprivate |
|
staticprivate |
Definition at line 276 of file SchemeSmobTV.cc.
References opencog::FuzzyTruthValue::confidenceToCount(), take_tv(), and tv.
|
staticprivate |
|
staticprivate |
Create a new link, of named type stype, holding the indicated atom list
Definition at line 437 of file SchemeSmobNew.cc.
References opencog::AtomSpace::add_link(), python.atom_type_names::atomspace, av, opencog::AttentionValue::clone(), opencog::TruthValue::clone(), get_as_from_list(), get_av_from_list(), get_tv_from_list(), handle_to_scm(), opencog::Atom::setAttentionValue(), opencog::Atom::setTruthValue(), ss_get_env_as(), python.undocumented.blocksworld::t, throw_exception(), tv, verify_atom_type(), and verify_handle_list().
|
staticprivate |
Create a new node, of named type stype, and string name sname
Definition at line 296 of file SchemeSmobNew.cc.
References _radix_ten, opencog::AtomSpace::add_node(), python.atom_type_names::atomspace, av, opencog::AttentionValue::clone(), opencog::TruthValue::clone(), get_as_from_list(), get_av_from_list(), get_tv_from_list(), handle_to_scm(), opencog::Atom::setAttentionValue(), opencog::Atom::setTruthValue(), ss_get_env_as(), python.undocumented.blocksworld::t, throw_exception(), tv, verify_atom_type(), and verify_string().
|
staticprivate |
|
staticprivate |
Create a new simple truth value, with indicated mean and confidence.
Definition at line 236 of file SchemeSmobTV.cc.
References opencog::SimpleTruthValue::confidenceToCount(), take_tv(), and tv.
|
staticprivate |
Return the indicated node, of named type stype, and string name sname if it exists; else return nil if it does not exist. If the node exists, and a truth value was specified, then change the truth value.
Definition at line 349 of file SchemeSmobNew.cc.
References python.atom_type_names::atomspace, av, opencog::AttentionValue::clone(), opencog::TruthValue::clone(), get_as_from_list(), get_av_from_list(), opencog::AtomSpace::get_handle(), get_tv_from_list(), handle_to_scm(), ss_get_env_as(), python.undocumented.blocksworld::t, tv, opencog::Handle::UNDEFINED, verify_atom_type(), and verify_string().
|
staticprivate |
Return true if s is a node
Definition at line 212 of file SchemeSmobNew.cc.
References opencog::NodeCast(), scm_to_handle(), and opencog::Handle::UNDEFINED.
|
staticprivate |
Return true if stype is a node type
Definition at line 301 of file SchemeSmobAtom.cc.
References opencog::classserver(), opencog::ClassServer::getType(), and python.undocumented.blocksworld::t.
|
staticprivate |
Convert the outgoing set of an atom into a list; return the list.
Definition at line 138 of file SchemeSmobAtom.cc.
References handle_to_scm(), opencog::LinkCast(), and verify_handle().
|
staticprivate |
Definition at line 336 of file SchemeSmobTV.cc.
References opencog::PROBABILISTIC_TRUTH_VALUE, and tv_p().
|
staticprivate |
Purge the atom from the atomspace, but only if it has no incoming links. Return SCM_BOOL_T if the atom was deleted, else return SCM_BOOL_F This does NOT remove the atom from any attached backing store, only from the atomspace.
Definition at line 571 of file SchemeSmobNew.cc.
References python.atom_type_names::atomspace, get_as_from_list(), opencog::Atom::getIncomingSetSize(), opencog::AtomSpace::purge_atom(), ss_get_env_as(), opencog::Handle::UNDEFINED, and verify_handle().
|
staticprivate |
Purge the atom, and everything pointing to it. This does NOT remove the atom from any attached backing store, only from the atomspace.
Definition at line 605 of file SchemeSmobNew.cc.
References python.atom_type_names::atomspace, get_as_from_list(), opencog::AtomSpace::purge_atom(), ss_get_env_as(), opencog::Handle::UNDEFINED, and verify_handle().
|
staticprivate |
Set AttentionalFocus Boundary
Definition at line 47 of file SchemeSmobAF.cc.
References python.atom_type_names::atomspace, opencog::AtomSpace::set_attentional_focus_boundary(), and ss_get_env_as().
|
staticprivate |
Set the current atomspace for this dynamic state. Return the previous atomspace.
Definition at line 157 of file SchemeSmobAS.cc.
References as_ref_count(), atomspace_fluid, COG_AS, cog_misc_tag, ss_get_as(), and ss_to_atomspace().
|
staticprivate |
Definition at line 109 of file SchemeSmobAtom.cc.
References av, opencog::AttentionValue::clone(), opencog::Atom::setAttentionValue(), verify_av(), and verify_handle().
|
staticprivate |
Set the atomspace into the top-level interaction environment Since its held in a fluid, it can have a different value in each thread, so that different threads can use different atomspaces, all at the same time.
Definition at line 181 of file SchemeSmobAS.cc.
References as_ref_count(), atomspace_fluid, make_as(), and ss_get_as().
|
staticprivate |
Definition at line 92 of file SchemeSmobAtom.cc.
References opencog::TruthValue::clone(), opencog::Atom::setTruthValue(), tv, verify_handle(), and verify_tv().
|
staticprivate |
Definition at line 321 of file SchemeSmobTV.cc.
References opencog::SIMPLE_TRUTH_VALUE, and tv_p().
|
staticprivate |
Return true if a subtype
Definition at line 355 of file SchemeSmobAtom.cc.
References opencog::classserver(), and opencog::ClassServer::getType().
|
staticprivate |
Definition at line 104 of file SchemeSmobAS.cc.
References COG_AS, and cog_misc_tag.
|
staticprivate |
Definition at line 84 of file SchemeSmobAtom.cc.
References opencog::Atom::getTruthValue(), take_tv(), tv, and verify_handle().
|
staticprivate |
Return association list holding contents of a truth value
Definition at line 364 of file SchemeSmobTV.cc.
References opencog::COUNT_TRUTH_VALUE, opencog::FUZZY_TRUTH_VALUE, opencog::ProbabilisticTruthValue::getConfidence(), opencog::CountTruthValue::getConfidence(), opencog::SimpleTruthValue::getConfidence(), opencog::FuzzyTruthValue::getConfidence(), opencog::IndefiniteTruthValue::getConfidence(), opencog::ProbabilisticTruthValue::getCount(), opencog::CountTruthValue::getCount(), opencog::FuzzyTruthValue::getCount(), opencog::SimpleTruthValue::getCount(), opencog::IndefiniteTruthValue::getL(), opencog::ProbabilisticTruthValue::getMean(), opencog::CountTruthValue::getMean(), opencog::FuzzyTruthValue::getMean(), opencog::SimpleTruthValue::getMean(), opencog::TruthValue::getType(), opencog::IndefiniteTruthValue::getU(), opencog::INDEFINITE_TRUTH_VALUE, opencog::PROBABILISTIC_TRUTH_VALUE, opencog::SIMPLE_TRUTH_VALUE, tv, and verify_tv().
|
staticprivate |
Return true if the scm is a truth value
Definition at line 290 of file SchemeSmobTV.cc.
References cog_misc_tag, and COG_TV.
|
staticprivate |
Definition at line 61 of file SchemeSmobAtom.cc.
References opencog::classserver(), opencog::Atom::getType(), opencog::ClassServer::getTypeName(), python.undocumented.blocksworld::t, and verify_handle().
|
staticprivate |
Return true if stype is an atom type
Definition at line 275 of file SchemeSmobAtom.cc.
References opencog::classserver(), opencog::ClassServer::getType(), and python.undocumented.blocksworld::t.
|
staticprivate |
Return Handle::UNDEFINED
Definition at line 189 of file SchemeSmobNew.cc.
References opencog::Handle::UNDEFINED.
|
staticprivate |
Take over memory management of an atom space
Definition at line 56 of file SchemeSmobAS.cc.
References make_as().
|
staticprivate |
Take over memory management of an attention value
Definition at line 65 of file SchemeSmobAV.cc.
References COG_AV, and cog_misc_tag.
|
staticprivate |
Take over memory management of a truth value
Definition at line 221 of file SchemeSmobTV.cc.
References cog_misc_tag, and COG_TV.
|
staticprivate |
|
staticprivate |
Return a string holding the scheme representation of an atom/truthvalue.
The input is assumed to be pointing at a Handle, a TruthValue, an AttentionValue or a UUID. Returned is a valid scheme expression that represents that Handle, etc.
Definition at line 30 of file SchemeSmobNew.cc.
References cog_misc_tag, and misc_to_string().
|
static |
Return a string holding the scheme representation of an atom.
The input handle is represented in terms of a valid scheme expression. Evaluating this expression should result in exactly the same atom being created.
Definition at line 45 of file SchemeSmobNew.cc.
References handle_to_string().
|
staticprivate |
Return a fresh copy of truth value.
Definition at line 198 of file SchemeSmobTV.cc.
References opencog::TruthValue::clone(), tv, and verify_tv().
|
inlinestaticprivate |
Return true if the scm is a truth value
Definition at line 310 of file SchemeSmobTV.cc.
References opencog::TruthValue::getType(), ss_tv_p(), and tv.
|
staticprivate |
Import a truth value
Definition at line 213 of file SchemeSmobTV.cc.
References take_tv().
|
static |
Definition at line 128 of file SchemeSmobTV.cc.
References BUFLEN, opencog::COUNT_TRUTH_VALUE, opencog::FUZZY_TRUTH_VALUE, opencog::CountTruthValue::getConfidence(), opencog::ProbabilisticTruthValue::getConfidence(), opencog::FuzzyTruthValue::getConfidence(), opencog::SimpleTruthValue::getConfidence(), opencog::IndefiniteTruthValue::getConfidenceLevel(), opencog::ProbabilisticTruthValue::getCount(), opencog::CountTruthValue::getCount(), opencog::IndefiniteTruthValue::getL(), opencog::ProbabilisticTruthValue::getMean(), opencog::CountTruthValue::getMean(), opencog::SimpleTruthValue::getMean(), opencog::FuzzyTruthValue::getMean(), opencog::TruthValue::getType(), opencog::IndefiniteTruthValue::getU(), opencog::INDEFINITE_TRUTH_VALUE, opencog::PROBABILISTIC_TRUTH_VALUE, opencog::SIMPLE_TRUTH_VALUE, and tv.
|
staticprivate |
Check that the argument is the string or symbol name of an atom, else throw errors. Return the atom type.
Definition at line 242 of file SchemeSmobNew.cc.
References opencog::classserver(), opencog::ClassServer::getType(), and python.undocumented.blocksworld::t.
|
staticprivate |
Definition at line 121 of file SchemeSmobAV.cc.
References av, COG_AV, and cog_misc_tag.
|
staticprivate |
Verify that SCM arg is an actual opencog Handle; returning Handle
This routine is meant for validating arguments passed into guile-wrapped C++ code.
This routine takes an SCM arg and a string subroutine name. It verifies that the arg is actually a handle (and not, for example, an int, string, etc.) If its not a handle, it throws an SCM error, using the subroutine name in the error message. (Such an error is caught by the shell, and printed as a stack trace at the shell prompt). If the arg is a handle, then the actual opencog handle is returned.
Definition at line 38 of file SchemeSmobAtom.cc.
References scm_to_handle(), and opencog::Handle::UNDEFINED.
|
staticprivate |
Convert argument into a list of handles.
Definition at line 384 of file SchemeSmobNew.cc.
References cog_misc_tag, scm_to_handle(), and opencog::Handle::UNDEFINED.
|
staticprivate |
Check that the argument is an int, else throw errors. Return the int.
Definition at line 284 of file SchemeSmobNew.cc.
|
staticprivate |
Check that the argument is a string, else throw errors. Return the string, in C.
Definition at line 268 of file SchemeSmobNew.cc.
|
staticprivate |
Definition at line 348 of file SchemeSmobTV.cc.
References cog_misc_tag, COG_TV, and tv.
|
friend |
Definition at line 39 of file SchemeSmob.h.
|
friend |
Definition at line 38 of file SchemeSmob.h.
|
friend |
Definition at line 40 of file SchemeSmob.h.
|
staticprivate |
Definition at line 81 of file SchemeSmob.h.
|
staticprivate |
Definition at line 140 of file SchemeSmob.h.
|
staticprivate |
Return current atomspace for this dynamic state.
Definition at line 181 of file SchemeSmob.h.
|
staticprivate |
Just one scheme smob type is used to implement the interface.
The cog_misc_tag is used to store all structures, such as atoms and truth values. It is assumed that these structures are all ephemeral (garbage-collected), including the Handles. Note that atoms in the atomspace have a concrete existence outside of the scheme shell. By contrast, truth values created by the scheme shell are garbage collected by the shell.
The type of the "misc" structure is stored in the flag bits; thus, handling is dispatched based on these flags.
XXX TODO: The cog_misc_tag should be replaced by a tag-per-class (i.e. we should have a separate tag for handles, tv's, etc.) This would simplify that code, and probably improve performance just a bit.
Definition at line 59 of file SchemeSmob.h.
|
staticprivate |
Definition at line 141 of file SchemeSmob.h.
|
staticprivate |
Definition at line 53 of file SchemeSmob.h.