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

34
LINES

< > BotCompany Repo | #1012144 // ai_texts_dollarAny

JavaX fragment (include)

static L<SS> ai_texts_dollarAny(S a, S b, S c) {
  if (isDollarVar(b)) todo();
  bool va = isDollarVar(a), vc = isDollarVar(c);
  new L<SS> l;
  
  // no vars
  if (!va && !vc) {
    if (has(a, b, c)) l.add(emptyMap());
    ret l;
  }
  
  // var on the left
  if (va && !vc) {
    for (S s : ai_texts("$X", b, c))
      l.add(litmap(a, s));
    ret l;
  }
  
  // var on the right
  if (vc && !va) {
    for (S s : ai_texts(a, b, "$X"))
      l.add(litmap(c, s));
    ret l;
  }
  
  // vars on both sides
  for (WebRelation r : indexedRelations(b))
    addIfNotNull(l, strictlitmapOrNull(a, web_text(r.a), c, web_text(r.b)));
  ret l;
}

static L<SS> ai_texts_dollarAny(T3<S> t) {
  ret ai_texts_dollarAny(t.a, t.b, t.c);
}

Author comment

Began life as a copy of #1012112

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: #1012144
Snippet name: ai_texts_dollarAny
Eternal ID of this version: #1012144/6
Text MD5: 6a8b91d03eccaa6cd7f8d6bfe7de7707
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-21 11:41:42
Source code size: 758 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 512 / 557
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1012147 - ai_texts_dollarAny_two - satisfy two conditions at once