levo

Programming Paradigms and Translators

Ambiguity in natural language and unambiguous notation

  • 3 things to know
  • A2 Unit 3
Start revising · £5/month

Overview

Lexical ambiguity, sentence made ambiguous by a word having two meanings and structural ambiguity.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Evaluation

How is a stack used to evaluate an expression written in reverse Polish notation?

Key term

What is meant by lexical ambiguity?

Key term

What is meant by structural ambiguity?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    Why must a programming language have an unambiguous syntax?

    Model answer

    Every valid program must have exactly one meaning, because the translator has to choose one sequence of machine instructions and the programmer must be able to predict what will run.

  2. 2

    What is meant by lexical ambiguity?

    Model answer

    Lexical ambiguity arises when a single word carries more than one meaning, so a statement containing it can be read in more than one way.

  3. 3

    Give an example of a sentence made ambiguous by a word having two meanings.

    Model answer

    The sentence she left the bank can mean that she left a financial institution or that she left the edge of a river.

  4. 4

    What is meant by structural ambiguity?

    Model answer

    Structural ambiguity arises when the individual words are clear but can be grouped in more than one way, and each grouping gives a different meaning.

  5. 5

    Give an example of a sentence that is ambiguous because of the way its words group.

    Model answer

    The sentence I saw the man with the telescope can mean that a telescope was used to see him or that he was the one carrying it.

  6. 6

    Why would the expression 6 − 2 × 3 be ambiguous without a rule of precedence?

    Model answer

    Taken strictly from left to right it gives 12, while doing the multiplication first gives 0, so a rule is needed to fix which reading is intended.

Other ways to work this

The same content, four other ways.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Hardware: Architecture, Memory and Storage
Networks and Data Transmission
Logic Gates and Boolean Algebra
Data Representation and Data Types

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

Fetch, , execute.
decodecompilestore

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

A bit is a single binary digit.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Programming Paradigms and Translators, on a schedule.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.