I'm looking for a word to describe the relationship (or perhaps paradigm) wherein two functions go together and are meant to act as opposites to one-another, or to reverse each-other's behaviour - especially in programming.
- Perhaps more of a stretch:
More specifically (or perhaps more generically), I am striving for words that capture a certain guarantee or expectation that any set of 'paired' functions, when given the same configuration (or complimentary configurations), can operate on one-another's output. In the above examples:
Write(data, format) => filesuch that
Read(file, format) => data
Serialize(object, settings) => stringsuch that
Deserialize(string, settings) => object
Encrypt(string, privateKey) => datasuch that
Decrypt(data, publicKey) => string
When using such functions there's an "expectation" that if e.g. a given library is used to write out a file to storage, such as:
That the output of that function call can be read back in by its 'opposite', when provided the same configuration:
If the above didn't work - that would be weird, and might be considered a bug in the function design or implementation. It would violate some pattern or common-sense expectation, I'm just not sure what one would call it.
There are other words in programming to describe guaranteed behaviours (such as "orthogonality" and "immutability") and relationships functions/operators have with one another or their outputs (such as "commutative" and "isomorphic"). I was hoping there would be a similar word for this.
In mathematics, I'm familiar with the concept of an "inverse function" which can consume the output of another function to restore its input (e.g. unary functions such as
exp) such that
F(x) = y, F'(y) = x, or perhaps more interestingly
F'(F(x)) = x (e.g. they 'cancel one-another out'). It is quite close to the concept I'm thinking of.
Some words that come to mind are "pair", "symmetrical", "complimentary", or "opposite" functions, but I'm not seeing anything in academia using these words in this way.
I'd settle for a word or set of words that works in any of the following contexts:
Smallifyfunctions are (adjective)
Biggifyfunction (verb or phrasal verb) the
Biggifyis the (noun) (preposition)