Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Swap #2410

Open
tyrbentsen opened this issue Jun 20, 2018 · 1 comment
Open

Swap #2410

tyrbentsen opened this issue Jun 20, 2018 · 1 comment

Comments

@tyrbentsen
Copy link

tyrbentsen commented Jun 20, 2018

Hi,

I'd like to implement some kind of swap function. But I'm unable to specify multiple conditions in one cell. Is that possible. In case it is, how?

Currently I tried the following ways.

This way is not accepted by the kompile parser ("Inner Parser: Parse error: unexpected character 'X'.").

rule <k> swap(X1:Id, X2:Id) => . ...</k>
    <env>... X1 |-> L1 ... X2 |-> L2 ...</env>
    <store> ... L1  |-> (V1 => V2) ... L2 |-> (V2 => V1) </store>

This way compiles but crashes krun ("A fatal error has been detected by the Java Runtime Environment: # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007fec43a7ba2, pid=9624, tid=0x0000000000003280"):

rule <k> swap(X1:Id, X2:Id) => . ...</k>
    <env>... X1 |-> L1     X2 |-> L2 ...</env>
    <store> ... L1  |-> (V1 => V2)     L2 |-> (V2 => V1) </store>

Thank you for any hints.

@ehildenb
Copy link
Member

Have you tried on https://github.com/kframework/k5? This version of K is deprecated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants