<commit_before>;
; core-docs.scm
;
; Provide documentation for all the functions implemented in C++ code.
; These can be viewed the guile interpreter prompt by saying
;
;    guile> ,describe  FUNCTION-NAME
;
; A list of all of these is printed by saying
;
;    guile> ,apropos cog
;
(set-procedure-property! cog-new-node 'documentation
"
 cog-new-node NODE-TYPE NODE-NAME
    Create a new node of type NODE-TYPE and name NODE-NAME.

    Optionally, a truth value and/or an attention value can follow
    the node name.

    Throws errors if node-type is not a valid atom type for a node,
    and if node-name is not a string.

    Example:
        ; Create a new node, and prints its value:
        guile> (cog-new-node 'ConceptNode \"some node name\")
        (ConceptNode \"some node name\")

        ; Creates a new node, with a truth value:
        guile> (cog-new-node 'ConceptNode \"another node\"
                      (cog-new-stv 0.8 0.9))
        (ConceptNode \"another node\" (stv 0.8 0.9))
")

(set-procedure-property! cog-node 'documentation
"
 cog-node NODE-TYPE NODE-NAME
    Returns the node of type NODE-TYPE and name NODE-NAME, if it exists,
    else returns null.

    Optionally, a truth value and/or attention value can follow the
    node name. If the node exists, then the truth value and/or
    attention value is modified.

    Throws errors if node-type is not a valid atom type for a node,
    and if node-name is not a string.

    Example:
        ; Check to see if a node exists:
        guile> (cog-node 'ConceptNode \"asdf\")
        ()

        ; Verify that the return value is actually a true null:
        guile> (null? (cog-node 'ConceptNode \"asdf\"))
        #t

        ; Now, create the node, and see if it exists:
        guile> (cog-new-node 'ConceptNode \"asdf\")
        (ConceptNode \"asdf\")
        guile> (null? (cog-node 'ConceptNode \"asdf\"))
        #f

        ; Change the truth value of an existing node:
        guile> (cog-node 'ConceptNode \"asdf\" (cog-new-stv 0.8 0.9))
        (ConceptNode \"asdf\" (stv 0.8 0.9))
")

(set-procedure-property! cog-new-link 'documentation
"
 cog-new-link LINK-TYPE ATOM-1 ... ATOM-N
    Create a new link, of type LINK-TYPE, with the given atoms in the link.

    Optionally, a truth value or an attention value can be included
    in the list of atoms.

    Throws errors if the link type is not a valid opencog link type,
    or if any of the arguments after the link type are not atoms,
    truth values, attention values, or null.

    Example:
        ; Creates two nodes, and a new link:
        guile> (define x (cog-new-node 'ConceptNode \"abc\"))
        guile> (define y (cog-new-node 'ConceptNode \"def\"))
        guile> (cog-new-link 'Link x y)
        (Link
           (ConceptNode \"abc\")
           (ConceptNode \"def\")
        )

        ; Create a new link with a truth value:
        guile> (cog-new-link 'Link x y (cog-new-stv 0.7 0.8))
        (Link (stv 0.7 0.8)
           (ConceptNode \"abc\")
           (ConceptNode \"def\")
        )
")

(set-procedure-property! cog-link 'documentation
"
 cog-link LINK-TYPE ATOM-1 ... ATOM-N
    Returns the link of the given type LINK-TYPE and list of atoms,
    if it exists, else returns null.

    Optionally, a truth value or attention value can be included
    in the list of atoms. If the link exists, then the truth value
    and/or attention value is modified.

    Throws errors if the link type is not a valid opencog link type,
    or if any of the arguments after the link type are not atoms,
    truth values, attention values, or null.

    Example:
        ; Create two nodes:
        guile> (define x (cog-new-node 'ConceptNode \"abc\"))
        guile> (define y (cog-new-node 'ConceptNode \"def\"))

        ; Does a node with these two links exist?
        guile> (cog-link 'Link x y)
        ()

        ; Now, create such a link
        guile> (cog-new-link 'Link x y)
        (Link
           (ConceptNode \"abc\")
           (ConceptNode \"def\")
        )

        ; Check again for existence:
        guile> (cog-link 'Link x y)
        (Link
           (ConceptNode \"abc\")
           (ConceptNode \"def\")
        )

        ; Change the truth value of an existing node:
        guile> (cog-link 'Link x y (cog-new-stv 0.7 0.8))
        (Link (stv 0.7 0.8)
           (ConceptNode \"abc\")
           (ConceptNode \"def\")
        )
")

(set-procedure-property! cog-delete 'documentation
"
 cog-delete ATOM
    Remove the indicated ATOM from the AtomSpace, but only if it has no
    incoming links. If it has incoming links, the remove fails.  If SQL
    or other data storage is attached, the ATOM is also removed from
    the storage.

    Returns #t if the atom was removed, else returns #f if not removed.

    Use cog-extract to remove from the AtomSpace only, leaving storage
    unaffected.

    Use cog-delete-recursive to force removal of this atom, together
    with any links that might be holding this atom.

    Example:
       ; Define two nodes and a link between them:
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (define y (cog-new-node 'ConceptNode \"def\"))
       guile> (define l (cog-new-link 'Link x y))

       ; Verify that there's an atom called x:
       guile> x
       (ConceptNode \"abc\")

       ; Try to delete x. This should fail, since there's a link
       ; containing x.
       guile> (cog-delete x)
       #f

       ; Delete x, and everything pointing to it. This should delete
       ; both x, and the link l.
       guile> (cog-delete-recursive x)
       #t

       ; Verify that the link l is gone:
       guile> l
       Invalid handle

       ; Verify that the node x is gone:
       guile> x
       Invalid handle

       ; Verify that the node y still exists:
       guile> y
       (ConceptNode \"def\")
")

(set-procedure-property! cog-delete-recursive 'documentation
"
 cog-delete-recursive ATOM
    Remove the indicated ATOM from the AtomSpace, and all atoms that
    point at it.  If SQL or other data storage is attached, the ATOM is
    also removed from the storage.

    Return #t on success, else return #f if not removed.
")

(set-procedure-property! cog-extract 'documentation
"
 cog-extract ATOM
    Remove the indicated ATOM from the AtomSpace, but only if it has no
    incoming links. If it has incoming links, the remove fails.

    Returns #t if the atom was removed, else returns #f if not removed.

    This does NOT remove the atom from any attached storage (e.g. SQL
    storage).  Use cog-delete to remove from atoms from storage.

    Use cog-extract-recursive to force removal of this atom, together
    with any links that might be holding this atom.

    Example:
       ; Define two nodes and a link between them:
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (define y (cog-new-node 'ConceptNode \"def\"))
       guile> (define l (cog-new-link 'Link x y))

       ; Verify that there's an atom called x:
       guile> x
       (ConceptNode \"abc\")

       ; Try to extract x. This should fail, since there's a link
       ; containing x.
       guile> (cog-extract x)
       #f

       ; Delete x, and everything pointing to it. This should extract
       ; both x, and the link l.
       guile> (cog-extract-recursive x)
       #t

       ; Verify that the link l is gone:
       guile> l
       Invalid handle

       ; Verify that the node x is gone:
       guile> x
       Invalid handle

       ; Verify that the node y still exists:
       guile> y
       (ConceptNode \"def\")
")

(set-procedure-property! cog-extract-recursive 'documentation
"
 cog-extract-recursive ATOM
    Remove the indicated ATOM from the AtomSpace, and all atoms that
    point at it.  Return #t on success, else return #f if not removed.

    The atom is NOT removed from SQL or other attached data storage.
    If you need to delete from storage, use cog-delete and
    cog-delete-recursive.
")

(set-procedure-property! cog-atom? 'documentation
"
 cog-atom? EXP
    Return #t if EXP is an atom, else return #f

    Example:
       ; Define a node
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (define y (+ 2 2))
       guile> (cog-atom? x)
       #t
       guile> (cog-atom? y)
       #f
")

(set-procedure-property! cog-node? 'documentation
"
 cog-node? EXP
    Return #t if EXP is an node, else return #f

    See also cog-node, which will check to see if a specific node
    already exists.

    Example:
       ; Define a node and a link
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (define y (cog-new-link 'ListLink x))
       guile> (cog-node? x)
       #t
       guile> (cog-node? y)
       #f
")

(set-procedure-property! cog-link? 'documentation
"
 cog-link? EXP
    Return #t if EXP is an link, else return #f

    See also cog-link, which will check to see if a specific link
    already exists.

    Example:
       ; Define a node and a link
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (define y (cog-new-link 'ListLink x))
       guile> (cog-link? x)
       #f
       guile> (cog-link? y)
       #t
")

(set-procedure-property! cog-name 'documentation
"
 cog-name ATOM
    Return the name of the node ATOM. If the atom is not a node,
    returns null.

    Example:
       ; Define a node
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (cog-name x)
       \"abc\"
")

(set-procedure-property! cog-type 'documentation
"
 cog-type ATOM
    Return the type of ATOM.

    Example:
       ; Define a node
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (cog-type x)
       ConceptNode
       guile> (eq? 'ConceptNode (cog-type x))
       #t
")

(set-procedure-property! cog-arity 'documentation
"
 cog-arity ATOM
    Return the arity of ATOM.

    Example:
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (cog-arity x)
       0
       guile> (define l (cog-new-link 'Link x x x))
       guile> (cog-arity l)
       3
")

(set-procedure-property! cog-incoming-set 'documentation
"
 cog-incoming-set ATOM
    Return the incoming set of ATOM.  This set is returned as an
    ordinary scheme list.

    Example:
       ; Define two nodes and a link between them:
       guile> (define x (ConceptNode \"abc\"))
       guile> (define y (ConceptNode \"def\"))
       guile> (define l (Link x y))

       ; Get the incoming sets of nodes x and y (which is the link l):
       guile> (cog-incoming-set x)
       ((Link
          (ConceptNode \"abc\")
          (ConceptNode \"def\")
       )
       )

       guile> (cog-incoming-set y)
       ((Link
          (ConceptNode \"abc\")
          (ConceptNode \"def\")
       )
       )

       ; Verify that the both incoming sets are really one and the
       ; same link:
       guile> (equal? (cog-incoming-set x) (cog-incoming-set y))
       #t

       ; The returned values are lists, and not singleton atoms.
       ; Thus, the incoming set of x is a list containing l:
       guile> (equal? (cog-incoming-set x) (list l))
       #t

       ; Verify that the returned value is a true list:
       guile> (list? (cog-incoming-set x))
       #t
")

(set-procedure-property! cog-incoming-by-type 'documentation
"
 cog-incoming-by-type ATOM TYPE
    Return the incoming set of ATOM that consists only of atoms of
    type TYPE.  This set is returned as an ordinary scheme list.

    Equivalent to (cog-filter TYPE (cog-incoming-set ATOM))

    Example:
       ; Define two nodes and two links between them:
       guile> (define x (ConceptNode \"abc\"))
       guile> (define y (ConceptNode \"def\"))
       guile> (ListLink x y)
       guile> (UnorderedLink x y)

       ; Get the incoming sets of nodes x and y:
       guile> (cog-incoming-by-type x 'ListLink)
       ((ListLink
          (ConceptNode \"abc\")
          (ConceptNode \"def\")
       )
       )

       guile> (cog-incoming-by-type x 'UnorderedLink)
       ((UnorderedLink
          (ConceptNode \"abc\")
          (ConceptNode \"def\")
       )
       )
")

(set-procedure-property! cog-outgoing-atom 'documentation
"
 cog-outgoing-atom ATOM INDEX
    Return the INDEX'th atom in the outgoing set of ATOM. Indexing
    is done from a base of zero. This returns the same atom as
    (list-ref (cog-outgoing-set ATOM) INDEX) but is faster.
")

(set-procedure-property! cog-outgoing-set 'documentation
"
 cog-outgoing-set ATOM
    Return the outgoing set of ATOM.  This set is returned as an
    ordinary scheme list.
")

(set-procedure-property! cog-outgoing-by-type 'documentation
"
 cog-outgoing-by-type ATOM TYPE
    Return those atoms in the outgoing set of ATOM that are of type TYPE.
    This set is returned as an ordinary scheme list.

    Equivalent to (cog-filter TYPE (cog-outgoing-set ATOM))
")

(set-procedure-property! cog-handle 'documentation
"
 cog-handle ATOM
    Return the hash of ATOM. The hash is a 64-bit integer, computed
    from the component parts of the atom (but not it's values), that
    can be used in hash tables or other algorithms that require a hash.

    Example:
       guile> (cog-handle (Concept \"abc\"))
       999283543311182409
")

(set-procedure-property! cog-inc-count! 'documentation
"
  cog-inc-count! ATOM CNT -- Increment count truth value on ATOM by CNT

  If the current truth value on the ATOM is not a CountTruthValue,
  then the truth value is replaced by a CountTruthValue, with the
  count set to CNT.  The mean and confidence values are left
  untouched. CNT may be any floating-point number.

  Example usage:
     (cog-inc-count! (ConceptNode \"Answer\") 42.0)
")

(set-procedure-property! cog-new-stv 'documentation
"<commit_msg>Add documentation for cog-atom-less? as well.<commit_after>;
; core-docs.scm
;
; Provide documentation for all the functions implemented in C++ code.
; These can be viewed the guile interpreter prompt by saying
;
;    guile> ,describe  FUNCTION-NAME
;
; A list of all of these is printed by saying
;
;    guile> ,apropos cog
;
(set-procedure-property! cog-new-node 'documentation
"
 cog-new-node NODE-TYPE NODE-NAME
    Create a new node of type NODE-TYPE and name NODE-NAME.

    Optionally, a truth value and/or an attention value can follow
    the node name.

    Throws errors if node-type is not a valid atom type for a node,
    and if node-name is not a string.

    Example:
        ; Create a new node, and prints its value:
        guile> (cog-new-node 'ConceptNode \"some node name\")
        (ConceptNode \"some node name\")

        ; Creates a new node, with a truth value:
        guile> (cog-new-node 'ConceptNode \"another node\"
                      (cog-new-stv 0.8 0.9))
        (ConceptNode \"another node\" (stv 0.8 0.9))
")

(set-procedure-property! cog-node 'documentation
"
 cog-node NODE-TYPE NODE-NAME
    Returns the node of type NODE-TYPE and name NODE-NAME, if it exists,
    else returns null.

    Optionally, a truth value and/or attention value can follow the
    node name. If the node exists, then the truth value and/or
    attention value is modified.

    Throws errors if node-type is not a valid atom type for a node,
    and if node-name is not a string.

    Example:
        ; Check to see if a node exists:
        guile> (cog-node 'ConceptNode \"asdf\")
        ()

        ; Verify that the return value is actually a true null:
        guile> (null? (cog-node 'ConceptNode \"asdf\"))
        #t

        ; Now, create the node, and see if it exists:
        guile> (cog-new-node 'ConceptNode \"asdf\")
        (ConceptNode \"asdf\")
        guile> (null? (cog-node 'ConceptNode \"asdf\"))
        #f

        ; Change the truth value of an existing node:
        guile> (cog-node 'ConceptNode \"asdf\" (cog-new-stv 0.8 0.9))
        (ConceptNode \"asdf\" (stv 0.8 0.9))
")

(set-procedure-property! cog-new-link 'documentation
"
 cog-new-link LINK-TYPE ATOM-1 ... ATOM-N
    Create a new link, of type LINK-TYPE, with the given atoms in the link.

    Optionally, a truth value or an attention value can be included
    in the list of atoms.

    Throws errors if the link type is not a valid opencog link type,
    or if any of the arguments after the link type are not atoms,
    truth values, attention values, or null.

    Example:
        ; Creates two nodes, and a new link:
        guile> (define x (cog-new-node 'ConceptNode \"abc\"))
        guile> (define y (cog-new-node 'ConceptNode \"def\"))
        guile> (cog-new-link 'Link x y)
        (Link
           (ConceptNode \"abc\")
           (ConceptNode \"def\")
        )

        ; Create a new link with a truth value:
        guile> (cog-new-link 'Link x y (cog-new-stv 0.7 0.8))
        (Link (stv 0.7 0.8)
           (ConceptNode \"abc\")
           (ConceptNode \"def\")
        )
")

(set-procedure-property! cog-link 'documentation
"
 cog-link LINK-TYPE ATOM-1 ... ATOM-N
    Returns the link of the given type LINK-TYPE and list of atoms,
    if it exists, else returns null.

    Optionally, a truth value or attention value can be included
    in the list of atoms. If the link exists, then the truth value
    and/or attention value is modified.

    Throws errors if the link type is not a valid opencog link type,
    or if any of the arguments after the link type are not atoms,
    truth values, attention values, or null.

    Example:
        ; Create two nodes:
        guile> (define x (cog-new-node 'ConceptNode \"abc\"))
        guile> (define y (cog-new-node 'ConceptNode \"def\"))

        ; Does a node with these two links exist?
        guile> (cog-link 'Link x y)
        ()

        ; Now, create such a link
        guile> (cog-new-link 'Link x y)
        (Link
           (ConceptNode \"abc\")
           (ConceptNode \"def\")
        )

        ; Check again for existence:
        guile> (cog-link 'Link x y)
        (Link
           (ConceptNode \"abc\")
           (ConceptNode \"def\")
        )

        ; Change the truth value of an existing node:
        guile> (cog-link 'Link x y (cog-new-stv 0.7 0.8))
        (Link (stv 0.7 0.8)
           (ConceptNode \"abc\")
           (ConceptNode \"def\")
        )
")

(set-procedure-property! cog-delete 'documentation
"
 cog-delete ATOM
    Remove the indicated ATOM from the AtomSpace, but only if it has no
    incoming links. If it has incoming links, the remove fails.  If SQL
    or other data storage is attached, the ATOM is also removed from
    the storage.

    Returns #t if the atom was removed, else returns #f if not removed.

    Use cog-extract to remove from the AtomSpace only, leaving storage
    unaffected.

    Use cog-delete-recursive to force removal of this atom, together
    with any links that might be holding this atom.

    Example:
       ; Define two nodes and a link between them:
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (define y (cog-new-node 'ConceptNode \"def\"))
       guile> (define l (cog-new-link 'Link x y))

       ; Verify that there's an atom called x:
       guile> x
       (ConceptNode \"abc\")

       ; Try to delete x. This should fail, since there's a link
       ; containing x.
       guile> (cog-delete x)
       #f

       ; Delete x, and everything pointing to it. This should delete
       ; both x, and the link l.
       guile> (cog-delete-recursive x)
       #t

       ; Verify that the link l is gone:
       guile> l
       Invalid handle

       ; Verify that the node x is gone:
       guile> x
       Invalid handle

       ; Verify that the node y still exists:
       guile> y
       (ConceptNode \"def\")
")

(set-procedure-property! cog-delete-recursive 'documentation
"
 cog-delete-recursive ATOM
    Remove the indicated ATOM from the AtomSpace, and all atoms that
    point at it.  If SQL or other data storage is attached, the ATOM is
    also removed from the storage.

    Return #t on success, else return #f if not removed.
")

(set-procedure-property! cog-extract 'documentation
"
 cog-extract ATOM
    Remove the indicated ATOM from the AtomSpace, but only if it has no
    incoming links. If it has incoming links, the remove fails.

    Returns #t if the atom was removed, else returns #f if not removed.

    This does NOT remove the atom from any attached storage (e.g. SQL
    storage).  Use cog-delete to remove from atoms from storage.

    Use cog-extract-recursive to force removal of this atom, together
    with any links that might be holding this atom.

    Example:
       ; Define two nodes and a link between them:
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (define y (cog-new-node 'ConceptNode \"def\"))
       guile> (define l (cog-new-link 'Link x y))

       ; Verify that there's an atom called x:
       guile> x
       (ConceptNode \"abc\")

       ; Try to extract x. This should fail, since there's a link
       ; containing x.
       guile> (cog-extract x)
       #f

       ; Delete x, and everything pointing to it. This should extract
       ; both x, and the link l.
       guile> (cog-extract-recursive x)
       #t

       ; Verify that the link l is gone:
       guile> l
       Invalid handle

       ; Verify that the node x is gone:
       guile> x
       Invalid handle

       ; Verify that the node y still exists:
       guile> y
       (ConceptNode \"def\")
")

(set-procedure-property! cog-extract-recursive 'documentation
"
 cog-extract-recursive ATOM
    Remove the indicated ATOM from the AtomSpace, and all atoms that
    point at it.  Return #t on success, else return #f if not removed.

    The atom is NOT removed from SQL or other attached data storage.
    If you need to delete from storage, use cog-delete and
    cog-delete-recursive.
")

(set-procedure-property! cog-atom? 'documentation
"
 cog-atom? EXP
    Return #t if EXP is an atom, else return #f

    Example:
       ; Define a node
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (define y (+ 2 2))
       guile> (cog-atom? x)
       #t
       guile> (cog-atom? y)
       #f
")

(set-procedure-property! cog-node? 'documentation
"
 cog-node? EXP
    Return #t if EXP is an node, else return #f

    See also cog-node, which will check to see if a specific node
    already exists.

    Example:
       ; Define a node and a link
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (define y (cog-new-link 'ListLink x))
       guile> (cog-node? x)
       #t
       guile> (cog-node? y)
       #f
")

(set-procedure-property! cog-link? 'documentation
"
 cog-link? EXP
    Return #t if EXP is an link, else return #f

    See also cog-link, which will check to see if a specific link
    already exists.

    Example:
       ; Define a node and a link
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (define y (cog-new-link 'ListLink x))
       guile> (cog-link? x)
       #f
       guile> (cog-link? y)
       #t
")

(set-procedure-property! cog-name 'documentation
"
 cog-name ATOM
    Return the name of the node ATOM. If the atom is not a node,
    returns null.

    Example:
       ; Define a node
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (cog-name x)
       \"abc\"
")

(set-procedure-property! cog-type 'documentation
"
 cog-type ATOM
    Return the type of ATOM.

    Example:
       ; Define a node
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (cog-type x)
       ConceptNode
       guile> (eq? 'ConceptNode (cog-type x))
       #t
")

(set-procedure-property! cog-arity 'documentation
"
 cog-arity ATOM
    Return the arity of ATOM.

    Example:
       guile> (define x (cog-new-node 'ConceptNode \"abc\"))
       guile> (cog-arity x)
       0
       guile> (define l (cog-new-link 'Link x x x))
       guile> (cog-arity l)
       3
")

(set-procedure-property! cog-incoming-set 'documentation
"
 cog-incoming-set ATOM
    Return the incoming set of ATOM.  This set is returned as an
    ordinary scheme list.

    Example:
       ; Define two nodes and a link between them:
       guile> (define x (ConceptNode \"abc\"))
       guile> (define y (ConceptNode \"def\"))
       guile> (define l (Link x y))

       ; Get the incoming sets of nodes x and y (which is the link l):
       guile> (cog-incoming-set x)
       ((Link
          (ConceptNode \"abc\")
          (ConceptNode \"def\")
       )
       )

       guile> (cog-incoming-set y)
       ((Link
          (ConceptNode \"abc\")
          (ConceptNode \"def\")
       )
       )

       ; Verify that the both incoming sets are really one and the
       ; same link:
       guile> (equal? (cog-incoming-set x) (cog-incoming-set y))
       #t

       ; The returned values are lists, and not singleton atoms.
       ; Thus, the incoming set of x is a list containing l:
       guile> (equal? (cog-incoming-set x) (list l))
       #t

       ; Verify that the returned value is a true list:
       guile> (list? (cog-incoming-set x))
       #t
")

(set-procedure-property! cog-incoming-by-type 'documentation
"
 cog-incoming-by-type ATOM TYPE
    Return the incoming set of ATOM that consists only of atoms of
    type TYPE.  This set is returned as an ordinary scheme list.

    Equivalent to (cog-filter TYPE (cog-incoming-set ATOM))

    Example:
       ; Define two nodes and two links between them:
       guile> (define x (ConceptNode \"abc\"))
       guile> (define y (ConceptNode \"def\"))
       guile> (ListLink x y)
       guile> (UnorderedLink x y)

       ; Get the incoming sets of nodes x and y:
       guile> (cog-incoming-by-type x 'ListLink)
       ((ListLink
          (ConceptNode \"abc\")
          (ConceptNode \"def\")
       )
       )

       guile> (cog-incoming-by-type x 'UnorderedLink)
       ((UnorderedLink
          (ConceptNode \"abc\")
          (ConceptNode \"def\")
       )
       )
")

(set-procedure-property! cog-outgoing-atom 'documentation
"
 cog-outgoing-atom ATOM INDEX
    Return the INDEX'th atom in the outgoing set of ATOM. Indexing
    is done from a base of zero. This returns the same atom as
    (list-ref (cog-outgoing-set ATOM) INDEX) but is faster.
")

(set-procedure-property! cog-outgoing-set 'documentation
"
 cog-outgoing-set ATOM
    Return the outgoing set of ATOM.  This set is returned as an
    ordinary scheme list.
")

(set-procedure-property! cog-outgoing-by-type 'documentation
"
 cog-outgoing-by-type ATOM TYPE
    Return those atoms in the outgoing set of ATOM that are of type TYPE.
    This set is returned as an ordinary scheme list.

    Equivalent to (cog-filter TYPE (cog-outgoing-set ATOM))
")

(set-procedure-property! cog-handle 'documentation
"
 cog-handle ATOM
    Return the hash of ATOM. The hash is a 64-bit integer, computed
    from the component parts of the atom (but not it's values), that
    can be used in hash tables or other algorithms that require a hash.

    Example:
       guile> (cog-handle (Concept \"abc\"))
       999283543311182409
")

(set-procedure-property! cog-atom-less? 'documentation
"
 cog-atom-less? L-ATOM R-ATOM
    Return #t if L-ATOM is less than R-ATOM, else return #f.  This
    predicate is usefule for creating sorted lists of atoms; for
    example, to rapidly remove duplicate atoms from a long list.

    Example:
       guile> (cog-atom-less? (Concept \"abc\") (Concept \"def\"))
       #f
")

(set-procedure-property! cog-inc-count! 'documentation
"
  cog-inc-count! ATOM CNT -- Increment count truth value on ATOM by CNT

  If the current truth value on the ATOM is not a CountTruthValue,
  then the truth value is replaced by a CountTruthValue, with the
  count set to CNT.  The mean and confidence values are left
  untouched. CNT may be any floating-point number.

  Example usage:
     (cog-inc-count! (ConceptNode \"Answer\") 42.0)
")

(set-procedure-property! cog-new-stv 'documentation
"
{'fraction_non_alphanumeric': 0.09846670717323706, 'fraction_numerical': 0.00436041316701812, 'mean_word_length': 2.2328134026574236, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 150, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '657230', 'n_tokens_mistral': 9167, 'n_tokens_neox': 8845, 'n_words': 3473}