robertjford80
- 388
- 0
I want to build some software that will transform a formal language from one set of symbols to another. What would be the best software to do that with. Here is one example of what I want to do:
Say we have
(x'Hy) BC (x'Hz)
I need an algorithm to transform that into:
((w'Hp) IDx'-z) A ((w'Hp) IDx'-y)
What that means is: x becomes y means something identifies x with z after something identifies x with y. where x' y z w' and p are variables - the apostrophe mark is a part of the variable.
Here's how I explain the algorithm:
That which comes before a capital letter is the subject and that which comes after is the object, so in xHy, x is the subject and y is the object. In (xHy) CA (zHw) x is the object of H which is the subject of CA and z is the subject of H which is the object of CA.
Change BC to A
replace the subject of BC with its object and replace its object with its subject, in other words:
(xHy) BC (zHw) would become
(zHw) BC (xHy)
replace H with -
place an ID before the old subject of H, in other words:
xHy would become IDx-y
insert a subject before the ID on both sides of the A and the subject must be the same on both sides of the A. The subject must an H and the subject and object can be any variable so long as it is not used. And it also must come between the left parenthesis and the ID
Say we have
(x'Hy) BC (x'Hz)
I need an algorithm to transform that into:
((w'Hp) IDx'-z) A ((w'Hp) IDx'-y)
What that means is: x becomes y means something identifies x with z after something identifies x with y. where x' y z w' and p are variables - the apostrophe mark is a part of the variable.
Here's how I explain the algorithm:
That which comes before a capital letter is the subject and that which comes after is the object, so in xHy, x is the subject and y is the object. In (xHy) CA (zHw) x is the object of H which is the subject of CA and z is the subject of H which is the object of CA.
Change BC to A
replace the subject of BC with its object and replace its object with its subject, in other words:
(xHy) BC (zHw) would become
(zHw) BC (xHy)
replace H with -
place an ID before the old subject of H, in other words:
xHy would become IDx-y
insert a subject before the ID on both sides of the A and the subject must be the same on both sides of the A. The subject must an H and the subject and object can be any variable so long as it is not used. And it also must come between the left parenthesis and the ID