k-user AT lists.siebelschool.illinois.edu
Subject: K-user mailing list
List archive
- From: "Seyed H. HAERI (Hossein)" <hossein.haeri AT gmail.com>
- To: k-user AT cs.uiuc.edu
- Subject: [K-user] Rules with Premises of the Same Sort
- Date: Wed, 22 Feb 2012 17:31:14 +0100
- Authentication-results: mr.google.com; spf=pass (google.com: domain of hossein.haeri AT gmail.com designates 10.101.5.24 as permitted sender) smtp.mail=hossein.haeri AT gmail.com; dkim=pass header.i=hossein.haeri AT gmail.com
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user>
- List-id: <k-user.cs.uiuc.edu>
Dear all,
In the K Primer, I see examples of rules where the premises include
entities of other sorts. For example, the following rule
rule <k> var (X:#Id,Xl:Ids => Xl) ; ···</k>
<env> Rho:Map => Rho[N/X] </env>
<store>··· . => N |-> 0 ···</store>
<nextLoc> N:#Int => N +Int 1 </nextLoc>
reads to me as if the last three lines (sorts) contain premises, and
the first line -- which applies on sort <k> -- being the result of the
rule. Whilst there are lots of such examples in the Primer, I don't
seem to be able to find examples on how to make K do semantics where
the premises are also of sort <k>. I also had a look into the examples
which ship with the K tool and didn't find anything. As an example of
what I need, you might want to take a look to the attached pdf's APP
rule. (This is the Ott output for the famous operational semantics of
Abramsky and Ong for lazy evaluation.)
My initial guess was something like
rule <k> M:Exp N:Exp => Q:Val ... </k>
<k> ... M => lambda X:#Id.P:Exp ... </k>
<k> ... P[N / X] => Q ... </k>
But, I got the following kompile_error:
Warning: "abrong.maude", line 281 (mod ABRONG): didn't expect token ...</:
mb rule < k > M:Exp N:Exp => Q:Val ...</ k > < k >... M => lambda
X:#Id . P:Exp ...</ <---*HERE*
Warning: "abrong.maude", line 280 (mod ABRONG): no parse for statement
mb rule < k > M:Exp N:Exp => Q:Val ...</ k > < k >... M => lambda
X:#Id . P:Exp ...</ k > < k >... P [N / X] => Q ...</ k > : KSentence
[metadata
"location=(/home/hossein/Documents/KFram/Teachup/AbramskyOng/abrong.k:18-20)"]
.
So, how would you guys do that in K?
TIA,
--Hossein
--------------------------------------------------------------------------------------------------------------
Seyed H. HAERI (Hossein)
Research Assistant
Institute for Software Systems (STS)
Technical University of Hamburg (TUHH)
Hamburg, Germany
ACCU - Professionalism in programming - http://www.accu.org/
--------------------------------------------------------------------------------------------------------------
Attachment:
AbramskyOng.pdf
Description: Adobe PDF document
- [K-user] Rules with Premises of the Same Sort, Seyed H. HAERI (Hossein), 02/22/2012
- Re: [K-user] Rules with Premises of the Same Sort, Moore, Brandon Michael, 02/22/2012
- Re: [K-user] Rules with Premises of the Same Sort, Seyed H. HAERI (Hossein), 02/22/2012
- Re: [K-user] Rules with Premises of the Same Sort, Seyed H. HAERI (Hossein), 02/23/2012
- Re: [K-user] Rules with Premises of the Same Sort, Seyed H. HAERI (Hossein), 02/23/2012
- Re: [K-user] Rules with Premises of the Same Sort, Seyed H. HAERI (Hossein), 02/24/2012
- Message not available
- Re: [K-user] Rules with Premises of the Same Sort, Traian Florin Șerbănuță, 02/24/2012
- Re: [K-user] Rules with Premises of the Same Sort, Seyed H. HAERI (Hossein), 02/23/2012
- Re: [K-user] Rules with Premises of the Same Sort, Seyed H. HAERI (Hossein), 02/23/2012
- Re: [K-user] Rules with Premises of the Same Sort, Seyed H. HAERI (Hossein), 02/22/2012
- Re: [K-user] Rules with Premises of the Same Sort, Moore, Brandon Michael, 02/22/2012
Archive powered by MHonArc 2.6.16.