congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AddParentCells.concretize
Code IndexAdd Tabnine to your IDE (free)

How to use
concretize
method
in
org.kframework.compile.AddParentCells

Best Java code snippets using org.kframework.compile.AddParentCells.concretize (Showing top 7 results out of 315)

origin: kframework/k

K concretize(K term) {
  if (term instanceof KApply) {
    KApply app = (KApply) term;
    KApply newTerm = KApply(app.klabel(), KList(app.klist().stream()
        .map(this::concretize).collect(Collectors.toList())));
    if (cfg.isParentCell(newTerm.klabel())) {
      return concretizeCell(newTerm);
    } else {
      return newTerm;
    }
  } else if (term instanceof KRewrite) {
    KRewrite rew = (KRewrite) term;
    return KRewrite(concretize(rew.left()), concretize(rew.right()));
  } else if (term instanceof KSequence) {
    return KSequence(((KSequence) term).stream()
        .map(this::concretize).collect(Collectors.toList()));
  } else {
    return term;
  }
}
origin: kframework/k

  public Sentence concretize(Sentence m) {
    if (m instanceof Rule) {
      Rule r = (Rule) m;
      return new Rule(concretize(r.body()), r.requires(), r.ensures(), r.att());
    } else if (m instanceof Context) {
      Context c = (Context) m;
      return new Context(concretize(c.body()), c.requires(), c.att());
    } else {
      return m;
    }
  }
}
origin: kframework/k

  public Sentence concretize(Sentence s) {
    s = addRootCell.addImplicitCells(s);
    s = addParentCells.concretize(s);
    s = closeCells.close(s);

    s = sortCells.preprocess(s);
    s = sortCells.sortCells(s);
    s = sortCells.postprocess(s);
    return s;
  }
}
origin: kframework/k

@Test
public void testNonCellItemRewrite() {
  K term = cell("<T>", KRewrite(KApply(KLabel("label")),cells(KApply(KLabel(".K")), cell("<k>",KVariable("X")))));
  exception.expect(KEMException.class);
  exception.expectMessage("Can't mix items with different parent cells under a rewrite");
  pass.concretize(term);
}
origin: kframework/k

@Test
public void testNonCellItem() {
  K term = cell("<T>", KApply(KLabel(".K")), cell("<k>",KVariable("X")));
  K expected = cell("<T>",cells(KApply(KLabel(".K")), cell("<ts>", cell("<t>", cell("<k>", KVariable("X"))))));
  Assert.assertEquals(expected, pass.concretize(term));
}
origin: kframework/k

@Test
public void testLeafContent() {
  K term = cell("<T>", cell("<k>",
      KSequence(KApply(KLabel("_+_"), KVariable("I"), KVariable("J")),
          KVariable("Rest"))));
  K expected = cell("<T>", cell("<ts>", cell("<t>", cell("<k>",
      KSequence(KApply(KLabel("_+_"), KVariable("I"), KVariable("J")),
          KVariable("Rest"))))));
  Assert.assertEquals(expected, pass.concretize(term));
}
origin: kframework/k

@Test
public void testNestedCompletion() {
  K term = cell("<T>",
      cell("<t>", cell("<msg>", intToToken(0)), cell("<msgId>", intToToken(1))),
      cell("<k>", intToToken(2)),
      cell("<env>", intToToken(3)),
      cell("<msgId>", intToToken(4)),
      cell("<msgId>", intToToken(5)),
      cell("<t>", cell("<k>", intToToken(6))));
  K expected = cell("<T>",cell("<ts>",
      cell("<t>", cell("<msg>", intToToken(0)), cell("<msg>", cell("<msgId>", intToToken(1)))),
      cell("<t>", cell("<k>", intToToken(6))),
      cell("<t>", cell("<k>", intToToken(2)), cell("<env>", intToToken(3)),
        cell("<msg>", cell("<msgId>", intToToken(4))),
        cell("<msg>", cell("<msgId>", intToToken(5))))
      ));
  Assert.assertEquals(expected, pass.concretize(term));
}
org.kframework.compileAddParentCellsconcretize

Popular methods of AddParentCells

  • concretizeCell
  • makeParents
  • <init>
  • getLevel
  • getParent
  • isCompletionItem
  • streamSideCells

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now