# Function that maps strings from one formal language into string of another formal language?

Is there branch of mathematics and mathematical theories, that considers mappings from strings of one language into strings of another formal language?

Example. Let's consider two languages that can be used for syntax of two different logics and that can implement the formal semantics of natural language. One language uses the predicate approach to the modalities https://www.springer.com/us/book/9783319225562 and defer the inference about modalities till the reasoning time. The example of legal sentence in this language is:

believes(John, in_conservatives)


Other language uses the modalities in the form of modal operators as the first class citizens of the logic and now all the non-logical information about the notion "believe" is encoded in the axioms for the modal operator Belief_Diamond_(agent)(predicate) and hence, the sentence becomes in this language:

Belief_Diamond_(John)(in_conservatives)


So - I just had hopes that there is some theory, methods, best practices about translation from the first language into the second language (e.g. in the case when one decides to fix the notion of "belief" and one wishes to investigate it using the methods of logic).

Of course, as a programmer, I have no problem to make program, that parses the first sentence into the abstract syntax tree, then do some manipulation in this syntax tree (AST) or maybe event do mapping into the syntax tree of another language and then output the other language sentence. So - essentially - this is the question about mapping from the AST of one language to the AST of another language. But if I had intention to make my efforts methodological and scientific, what theories, good practices, approaches should I use? I am afraid to follow the hammering approach of just pure programming in industrial languages.

I have found good article about translating and combining logics (and hopefully - it operates at the level of institutions) https://academic.oup.com/logcom/article-abstract/27/6/1753/2687725 - maybe this is one direction.

• Exactly what do you mean? Can you give a specific example? – Berci May 13 at 15:12
• Since "formal language" is just any set of strings and strings can have pretty arbitrary interpretations, you seem to be asking for theories about mappings from some strings to other strings. That is not really specific enough that there's much to say about them that is not also about mappings in general, but if you can suggest some particular properties that your languages and mappings satisfy, it may be possible to find something. – Henning Makholm May 16 at 11:37
• I added example. – TomR May 16 at 11:50
• Do you mean compilation? – gallais May 16 at 12:51
• Uhh, yes, compiler among logics is the thing I am searching for. Maybe indeed that is just another compiler. – TomR May 16 at 13:06

There are several concepts that might be of interest to you:

• (string) morphisms are just what you ask for: a mapping from strings to strings. The most common question in this context is, whether a given mapping can make a language more complicated or not (preserving e.g. regularity).
• transductions are mappings from strings to strings implemented by some type of automata. The transducer reads one (input) strings and while it processes this string it outputs another string.