question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Are heating and cooling rules part of the syntax?

See original GitHub issue

In the IMP tutorials, we can see the keywords heat and cool being used. I haven’t been able to get K to compile rules in this form, however. Particularly, the example uses [] to denote the holes in the evaluation context. Are these labels present in K?

For instance:

rule T:Term + T2:Term => T ~> [] + T2 [heat]

Fails to compile, highlighting the first [. In the tutorial we see something similar given as an example.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dwightguthcommented, May 6, 2019

It’s going to branch based on which rules apply, so it should only need to do two branches.

The transition attribute tells the java backend that this rule is considered a transition in the state graph of the semantics and thus it should try to apply every single rule and generate the complete list of successor states instead of simply choosing the first rule that applies as an optimization. Ultimately we decided that this makes things confusing for users and thus removed the need to do this in the haskell backend, but the haskell backend is still under active development and cannot run every definition that the java backend supports yet. I would advise you to use the java backend for the time being unless you want to try the haskell backend and it works for you out of the box with no errors or bugs. Hence my suggestion to use the attribute on critical pairs in the semantics.

1reaction
dwightguthcommented, May 6, 2019

The java and haskell backends definitely contain built-in symbolic execution. If you write rules like:

rule if true then A else B => A [transition]
rule if false then A else B => B [transition]

and you krun --search the term if ?A then 1 else 0, it should generate two output configurations, 1 and 0. It doesn’t generate a compatible value for ?A, it actually stores it in the term being rewritten as a symbolic value and unifies it with the rules being executed while tracking the symbolic constraints.

Does that answer your question?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lesson 1.14: Defining Evaluation Order - K framework
The purpose of this lesson is to explain how to use the heat and cool attributes, context and context alias sentences, and the...
Read more >
K Overview and SIMPLE Case Study - ScienceDirect.com
This paper gives an overview of the tool-supported K framework for semantics-based programming language design and formal analysis.
Read more >
2 A rapid tour of the join-calculus - Moscova
The chemical soup evolves according to two families of rules: Structural rules ↔ are reversible (→ is heating, ← is cooling); they represent...
Read more >
Temperature Manipulation in Songbird Brain Implicates the ...
Cooling HVC reduces the number of repetitions of long-repeated syllables and increases the randomness of syllable sequences. In contrast, cooling the downstream ...
Read more >
K Framework Distilled - · Formal Systems Laboratory
The research presented in this paper is part of the rewriting logic seman- ... The heating/cooling rules specify that the arguments mentioned in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found