So I have the following now:

(define User (ConceptNode "User" (stv 0.01 1)))
(define Animal (ConceptNode "Animal" (stv 0.1 1)))
(define alive (PredicateNode "alive" (stv 0.01 1))) ; something is alive
(define user_animal (InheritanceLink User Animal (stv 1 1))) ; all users 
are animals
(define animal_alive (EvaluationLink alive (ListLink Animal) (stv 0.9 1))) 
; most animals we will encounter are alive

(define (name first last) (string-append first " " last))
; all users have an account with scores
(define (make-user f l)
        (define usr (ConceptNode (name f l)))
        (InheritanceLink usr User (stv 1 1))
        (AtTimeLink
                (EvaluationLink
                        (PredicateNode "score-of")
                        (ListLink
                                usr
                                (NumberNode "100000")
                        )
                        (TimeNode (current-time))
                )
        )
)

Does this make sense?  To update scores, I still need to be able to fetch 
the old score and then add or subtract things from it or multiply or divide 
the old score by some new number and then add it at the new time point. 

On Tuesday, December 11, 2018 at 1:12:22 PM UTC, Nil wrote:
>
> On 12/11/18 2:13 PM, Johannes Castner wrote: 
> > What I'm trying to say is a user has an account and an account has 
> > points in it that can change--just as with any computer game, really.   
> > Does that make sense? 
>
> There are different ways to do that, and they depend on what you 
> intend to do with the knowledge. One way would be to use value 
>
> https://wiki.opencog.org/w/Value 
>
> for instance to attach a score of 3 to John, you'd say 
>
> ``` 
> (define john (Concept "John")) 
> (define score (Concept "score")) 
> (cog-set-value! john score (Number 3)) 
> ``` 
>
> then you may ask John's score with 
> ``` 
> (cog-value john score) 
> ``` 
> which will return 3. 
>
> Later on you may update John's score with 
> ``` 
> (cog-set-value! john score (Number 4)) 
> ``` 
>
> And 
> ``` 
> (cog-value john score) 
> ``` 
> which will return 4. 
>
> The problem with that (and with mutability in general) is that you 
> lose information. So for instance you won't be able to use reasoning 
> or specialized forms thereof like pattern mining to analyze the 
> evolution of your data. For that you need to keep track of these 
> updates. One way could be to use AtTimeLink, so for instance you way 
> write that at 10pm John had a score of 3 
>
> AtTimeLink 
>    Evaluation 
>      Predicate "score-of" 
>      List 
>        (Concept "John") 
>        (Number 3) 
>    TimeNode "10pm" 
>
> but at 11pm he had a score of 4 
>
> AtTimeLink 
>    Evaluation 
>      Predicate "score-of" 
>      List 
>        (Concept "John") 
>        (Number 4) 
>    TimeNode "10pm" 
>
> Etc... There are many ways to represent knowledge. 
>

-- 
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/54788ff1-6676-4db4-9343-52150b430684%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to