Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from logic import *
- a = AtomSpace()
- t = types
- socrates = a.add_node(t.ConceptNode, "Socrates")
- socrates.tv = TruthValue(.01, .3)
- print socrates
- print socrates.tv
- man = a.add_node(t.ConceptNode, "man")
- man.tv = TruthValue(.01, .3)
- print man
- print man.tv
- mortal = a.add_node(t.ConceptNode, "mortal")
- mortal.tv = TruthValue(.1, .8)
- print mortal
- print mortal.tv
- A = a.add_link(t.InheritanceLink, [socrates, man])
- B = a.add_link(t.InheritanceLink, [man, mortal])
- A.tv = TruthValue(.7, .3)
- B.tv = TruthValue(.8, .2)
- print A
- print B
- print A.tv
- print B.tv
- #log.use_stdout(True)
- #atom_from_tree(Tree('EvaluationLink',a.add_node(t.PredicateNode,'A')), a).tv = TruthValue(1, 1)
- thingie1 = atom_from_tree(Tree('InheritanceLink',socrates,man), a).tv = TruthValue(.4, .5)
- thingie2 = atom_from_tree(Tree('InheritanceLink',man,mortal), a).tv = TruthValue(.5, .5)
- thingie3 = atom_from_tree(Tree('InheritanceLink',socrates,mortal), a)
- print thingie1
- print thingie2
- c = Chainer(a)
- c.bc(Tree('InheritanceLink',socrates, mortal))
- print Tree('InheritanceLink',socrates, mortal)
Add Comment
Please, Sign In to add comment