First, on modifiers of non-head nouns within a noun-noun compound:
Compounds with the structure [[Adj N] N] are pretty common, as in these examples
open source software
big cat sanctuary
new car smell
third place finish
private interest conflict
But since the semantics of [[Adj N] N] is different from [Adj [N N], I don’t think the existence of this alternative analysis of Adj N N strings should get in your way when generating.
For the more objectionable [[N Adj] N] generator outputs like your “car black key”, they will only appear if you gave the generator the less likely MRS for “black car key” where “black” is modifying “car” instead of “key”. But if you want to protect yourself from these odd-sounding outputs in general, you could choose to block the two syntactic rules that license the [[N Adj] N] structures so the generator won’t use them. You do this by adding the following two lines to the end of the file erg/lkb/nogen-rules.set:
n-j_j-cpd_c
n-j_j-t-cpd_c
Then once you recompile the grammar (for ACE) or reload it (for the LKB), you won’t see such outputs from the generator even if the MRS was not quite what you intended. for “black car key”. Note that these two rules are needed for parsing, to account for examples like the following from corpora, often but not always with a hyphen connecting the first noun and the following adjective:
pain-free existence
toll free number
traffic-free road
state subsidized company
user friendly software
avalanche-safe site
water-repellent coat
school-internal shuttle
cost-effective solution
tax deductible contribution
family friendly beach
drought tolerant plants
world-famous actor
color blind policy
power hungry politician
rock steady grip
coal-black night
care-free existence
fur-clad ancestors
While I think these N-Adj nouns should have a somewhat different semantics from the corresponding Adj+N ones, I so far have not landed on a satisfying MRS for them, so the MRSs are sadly still the same, which is why the N-Adj ones get generated from the Adj+N ones. Hence it seems okay for you to block the two rules above for the generator.
On your second topic, constraining passive participles, I think we can do a little better, though the solution is only partly theoretically sound. Since the passive lexical rule has an information-structure effect, there is an ICONS “topic” constraint linking the index of the passivized object with the event of the verb, so when you add this constraint to the input MRS for the generator, you’ll only see passive relative clauses, not the infinitival ones. So in your MRS for “the locked car …” you can add this line after the HCONS constraints;
ICONS: < e3 topic x1 >
where “e3” is the ARG0 of the “lock” EP and “x1” is the ARG2 of that EP. With this added constraint, you won’t generate “the car to lock”.
In order to also block generation of “the car locked”, we have to resort to a less satisfying solution which takes advantage of a slight difference in the MRSs of “locked car” and “car locked”, namely that the grammar constrains the aspect of the ARG0 of “locked” when it’s pre-nominal to be [PERF -] (non-perfect), but for no deep reason fails to assert this of “locked” when it’s a post-nominal modifier. So if you add [PERF -] to that ARG0 in your MRS input to the generator, you won’t get the output “car locked” because the generator has to produce an output which accounts for every element of the input MRS, and the generated structure for “car locked” won’t say anything about the value of PERF for the ARG0 of “lock”. That is, in your example MRS, the EP for lock_v_cause should read
[ _lock_v_cause LBL: h19 ARG0: e3 [e PERF: -] ARG1: i4 ARG2: x1 ]
With these two additions to the MRS you started with, you should see the behavior you want. for passive participles. Note that while “the car locked” doesn’t sound great, this post-modifier structure is not infrequent, as you see in examples such as “the papers rejected were still of good quality” and “the topics discussed cover a wide range of concerns”. I don’t yet have an account of how the unhappy “car locked” is different from the fine “topics discussed”, so the grammar doesn’t distinguish them.
Regarding your third question, about distinguishing “who” from “which” relative clauses, the difference is not one of animacy, but about the human/nonhuman contrast. Note that animals are animate, but (apart from dearly beloved pets) occur with the relative pronoun “which”, not “who”. Unfortunately, the ERG does not yet have a useful treatment of this lexical-semantics property, though I hope to do better once we have finished adding WordNet senses to the ERG lexicon, since we can then do a better job of distinguishing human from non-human senses of nouns at scale. For example, the noun “kid” currently has only one lexical entry, but when enriched from WordNet, there are two, one in the synonym set with “child” and one in the set with “baby goat”, where the class of “child” nouns (and similar human-denoting classes) would have their semantic index be marked as [SORT human] while most other noun classes would be marked [SORT nonhuman].
But at present the only way you might have to restrict generator outputs would be to restrict yourself to a small lexicon of nouns, and manually add the [SORT human] or [SORT nonhuman] constraint to each noun lexical entry. You would also need to add [SORT nonhuman] to the lexical entry for the relative pronoun “which”, though the entry for “who” is already correctly constrained. If you’re working with a bounded vocabulary for your task, this approach might be manageable, but I think it’s the only avenue available for now.