# How can I formalize key value stores with set theory? [closed]

I'm currently developing a simple key-value NoSQL store and want to build its formal model. I'm interested in knowing if there some work about formalization of key-value stores outside of category theory? I want to use some more simple and lightweight mathematics for the mathematical description of key-value stores. Set theory looks like it might offer some possibilities.

## closed as off-topic by cody, R B, Kaveh, Emil Jeřábek, D.W.Apr 23 '15 at 22:06

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Your question does not appear to be a research-level question in theoretical computer science. For more information about the scope, please see help center. Your question might be suitable for Computer Science which has a broader scope." – cody, R B
If this question can be reworded to fit the rules in the help center, please edit the question.

• It seems your question is not research level and would be better suited for cs.stackexchange.com. – cody Apr 21 '15 at 12:59
• Are you saying that you wish formalization that excludes Category Theory? – ouflak Apr 22 '15 at 14:25
• @ouflak Yes, exactly. I want a more simple model without category theory. I feel that set theory will be enough for this, but couldn't find any helpful articles – MainstreamDeveloper00 Apr 22 '15 at 16:52
• Oddly enough, I can't think of a nice introduction to various ways to specify such things. One thing you could do is to start by looking at what SMTLIB does for "arrays" (which are really maps/dictionaries) smtlib.cs.uiowa.edu/logics.shtml E.g., smtlib.cs.uiowa.edu/theories/ArraysEx.smt2 – Radu GRIGore Apr 22 '15 at 22:36
• Key value store is quite simple. Why do you need a formal mathematical model? What would you expect of such a model? Why do you exclude category theory? And are you hinting that there is a formal model for key value store based on category theory? By key-value store, do you include replicated data types, such as set, stack, queue, and so on? (Sorry for so many questions.) – hengxin Apr 23 '15 at 3:33

d = { 'a' : 1, 'b' : 3, 'c' : 2 }

that is the same thing as a map $d$ whose domain of definition is the set $\{a, b, c\}$ and is defined as: $$d(a) = 1, \quad d(b) = 3, \quad d(c) = 2.$$ So now you can take any mathematical description of a map and use that. In set theory we would say that $d$ is the set of ordered pairs $$\{(a,1), (b,3), (c,2)\}.$$