A regular language derived from another

This is similar to a previous question I asked, but doesn’t seem aminable to the same technique. Given a regular language $ A$ , show the following language is regular: $ $ \{x|\exists y \; |y| = 2^{|x|} and \; xy \in A\} $ $

I’m aware of the notion of regularity preserving functions, and that it would suffice to show that $ f(x) = 2^x$ satisfies the property that for an ultimately periodic set $ U$ , $ f^{-1}(U) = \{m|f(m) \in U\}$ is ultimately periodic. I’m struggling to $ f$ has this property, but the book from which this comes implies a solution not using this is possible. It appears to be looking for a construction.

I can see that by repeated application of the idea behind the Pumping Lemma, if $ A$ has DFL with $ k$ states, that for any $ x$ with $ |x| \geq k$ then $ $ \exists y \; |y| = 2^{|x|} and \; xy \in A\ \implies \exists y \; |y| \leq k \; and \; xy \in A\ $ $

But this doesn’t give anything going in the opposite direction, that shows that some suitably short $ y$ guarantees the existence of a $ y$ of the required length.

Any help in solving this, or hint at how to progress would be very helpful.

Can this language be called regular?

Recently, I was facing some problems in effectively proving the following :

Consider the alphabet Σ ={0,1,2,…,9,#}, and the language of strings of the form x#y#z, where x,y and z are strings of digit such that when viewed as numbers, satisfy the mathematical equation x+y=z.

Is this language regular and why ?

I was trying to apply the Pumping Lemma, but am unsure of how to complete the proof. Could anyone please help ?

What language would be appropriate for texts to be written in about Thor (Forgotten Realms)?

In our LMoP campaign, there is a Cleric whose deity is Thor. He has come across several texts that discuss Thor (myths and religious texts).

What language would those texts most likely be written in?

(I don’t know if this is helpful context, but he is a Wood Elf).

Would Illuski (Nordic) languages be appropriate here?

Is Giant Owl an eligible language to be learned with the Linguist feat?

The Giant Owl can speak the language Giant Owl:

Languages Giant Owl […]

Notably, this language does not appear on any of the language tables in any sourcebook, but it does appear on the statblock of the Giant Owl and the Skeletal Giant Owl

The second point of the linguist feat says:

You learn three languages of your choice.

Is Giant Owl an eligible language for the feat, or does the feat only allow choosing a language from one of the language tables?

How to convert recursive language grammar tree into automaton for optimal parsing?

So I have a definition of a sort of grammar for a programming language. Some aspects are recursive (like nesting function definitions), other parts of it are just simple non-recursive trees.

Originally I just treat this sort of like a Parsing Expression Grammar (PEG), and parse it using recursive descent. But this is kind of inefficient, as it sometimes has to build up objects as it’s parsing, only to find 10 calls down the road that it isn’t a good match. So then it backs up and has to try the next pattern.

I’m wondering what the general solution to this is. What can be done to create the most optimal algorithm starting from nothing but a tree-like data structure encoding the grammar?

Can you process the tree-like, recursive-ish BNF PEG data structure in a while loop, rather than using recursive descent? Better still, can you convert the data structure into a sort of automaton which you can (in some simple way) transition through, to parse the string without having to go down a bunch of wrong paths and generate stuff you only have to soon throw away if you find it’s a mismatch? Or if not, is there anything that can be done here with automata?

Sorry for my terminology (BNF vs. PEG), I am not using it exactly. I just mean I have a grammar, which is context-sensitive which falls outside the scope of either of these. So I am picking one or the other to simplify this question for the purpose of this site, even though I’m not 100% sure what the difference between BNF and PEG are at this point.

How can I efficiently construct a CFG from a language

I am new to CFG’s and automata in general and I came across an exercise where I needed to construct a CFG for the language {a^m b^n | n <= m + 3}.

So m can be infinitely bigger than n but n can only be up to 3 more bigger than m and they can be the same. I have no idea how to make a CFG for this.

What I came up with was:

S -> AB | _  A -> a | aa | aaa | C | _  C -> aC | a | _ B -> bB | b | _ 

But I think this is not even close…

Any help/tips/advice would be much appreciated!

What’s the internal language of the opposite of a Cartesian closed category?

I have heard the simply typed lambda calculus is the internal language of Cartesian closed categories.

What’s the internal language of the opposite type of category?

I have the intuition the opposite category would correspond to continuation passing style or pattern matching but the opposite typing rules seem very strange and hard to figure out.

Programming language designed to prevent security issues from occurring? [closed]

I’m working on creating a new programming language and trying to find that first niche to tailor it to. Would you appreciate a programming language that would make it as easy as possible to encrypt & salt all information stored in databases & files and sent over the network, etc?

I already have it so that it’s as fast as C++ but guaranteed to be memory and thread-safe without the programmer having to think twice about it.

The idea is that you write it quickly and productively and don’t have to think about the security, because it’s already baked into the end product.