Skip to Content.
Sympa Menu

maude-help - Re: [[maude-help] ] Working with grids in maude

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

Chronological Thread  
  • From: Steven Eker <steveneker AT gmail.com>
  • To: Raghu Ranganathan <rraghu.11502 AT gmail.com>
  • Cc: maude-help AT lists.cs.illinois.edu
  • Subject: Re: [[maude-help] ] Working with grids in maude
  • Date: Thu, 7 Dec 2023 12:49:49 -0800

You can index an Array by any structure you like - for example a pair of Nats. See linear.maude for an example. Arrays are just terms so they can be pattern matched. The efficiency of this for large arrays depends on the pattern. However the equations in fmod ARRAY are carefully designed to hit the fast cases of the ACU matcher so they run in O(log n) time for an Array with n entries. fmod MAP is a similar idea with slightly different semantics.

Steven

On Thu, Dec 7, 2023 at 6:38 AM Raghu Ranganathan <rraghu.11502 AT gmail.com> wrote:
I would like to know if there is a canonical way to work with 2d arrays in maude. The closest thing I found is LIST* which allows arbitrary nesting, but it doesn't seem to have a straightforward cons or indexing operation. I want to know if there is a grid structure that 
a) allows pattern matching
b) allows 2D indexing

My use case is for finding the neighbours of a cell inside a grid.




Archive powered by MHonArc 2.6.24.

Top of Page