예제 #1
0
  @Override
  public List<Term> getKComponents() {
    DataStructureSort sort = global.getDefinition().dataStructureSortOf(sort());

    ArrayList<Term> components = Lists.newArrayList();
    elements
        .stream()
        .forEach(
            element ->
                components.add(
                    KItem.of(
                        KLabelConstant.of(sort.elementLabel(), global.getDefinition()),
                        KList.singleton(element),
                        global,
                        element.getSource(),
                        element.getLocation())));

    for (Term term : baseTerms()) {
      if (term instanceof BuiltinSet) {
        components.addAll(((BuiltinSet) term).getKComponents());
      } else {
        components.add(term);
      }
    }

    return components;
  }
예제 #2
0
 @Override
 public void visit(KItem node) {
   if (node.isGround() && node.isNormal()) {
     rhsSchedule.add(RHSInstruction.PUSH(node));
   } else {
     node.kList().accept(this);
     node.kLabel().accept(this);
     rhsSchedule.add(
         RHSInstruction.CONSTRUCT(
             new Constructor(ConstructorType.KITEM, node.getSource(), node.getLocation())));
     rhsSchedule.add(RHSInstruction.EVAL);
   }
 }
예제 #3
0
 @Override
 public void visit(KItem kItem) {
   kItem.kLabel().accept(this);
   kItem.kList().accept(this);
   visit((Term) kItem);
 }