maude-help AT lists.siebelschool.illinois.edu
Subject: Maude-help mailing list
List archive
- From: Raghu Ranganathan <rraghu.11502 AT gmail.com>
- To: maude-help AT lists.cs.illinois.edu
- Subject: [[maude-help] ] Creating higher order operators
- Date: Sat, 2 Dec 2023 14:30:17 +0800
I would like to create an operator that can take in a different operator and add that operator to its expansion. I want to implement things like map and filter in haskell or find useful alternatives to those.
For example:
ex LIST*{X} .
pr META-TERM .
var F : Term .
var Y : List{X} .
var N : Nat .
op map : X List{X} -> List{X} .
op inc : Nat -> Nat .
eq map(F, Y) = append( [F(head(Y))], map(F, tail(Y)) ) .
eq inc(X) = X + 1 .
endm then red map(inc, [1 2 3]) should reduce to [2 3 4].
I'm not sure how to make this parse and work correctly. Thank you for your help in advance.
-
[[maude-help] ] Creating higher order operators,
Raghu Ranganathan, 12/02/2023
-
Re: [[maude-help] ] Creating higher order operators,
Francisco Durán, 12/03/2023
-
Message not available
-
Message not available
-
Message not available
- Re: [[maude-help] ] Creating higher order operators, Francisco Durán, 12/06/2023
-
Message not available
-
Message not available
-
Message not available
-
Re: [[maude-help] ] Creating higher order operators,
Francisco Durán, 12/03/2023
Archive powered by MHonArc 2.6.24.