Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

41
LINES

< > BotCompany Repo | #1012642 // AbstractThoughtSpace

JavaX fragment (include)

1  
abstract sclass AbstractThoughtSpace implements AI_PostHandler {
2  
  AbstractThoughtSpace parent;
3  
  
4  
  *() {}
5  
  *(AbstractThoughtSpace *parent) {}
6  
  
7  
  // take unshortened queries
8  
  abstract L<TripleRef<Symbol>> get(Symbol query);
9  
  abstract L<TripleRef<Symbol>> get(Symbol query, int position);
10  
  abstract L<TripleWeb> getTriples(Symbol query);
11  
  abstract L<TripleWeb> getTriples(Symbol query, int position);
12  
  
13  
  abstract L<TripleWeb> getOneTwo(Symbol a, Symbol b);
14  
  
15  
  // existence of triple has already been checked
16  
  public abstract GlobalID postTriple(T3<Symbol> t);
17  
18  
  abstract int size();
19  
  
20  
  // doesn't take variables
21  
  public bool hasTriple(Symbol a, Symbol b, Symbol c) {
22  
    ret findTriple(a, b, c) != null;
23  
  }
24  
  
25  
  // doesn't take variables
26  
  public TripleWeb findTriple(Symbol a, Symbol b, Symbol c) {
27  
    L<TripleWeb> l = shortestList3(getTriples(a, 0), getTriples(b, 1), getTriples(c, 2));
28  
    if (l != null) for (TripleWeb w : l)
29  
      if (w != null && tripleEqic(w, a, b, c))
30  
        ret w;
31  
    null;
32  
  }
33  
  
34  
  public bool hasTriple_verified(Symbol a, Symbol b, Symbol c) {
35  
    L<TripleWeb> l = shortestList3(getTriples(a, 0), getTriples(b, 1), getTriples(c, 2));
36  
    if (l != null) for (TripleWeb w : l)
37  
      if (w != null && w.verified() && tripleEqic(w, a, b, c))
38  
        true;
39  
    false;
40  
  }
41  
}

Author comment

Began life as a copy of #1012640

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012642
Snippet name: AbstractThoughtSpace
Eternal ID of this version: #1012642/24
Text MD5: 46c37aca4d30963386b2db1f08b9b66a
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-02-27 01:47:26
Source code size: 1356 bytes / 41 lines
Pitched / IR pitched: No / No
Views / Downloads: 545 / 1113
Version history: 23 change(s)
Referenced in: [show references]