k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Sandeep Dasgupta <sdasgup3 AT illinois.edu>
- To: <k-user AT lists.cs.illinois.edu>
- Cc: <sdasgup3 AT illinois.edu>
- Subject: Re: [[K-user] ] How to return a list
- Date: Tue, 24 Apr 2018 13:05:45 -0500
- Authentication-results: illinois.edu; spf=pass smtp.mailfrom=sdasgup3 AT illinois.edu; dmarc=pass header.from=illinois.edu
Dear Jerry Can u please try rule getAllTypes(.Vals) => .Types Regards, Sandeep On 04/24/2018 09:00 AM,
wang_feng_bro AT 163.com wrote:
Hi
all,
I want to implement a function in K, which takes a list as
the input and also return a list.
For instance, the input is : (1,2,3) and the expecting
output is (int, int ,int ). However, my function returns (int,
(int, (int .)).
The definitions are :
syntax Type ::= “int” | ….
syntax Types ::= List{Type, ",”}
syntax Types ::= getAllTypes(Vals) [function]
rule getAllTypes(V:Val, Vs:Vals) => getType(V),
getAllTypes(Vs)
rule getAllTypes(.Vals) => .
where getType() is just an auxiliary function.
Please help me… Thanks !
Jerry
|
- [[K-user] ] How to return a list, wang_feng_bro, 04/24/2018
- Re: [[K-user] ] How to return a list, Sandeep Dasgupta, 04/24/2018
- Re: [[K-user] ] How to return a list, wang_feng_bro, 04/25/2018
- Re: [[K-user] ] How to return a list, Sandeep Dasgupta, 04/25/2018
- Re: [[K-user] ] How to return a list, wang_feng_bro, 04/25/2018
- Re: [[K-user] ] How to return a list, Sandeep Dasgupta, 04/24/2018
Archive powered by MHonArc 2.6.19.