Tabnine Logo
AddParentCells.concretizeCell
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.kframework.compile.AddParentCells.concretizeCell (Showing top 16 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

@Test
public void testOneLeafCellNoCompletion() {
  K term = cell("<k>", intToToken(2));
  K expected = cell("<k>", intToToken(2));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testTwoCellsNoCompletion() {
  K term = cell("<t>", cell("<k>", intToToken(2)));
  K expected = cell("<t>", cell("<k>", intToToken(2)));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test(expected = KEMException.class)
public void testAmbiguityError() {
  K term = cell("<ts>", cell("<k>", intToToken(1)), cell("<k>", intToToken(2)), cell("<env>", intToToken(2)));
  pass.concretizeCell(term);
}
origin: kframework/k

@Test
public void testTwoCellsCompletion() {
  K term = cell("<ts>", cell("<k>", intToToken(2)));
  K expected = cell("<ts>", cell("<t>", cell("<k>", intToToken(2))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testMultiplicitySeparate() {
  K term = cell("<ts>", cell("<k>", intToToken(1)), cell("<k>", intToToken(2)));
  K expected = cell("<ts>", cell("<t>", cell("<k>", intToToken(1))),
      cell("<t>", cell("<k>", intToToken(2))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testDotsTogether() {
  K term = cell("<ts>", true, false, cell("<k>", intToToken(0)), cell("<env>",intToToken(2)));
  K expected = cell("<ts>", true, true, cell("<t>", true, true,
      cell("<k>", intToToken(0)), cell("<env>",intToToken(2))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testMultiplicityShared() {
  K term = cell("<ts>", cell("<k>", intToToken(1)), cell("<env>", intToToken(2)));
  K expected = cell("<ts>", cell("<t>", cell("<k>", intToToken(1)), cell("<env>", intToToken(2))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testEmptySide() {
  K term = cell("<T>", cell("<k>"), KRewrite(cell("<msg>"), cells()));
  K expected = cell("<T>", cell("<ts>", cell("<t>", cell("<k>"), KRewrite(cell("<msg>"), cells()))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testDeep() {
  K term = cell("<T>", cell("<k>", intToToken(1)), cell("<k>", intToToken(2)));
  K expected = cell("<T>", cell("<ts>", cell("<t>", cell("<k>", intToToken(1))),
      cell("<t>", cell("<k>", intToToken(2)))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testDotsApart() {
  K term = cell("<T>", true, false, cell("<k>", intToToken(1)), cell("<k>", intToToken(2)));
  K expected = cell("<T>", true, true, cell("<ts>", true, true,
      cell("<t>", true, true, cell("<k>", intToToken(1))),
      cell("<t>", true, true, cell("<k>", intToToken(2)))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testRewrites() {
  K term = cell("<T>", cell("<k>", intToToken(1)), KRewrite(cell("<k>", intToToken(2)), cell("<k>")));
  K expected = cell("<T>", cell("<ts>",
      cell("<t>", cell("<k>", intToToken(1))),
      cell("<t>", KRewrite(cell("<k>", intToToken(2)), cell("<k>")))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testRewriteWithCellVariable() {
  K term = cell("<T>", KRewrite(KVariable("KCell", Att().add(Sort.class, Sort("KCell"))), cell("<k>", intToToken(1))));
  K expected = cell("<T>", cell("<ts>",
      cell("<t>", KRewrite(KVariable("KCell", Att().add(Sort.class, Sort("KCell"))), cell("<k>", intToToken(1))))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testTwoRewritesFit() {
  K term = cell("<T>", KRewrite(cells(), cell("<k>", intToToken(1))),
      KRewrite(cell("<k>", intToToken(2)), cells()));
  K expected = cell("<T>", cell("<ts>", cell("<t>",
      KRewrite(cells(), cell("<k>", intToToken(1))),
      KRewrite(cell("<k>", intToToken(2)), cells()))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testRewriteWithCells() {
  K term = cell("<T>", cell("<k>", intToToken(1)), KRewrite(cells(cell("<k>", intToToken(2)), cell("<msg>")), cell("<k>")));
  K expected = cell("<T>", cell("<ts>",
      cell("<t>", cell("<k>", intToToken(1))),
      cell("<t>", KRewrite(cells(cell("<k>", intToToken(2)), cell("<msg>")), cell("<k>")))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
origin: kframework/k

@Test
public void testThreeRewritesSplit() {
  K term = cell("<T>",
      KRewrite(cells(cell("<k>"),cell("<env>")), cells()),
      KRewrite(cell("<env>"), cell("<k>")),
      KRewrite(cell("<k>"), cell("<k>")));
  K expected = cell("<T>", cell("<ts>",
      cell("<t>", KRewrite(cells(cell("<k>"),cell("<env>")), cells())),
      cell("<t>", KRewrite(cell("<env>"), cell("<k>"))),
      cell("<t>", KRewrite(cell("<k>"), cell("<k>")))));
  Assert.assertEquals(expected, pass.concretizeCell(term));
}
org.kframework.compileAddParentCellsconcretizeCell

Popular methods of AddParentCells

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

Popular in Java

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • getSystemService (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Kernel (java.awt.image)
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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