Skip to main content
17 events
when toggle format what by license comment
Apr 29, 2015 at 9:14 comment added Francesco Gramano Can you point out which phrases I can target to make it more clear I wish to cross-compile between Turing-complete programming languages?
Apr 29, 2015 at 8:52 comment added Raphael To be clear: you are only interested in cross-compiling Turing-complete programming languages? Because most statements in your question apply to more languages. Also, there is certainly no way to build such a compiler just from the grammar alone; you need the (formal) semantics. My answer shows that a (semantic retaining) compiler has to exist, but if you want a generator that automatically creates it, that's another thing.
Apr 29, 2015 at 2:05 comment added André Souza Lemos That is material for other questions.
Apr 29, 2015 at 1:51 comment added Francesco Gramano I am aware of that but first I want to know that it's possible with any formalization of semantic rules, then I will figure out which formalization could make it more efficient. E.g., I first considered using SMT formulae as semantic rules, but I am hoping I can avoid the complexity necessary for solving those formulae.
Apr 29, 2015 at 1:43 comment added André Souza Lemos It is much better. By the way, semantic rules are at the core of what you need.
Apr 28, 2015 at 23:49 review Close votes
May 3, 2015 at 3:04
Apr 28, 2015 at 23:38 comment added Francesco Gramano I have edited my question to reflect your concerns. Is it clear now?
Apr 28, 2015 at 23:38 history edited Francesco Gramano CC BY-SA 3.0
added 1272 characters in body
Apr 28, 2015 at 23:19 comment added D.W. Can you edit your question to flesh it out? What kind of grammars did you have in mind? What kind of translation do you have in mind? Can you give an example or two? What properties do you want the translation to have? What's the input to the translater and the output? If the input is two grammars $G_1,G_2$ and a word $w_1$ in $G_1$ and the desired output is a word $w_2$ in $G_2$, would you be happy with a translator that always outputs the empty string (or some fixed string in $G_2$) regardless of what $w_1$ is? If not, why not? As it stands your question is not clear.
Apr 28, 2015 at 22:49 vote accept Francesco Gramano
Apr 28, 2015 at 22:12 comment added Francesco Gramano I'm not asking for an enumeration of CFGs. Two grammars are given as input to the translator generator. The other grammar is simply the other parameter. The parametrized grammars may or may not be related.
Apr 28, 2015 at 17:37 comment added André Souza Lemos I'm puzzled by your question. What is this "other grammar"? There is an infinite number of CFGs that are equivalent to any given CFG (in that they define the same language). Are you asking if it is possible to enumerate this set of grammars? Are you asking if it is possible to produce an algorithm to verify if two CFGs are equivalent? Are you asking if, given two equivalent grammars, it is possible to convert a derivation tree obtained with the first into one that could be obtained with the other?
Apr 28, 2015 at 17:37 comment added svick There is a term for translating from one formal language into another: compilation. It's usually anything but automatic, for good reasons.
Apr 28, 2015 at 17:11 history edited Raphael CC BY-SA 3.0
edited title
Apr 28, 2015 at 9:20 answer added Raphael timeline score: 5
Apr 28, 2015 at 6:42 answer added Jake timeline score: 6
Apr 28, 2015 at 5:49 history asked Francesco Gramano CC BY-SA 3.0