Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --pattern support to the llvm backend via haskell backend tool #2370

Merged
merged 13 commits into from
Dec 16, 2021

Conversation

dwightguth
Copy link
Collaborator

@dwightguth dwightguth commented Dec 8, 2021

Basically, we add support for --pattern passed to krun when you use the llvm backend, by means of delegating the search pattern matching to the haskell backend.

Fixes #1742

@dwightguth dwightguth marked this pull request as ready for review December 10, 2021 15:21
@dwightguth dwightguth marked this pull request as draft December 10, 2021 15:22
@dwightguth dwightguth marked this pull request as ready for review December 10, 2021 22:12
@dwightguth dwightguth marked this pull request as draft December 10, 2021 22:12
@dwightguth dwightguth marked this pull request as ready for review December 15, 2021 17:56
Comment on lines -7 to +23
V ==K ( y ~> #freezer___LAMBDA1_ ( lambda x . lambda y . x ) ~> #freezer___LAMBDA0_ ( z ) ~> #freezer___LAMBDA1_ ( a ) )
#Or
V ==K ( z ~> #freezer___LAMBDA1_ ( ( lambda x . lambda y . x ) y ) ~> #freezer___LAMBDA1_ ( a ) )
#Or
V ==K ( z ~> #freezer___LAMBDA1_ ( closure ( .Map , x , lambda y . x ) y ) ~> #freezer___LAMBDA1_ ( a ) )
{
V:K
#Equals
z ~> #freezer___LAMBDA_Exp_Exp_Exp1_ ( ( lambda x . lambda y . x ) y ~> . ) ~> #freezer___LAMBDA_Exp_Exp_Exp1_ ( a ~> . ) ~> .
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have less search results in the post-state than the pre. Is this intentional? (just want to make sure it's double-checked)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional. The java backend implements some custom logic to ensure that heating and cooling rules can apply at any time while also preventing them from applying in an infinitely looping cycle. The Haskell and LLVM backends do not do this, and thus require that any heated term be fully evaluated before cooling. That is why you lose two behaviors in each instance of this particular program. I have previously spoken with @grosu and he has explicitly stated he is okay with making this change for the time being in order to be able to migrate the lessons in the pl-tutorial. We can revisit and readd these behaviors when we have an actual need to implement the full nondeterminism of heating/cooling in K.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, is this recorded in an issue somewhere? We don't want to forget.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will create an issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dwightguth dwightguth enabled auto-merge (squash) December 16, 2021 19:34
@dwightguth dwightguth merged commit da4cd87 into master Dec 16, 2021
@dwightguth dwightguth deleted the search2 branch December 16, 2021 20:20
h0nzZik pushed a commit to h0nzZik/k that referenced this pull request Nov 24, 2022
* haskell-backend/src/main/native/haskell-backend: c4278195 - Keep table of term replacements in SideCondition, use in term simplifier (runtimeverification#2315)

* haskell-backend/src/main/native/haskell-backend: 51607104 - Update dependency: deps/k_release

* haskell-backend/src/main/native/haskell-backend: 44423faa - Remove build date from version info and add dirty flag (runtimeverification#2370)

* haskell-backend/src/main/native/haskell-backend: d0412b76 - Update dependency: deps/k_release

* haskell-backend/src/main/native/haskell-backend: e87dac75 - Fix uninterpreted functions in keys of Maps and Sets (runtimeverification#2323)

* haskell-backend/src/main/native/haskell-backend: deaf0af1 - Keep set of defined terms in SideCondition (runtimeverification#2354)

* haskell-backend/src/main/native/haskell-backend: 266597e9 - Revert runtimeverification#2315 (runtimeverification#2385)

* haskell-backend/src/main/native/haskell-backend: d18be998 - kore-0.39.0.0 (runtimeverification#2388)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Concrete execution search
3 participants