Two short, perhaps useless comments:

On Fri, Jan 18, 2019 at 7:13 AM Johannes Castner <[email protected]> wrote:

>  3) writing scheme Atom Space representations onto a file
>

The long-term vision is that you wouldn't use files; you would just poke
stuff into the atomspace, and it would still be there tomorrow and they day
after, even after turning the power on and off.

At the current time, you have to be a rocket surgeon to do this: configure
postgresql, figure out how to use it from the atomspace, type in the magic
incantation to make it go.  We haven't yet figured out how to make this
trivial and fun-to-use.


>
> ;; Friendship is symmetric
> (ImplicationScope (stv 1 1)
>    (VariableList
>       (TypedVariable
>


> Do you know of a simpler way than to hand-code those Axioms individually?
>

This is a different problem we have not yet figured out how to solve.
Atomese was designed to make it easy for algos, such as PLN, to manipulate
it.  As a result, it can be very verbose and hard to read.  Kind-of-like
hand-writing postscript to draw a pretty picture. Postscript is great for
printers and PDF's, just not for people.

If you are a rocket-surgeon, you can roll-your-own tools. Which is hard.
But let me give an example:

; First, some gobbldey-gook cryptic boilerplate:
(define (var name)  (TypedVariable (Variable name) (Type "ConceptNode")))
(define (relation pname va vb) (Evaluation  (Predicate pname)  (List va
vb)))
(define (axiom va vb p q) (ImplicationLink (VariableList va vb) p q))

; Now for the human-readable stuff:

(axiom (var "X") (var "Y")
     (relation "will be friends" (var "X") (var "Y"))
     (relation "will be friends" (var "Y") (var "X")) )

which is a whole lot more readable.  If you are a clever programmer, you
can make "relation" take a variable number of arguments.  If you are a
clever programmer, you can get rid of the need for the variable
declarations. It makes the gobbldey-gook boilerplate wayyy more
complicated, harder to read and understand, but it makes writing the axioms
a lot easier.

One of the early opencog chatbots used perl to translate from axioms,
written in a super-easy markup language, into the verbose atomese that the
atomspace needed.  I know people love to hate perl, but for tasks like
this, it makes them incredibly easy, easier than any other programming
language I know.

-- Linas

-- 
cassette tapes - analog TV - film cameras - you

-- 
You received this message because you are subscribed to the Google Groups 
"opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/opencog/CAHrUA36WMK7kr583A7iu4SHgTH2ADaES8eeTFf3CENnp1UdL_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to