## Proper algorithm for resolving ambiguity in grammars via enforcing associativity and precedence rules

I was told there is a algorithm that always resolves ambiguity for grammars that have issues with precedence and associativity. I know ambiguity in general is undecidable, so I only want to resolve those two sources of ambiguity (precedence and associativity).

As far as I know from reading this course, the heuristic I have developed are the following:

• higher precedence = appear lower in the tree always (so they are never produced by any rule bellow a symbol that is higher up). A different way to understand this is; higher precedence operators are evaluated first, so they appear lower in the parse/computation tree.

• right-associativity = when two operators of the same type fight for an argument if its right associative then the op on the right wins. Thus, this means that immediate recursion of the same production rule generating that op must always appear on the right (and that symbol/op can never be produced on the other side/left).

however, these rules must be incomplete or slightly wrong because when I was trying to resolve a “tricky” grammar I got wrong answers or couldn’t make sense of the right solution.

For example, imagine we have this:

<exp> ::= 0 | 1 | b<exp> | <exp>a | <exp>m<exp> 

and we want to enforce:

Right associativity for m and the following precedence inequality is the one we want: $$b >_p m >_p a$$ which means b has higher precedence than m has higher precedence than a.

the solution given was:

<exp> ::= <no a m> | <not m>m<no a> | <exp>a <no a> ::= <no a m> | <no a m>m<no a> <not m> ::= <no a m> | <exp>a <no a m> ::= b<no a m> | 0 | 1 

However, according to the “rules” I came up this must be wrong. But since its the instructor solutions to its safer to assume I am wrong and need to refine my understanding.

The reason I think its wrong is that the first rule there is a <not m> to the left of m. That means we can generate an a. But a has lower precedence than m, so according to my rule it must never appear bellow the parse tree of m, but it does. So it seems I do not understand precedence properly or the algorithm to enforce it.

My understanding is that precedence means that if you have higher precedence then you bind tighter than other operators, so you steal the arguments from others. I was also told that means that you appear lower in the parse tree, which intuitively makes sense. But that’s too vague for me to really unambiguously and formally define a way to resolve precedence in any grammar (assuming I only want to resolve precedence and associativity only and solving that “solves the grammar”).

So is my understanding correct? Can someone help me make my algorithms for resolving these issue more rigorous (and ideally bullet proof)?

Note, I am aware that resolving ambiguity is undecidable in general, but I was told precedence and associativity is not undecidable assuming thats all we want. So thats what Im looking for.

Cross-posted:

• https://www.quora.com/unanswered/What-is-the-proper-algorithm-for-resolving-ambiguity-in-grammars-via-enforcing-associativity-and-precedence-rules
• https://www.reddit.com/r/ProgrammingLanguages/comments/e0lz9o/proper_algorithm_for_resolving_ambiguity_in/

## My root domain is not resolving to my server, but the www. subdomain works fine

I have the DNS configured like this:

So, my domain example.mx is working as http://www.example.mx. With www there is no problem, but with non-www like http://example.mx it’s not working.

As you can see, my DNS records are pointing in example.mx record to the NS ns1.example.mx. Actually, ns1.example.mx is pointing to my server’s IP.

What could be the problem which is causing http://example.mx not to work while http://www.example.mx does work?

## Unity not resolving android dependencies and only returns resolution success

I just added some android plugins like in app purchase and advertisement and game analytics.

As i remember in previous installations unity downloaded many libraries for plugins on resolve. Now it only returns “resolution success” with no library added and it doeant work in final build.

Can any one tell what is the problem??

## people picker not resolving names correctly

We have our sharepoint server in a domain named DMZ. Our AD users are in another domain, say domain ACME. In the DMZ domain we also have external SP users. All of a sudden the people picker will resolve the DMZ names properly but not the ACME names.

If I open the people picker user search, only DMZ users show up. I have also verified there is still trust between the servers/domains

Any help is appreciated!

## Resolving windows 7 resume

I have a windows 7 desktop. Today when I tried to start it. A black screen appeared. With option

1) continue with resume data 2)delete restoration data and proceed to system boot menu

But the keyboard and mouse is not working

I tried myself with this methods 1) removed the motherboard battery and put it again. And a screen appeared to bios setup. I tried all options. But when the PC rebooted. The same screen appeared

I have read in posts that it is because of corrupted  hiberfil.sys file. Now my question is if I use my hard disk enclosure and use my current hard disk as an external hard disk on an another computer. And from there I delete the  hiberfil.sys file. 1) will it delete all the files on my harddisk And 2) will I be able to boot my PC when I put it in previous pc

## Resolving a system of linear inequalities

How can I solve (by hand) the system of inequalities \begin{align} a+10b+c&\leq 0\ a+15b+4c&\geq 0\ a+12b+c&\geq 0\ a+9b&\geq 0 \end{align} most efficiently?

## Summary

I can only resolve hostnames from and for the default namespace. Requests from and for other namespaces, like kube-system, return NXDOMAIN from coredns. Is there some authorisation that needs to be done?

## Details

I have set up a learning cluster by following Kubernetes the Hard Way except using VirtualBox instead of GCP. All else appears to work except DNS queries in non-default namespaces. More concretely:

• Works (run from default namespace): kubernetes.default
• Does Not work (run from kube-system namespace, get NXDOMAIN): kubernetes.kube-system

### Configuration

I have upgraded to Coredns 1.12 because 1.2.2 failed to resolve anything around 50% of the time. With 1.12 requests resolve 100% of the time (if in the default namespace).

I had to edit the config (in the configmap) by removing the “loop” and “proxy” (replace proxy with forward) plugins to get it working. My config is as follows:

    .:53 {         forward . 192.168.99.254:53 # dnsmasq on host machine         log         errors         health         kubernetes cluster.local in-addr.arpa ip6.arpa {           pods insecure           upstream           fallthrough in-addr.arpa ip6.arpa         }         prometheus :9153         cache 30         reload         loadbalance 

### Troubleshooting

Following this guide I see:

The pods are running OK

$kubectl get pods --namespace=kube-system -l k8s-app=kube-dns NAME READY STATUS RESTARTS AGE coredns-6f8fb48d88-dz9cd 1/1 Running 0 14m coredns-6f8fb48d88-s5rvp 1/1 Running 0 14m  Checking the console I see healthy logging 2019-05-24T04:41:13.990Z [INFO] plugin/reload: Running configuration MD5 = 7c717fabd578b2514cf60fee426fabc6 2019-05-24T04:41:13.992Z [INFO] CoreDNS-1.5.0 2019-05-24T04:41:13.992Z [INFO] linux/amd64, go1.12.2, e3f9a80  The DNS service is available: $   kubectl get svc --namespace=kube-system NAME             TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)         AGE kube-dns         ClusterIP   10.32.0.10   <none>        53/UDP,53/TCP   18d 

The endpoints are exposed:

\$   kubectl get ep kube-dns --namespace=kube-system NAME       ENDPOINTS                                                     AGE kube-dns   10.200.21.33:53,10.200.22.17:53,10.200.21.33:53 + 1 more...   18d 

As mentioned above, DNS works but only from the default namespace.

## Explicit, small resolving sets for Hamming graphs

Definition. Let $$G = (V;E)$$ be a finite, undirected graph. $$R = \{r_1, \ldots, r_k \} \subseteq V$$. $$R$$ resolves $$G$$ if $$V \to [0, \infty]^k, v \mapsto (d_G(v,r_1), \ldots, d_G(v, r_k))$$ is injective (where $$d_G$$ is the graph metric associated to $$G$$).

The metric dimension of $$G$$ is the cardinality of the smallest resolving $$R \subseteq V$$.

Definition. Let $$d,q \in \mathbb N$$. The Hamming graph $$H(d,q)$$ is the graph with vertex set $$\{1, \ldots, q\}^d$$ in which two vertices $$u = (u_1, \ldots, u_d), v = (v_1, \ldots, v_d)$$ are adjacent iff they differ in a single spot, i.e. $$| \{ i \mid v_i \neq u_i \} | = 1$$.

It is known that the metric dimension of $$H(d,q)$$ is $$\frac{(2 + o(1)) \cdot d}{\log_2(d)}$$ (1).

I’m interested in explicit (2) resolving sets for Hamming graphs in the region of $$d \sim 1000$$ that come reasonably close to their dimension metrics.

Unfortunately, since this lies outside of my area of expertise and I wasn’t able to come up with an answer in the literature, I don’t know whether this is even remotely possible.

(1) Since I’m unfamiliar with some of the notation in the published literature, I’m not 100% sure about this.

(2) as in computable with current day technology — ideally already known and publicly available

## Ubuntu resolving host takes more time

I’m using ubuntu 16.04 and browsers (both chrome and firefox) take about a minute to resolve a host. If I type the ip address of a web site in address bar , that web site instantly appears. For example if I type 172.217.9.142 I see google.com instantly but If I type google.com it takes time to reach to the site. I have updated my dns to google public dns servers. What could be the issue ? Any help is appreciated. Thank you!

## https version of web application is not resolving?

I am using Heroku to host which provides me a nice https: address:

https://some_random_string.herokuapp.com/ 

I use Namecheap to setup my DNS and I do this using:

CNAME Record | www | www.my_domain.herokudns.com. 

I found this information using heroku domains in the macOS bash console.

www.my_domain | CNAME | www.my_domain.herokudns.com

Everything works fine except the s gets dropped off the Heroku address when I use my custom domain.