levo

Programming Paradigms and Translators

Ambiguity in natural language and unambiguous notation

  • 3 things to know
  • A2 Unit 3

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.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

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

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

Fetch, , execute.
decodecompilestore

Blank Blitz makes facts automatic

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

AEncryption is reversible.
BThe stored form could be decrypted.
CA hash cannot be reversed.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

A bit is a single binary digit.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

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.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

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