<p>There is no standard notion of "fundamentalness".  It's not clear that what you are looking for is meaningful or makes any sense.  What is "fundamental" is a matter of perspective; I don't see any reason to privilege <strong>insert</strong> as more fundamental than <strong>splice</strong>, or vice versa.</p>

<p>So, if you need a concept of "fundamental" for some reason, you'll need to define for yourself what you mean by "fundamental".  If you're going to head that path, I would suggest that you start by asking yourself, "Why do you care?"</p>

<p>Personally, I suspect an XY problem.  I suspect you're asking the wrong question, and you should go back and ask yourself why you want to know and what you will do with the answer -- and that might help you identify a more sensible question or a more pragmatic path to achieving your real goals.</p>

CC BY-SA 3.0
2013-10-21T06:44:34.973Z
Very sensible answer. Fundamentalism as a purpose in itself is dangerous.
Andrej Bauer
CC BY-SA 3.0
2013-10-22T02:24:32.310Z
In your case, 'fundamentalness' of your data structure is defined w.r.t. those features you are trying to achieve.
zpavlinovic
CC BY-SA 3.0
2013-10-21T00:36:04.423Z
2013-10-21T00:36:04.423Z
D.W.
<p>I'm writing an implementation for a common array structure.</p>

<p>As you would find already familiar, an array is an ordered data structure that you can transform with different (hopefully self-explained) operations like:</p>

<ul>
<li>set object at index</li>
<li>insert object(s) starting at index i</li>
<li>remove object(s) starting at index i</li>
<li>splice</li>
<li>push</li>
<li>pop</li>
<li>shift</li>
<li>unshift</li>
<li>clear</li>
</ul>

<p>And then you could intuitively see that you could just code a set of 'fundamental operations' from where you could construct all the other ones. For instance, you could use <strong>splice</strong> to emulate the behavior of all other operations but you could also use <strong>insert</strong> and <strong>remove</strong> to construct all of them.</p>

<p>My question is, then, how would you define those 'fundamental operations'?</p>

<p>Is <strong>splice</strong> a construct of <strong>insert</strong> and <strong>remove</strong>, therefore <strong>insert</strong> and <strong>remove</strong> being fundamental?</p>

<p>Or are <strong>insert</strong> and <strong>remove</strong> special cases of <strong>splice</strong>, therefore <strong>splice</strong> being the fundamental operation for the whole group?</p>

<p>Is there some theory or field of CS that deals with these things?</p>

<p><em>P.S. Sorry if I'm making a lot of mistakes when presenting the question. I don't know about the correct language for this and have never studied this stuff formally. I hope that I explained myself correctly.</em></p>

CC BY-SA 3.0
2013-10-17T20:39:50.643Z
Whoa a downvote, no feedback... wow
Alex Morales
CC BY-SA 3.0
2013-10-20T01:49:46.543Z
Have you read the help center?  Would you like to elaborate why you believe this question is on-topic (it is a research-level question about theoretical computer science)?  Also, what makes you believe there will be a unique subset of fundamental operations?  There might be many such subsets.
D.W.
CC BY-SA 3.0
2013-10-20T21:52:27.080Z
Thanks for your comment. Yeah sure, both subsets could be fundamental, but how do you formally define that an operation is 'fundamental'? Do you know of a site of book that deals with this issues?
Alex Morales
CC BY-SA 3.0
2013-10-21T06:43:43.483Z
Start with a book about data structures.
Andrej Bauer
CC BY-SA 3.0
2013-10-22T01:40:42.327Z
@AndrejBauer I honestly can't see the relationship...
Alex Morales
CC BY-SA 3.0
2013-10-22T08:10:24.740Z
Well, they'll tell you that there is a difference between a list, an array, a stack, and a queue. So then you'll be less puzzled by the Pythonesque do-it-all-in-one arrays.
Andrej Bauer
<ds.algorithms><semantics><implementation><operational-semantics>
How would you define a set of 'fundamental operations' over an object?
Alex Morales
# How would you define a set of 'fundamental operations' over an object?

(Asked by: username_0 on 2013-10-17)

I'm writing an implementation for a common array structure.

As you would find already familiar, an array is an ordered data structure that you can transform with different (hopefully self-explained) operations like:

* set object at index
* insert object(s) starting at index i
* remove object(s) starting at index i
* splice
* push
* pop
* shift
* unshift
* clear

And then you could intuitively see that you could just code a set of 'fundamental operations' from where you could construct all the other ones. For instance, you could use **splice** to emulate the behavior of all other operations but you could also use **insert** and **remove** to construct all of them.

My question is, then, how would you define those 'fundamental operations'?

Is **splice** a construct of **insert** and **remove**, therefore **insert** and **remove** being fundamental?

Or are **insert** and **remove** special cases of **splice**, therefore **splice** being the fundamental operation for the whole group?

Is there some theory or field of CS that deals with these things?

*P.S. Sorry if I'm making a lot of mistakes when presenting the question. I don't know about the correct language for this and have never studied this stuff formally. I hope that I explained myself correctly.*

**Tags:** ds.algorithms, semantics, implementation, operational-semantics

> **Comments:**
> **username_0**: Whoa a downvote, no feedback... wow  
> **username_1**: Have you read the help center?  Would you like to elaborate why you believe this question is on-topic (it is a research-level question about theoretical computer science)?  Also, what makes you believe there will be a unique subset of fundamental operations?  There might be many such subsets.  
> **username_0**: Thanks for your comment. Yeah sure, both subsets could be fundamental, but how do you formally define that an operation is 'fundamental'? Do you know of a site of book that deals with this issues?  
> **username_2**: Start with a book about data structures.  
> **username_0**: @AndrejBauer I honestly can't see the relationship...  
> **username_2**: Well, they'll tell you that there is a difference between a list, an array, a stack, and a queue. So then you'll be less puzzled by the Pythonesque do-it-all-in-one arrays.  

---

## 1 answers

### Answer by username_1 on 2013-10-21. Score: 2

There is no standard notion of "fundamentalness". It's not clear that what you are looking for is meaningful or makes any sense. What is "fundamental" is a matter of perspective; I don't see any reason to privilege **insert** as more fundamental than **splice**, or vice versa.

So, if you need a concept of "fundamental" for some reason, you'll need to define for yourself what you mean by "fundamental". If you're going to head that path, I would suggest that you start by asking yourself, "Why do you care?"

Personally, I suspect an XY problem. I suspect you're asking the wrong question, and you should go back and ask yourself why you want to know and what you will do with the answer -- and that might help you identify a more sensible question or a more pragmatic path to achieving your real goals.

> **Comments:**
> **username_2**: Very sensible answer. Fundamentalism as a purpose in itself is dangerous.  
> **username_3**: In your case, 'fundamentalness' of your data structure is defined w.r.t. those features you are trying to achieve.  

---

