Tabnine Logo
GenerateSortPredicateRules
Code IndexAdd Tabnine to your IDE (free)

How to use
GenerateSortPredicateRules
in
org.kframework.compile

Best Java code snippets using org.kframework.compile.GenerateSortPredicateRules (Showing top 5 results out of 315)

origin: kframework/k

private boolean isPredicate(Rule r) {
  return getPredicateSort(r).isPresent();
}
origin: kframework/k

public static String getKompiledString(Module mainModule, KLabel topCellInitializer, FileUtil files, boolean heatCoolEquations) {
  mainModule = new GenerateSortPredicateRules(true).gen(mainModule);
  mainModule = ModuleTransformer.fromKTransformer(new AddSortInjections(mainModule)::addInjections, "Add sort injections").apply(mainModule);
  mainModule = ModuleTransformer.fromSentenceTransformer(new MinimizeTermConstruction(mainModule)::resolve, "Minimize term construction").apply(mainModule);
  ModuleToKORE moduleToKORE = new ModuleToKORE(mainModule, files, topCellInitializer);
  String kompiledString = moduleToKORE.convert(heatCoolEquations);
  Properties koreToKLabels = new Properties();
  koreToKLabels.putAll(moduleToKORE.getKToKoreLabelMap().inverse());
  try {
    FileOutputStream output = new FileOutputStream(files.resolveKompiled("kore_to_k_labels.properties"));
    koreToKLabels.store(output, "Properties file containing the mapping from kore to k labels");
  } catch (IOException e) {
    throw KEMException.criticalError("Error while saving kore to K labels map", e);
  }
  return kompiledString;
}
origin: kframework/k

private Stream<? extends Sentence> gen(Sort sort) {
  if (kore) {
    return genKore(sort);
    MutableBoolean isProtecting = new MutableBoolean(true);
    stream(mod.definedSorts()).filter(s -> mod.subsorts().lessThanEq(s, subsort)).forEach(candidateSort -> {
      if (predicateRules.stream().filter(r -> isPredicateFor(r, candidateSort)).findAny().isPresent()) {
        BooleanUtils.TRUE));
    if (nonProtectingSubsorts.contains(s)) {
      res.addAll(predicateRules.stream().filter(r -> isPredicateFor(r, s)).filter(this::isTruePredicate).map(r -> promotePredicate(r, sort)).collect(Collectors.toList()));
origin: kframework/k

public void initialize(CompiledDefinition def) {
  Function1<Module, Module> generatePredicates = new GenerateSortPredicateRules(false)::gen;
  this.convertDataStructure = new ConvertDataStructureToLookup(def.executionModule(), true);
  ModuleTransformer convertLookups = ModuleTransformer.fromSentenceTransformer(convertDataStructure::convert, "convert data structures to lookups");
origin: kframework/k

private boolean isPredicateFor(Rule r, Sort s) {
  Optional<Sort> sort = getPredicateSort(r);
  return sort.isPresent() && sort.get().equals(s);
}
org.kframework.compileGenerateSortPredicateRules

Javadoc

Generates sort predicates from the subsort hierarchy of the module. This module assumes that the backend implements the following rules: isSort(#token(Sort, _)) => true isK(K) => true isKItem(K1(K2)) => true isKItem(#token(_, _)) => true plus one sort membership function for each builtin-hooked sort.

Most used methods

  • <init>
  • gen
  • genKore
  • getPredicateSort
  • isPredicateFor
  • promotePredicate
    Takes a rule representing a predicate of one sort and promotes it to a rule representing a predicate

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Notification (javax.management)
  • JLabel (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Sublime Text for Python
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