Skip to Content.
Sympa Menu

k-user - Re: [[K-user] ] Staging the evaluation of rules

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [[K-user] ] Staging the evaluation of rules


Chronological Thread 
  • From: Markus Knecht <markus.knecht85 AT gmail.com>
  • To: Daniel Schnetzer Fava <danielsf AT ifi.uio.no>
  • Cc: "k-user AT lists.cs.illinois.edu" <k-user AT lists.cs.illinois.edu>
  • Subject: Re: [[K-user] ] Staging the evaluation of rules
  • Date: Thu, 04 Jan 2018 15:55:18 +0000
  • Authentication-results: illinois.edu; spf=pass smtp.mailfrom=markus.knecht85 AT gmail.com

What error do you get?
Does the evaluation get Stuck at   aBoolean  ~> selFindEnBs(...) , or does IsSelBranchEnabled(BHead) fails to evaluate to a boolean? or did it not kompile at all? 

Some things to check: 
   if something follows selFindEnBs you need to add ... before  </k>. 
   is Bool declared as KResult [do you have syntax KResult ::= Bool somwhere]

Independent tips:
  I don't think the brackets before => are necessary
  instead of true/false ~> ... you could capture both in one statement with Res:Bool ~> ...


Daniel Schnetzer Fava <danielsf AT ifi.uio.no> schrieb am Do., 4. Jan. 2018 um 16:25 Uhr:
Hi,

I am trying to write a rule that first evaluates another, then evaluates itself.
I think I ought to be using ~> but I am not sure exactly how.

Here is some attempt that does not seem to work:

rule <k> selFindEnBs({ BHead } BTail, L:List) =>
            IsSelBranchEnabled(BHead) ~> selFindEnBs(BTail, L) </k>
rule <k> (true ~> selFindEnBs(BTail, L)) => 
              selFindEnBs(BTail, L ListItem(true)) </k>
rule <k> (false ~> selFindEnBs(BTail, L)) => 
              selFindEnBs(BTail, L ListItem(false)) </k>

The goal is to have the result of “IsSelBranchEnabled(BHead)” appended to the list L
and then continue evaluating selFindEnBs on BTail.

Any help is highly appreciated!

Thanks,

Daniel



Archive powered by MHonArc 2.6.19.

Top of Page