One trait shared by programming languages and natural languages is ambiguity.
Consider the sentence "I saw Jane Austen using binoculars."
It's relatively clear what this means, right?
Here's me. I have binoculars or perhaps pants, but let's image that they're binoculars.
I'm looking through them. Over here in the distance I see Jane Austen.
We can tell it's Jane Austen, because she's in a park. Mansfield Park, let's say.
I am using the binoculars to see Jane Austen.
However, if you think about it there's an alternative implementation
or an alternative interpretation of this sentence--
another way to look at it that's also perfectly valid.
Here in this alternative interpretation, I see with my naked eye Jane Austen.
She is using binoculars to look at something else.
Maybe she's spying on an Abbey over here. Let's call it Northanger Abbey.
Actually it looks a bit more like a barn that was badly painted, but let's imagine.
Both of the interpretations are correct or the sentence is ambiguous.
It's not clear whether using binoculars modifies Jane Austen.
Is she the person using binoculars?
Or whether using binoculars modifies "I saw." The picture on the left that's how I'm seeing.
It's quiz time--a quiz on ambiguity.
Consider the expression 1 minus 2 plus 3.
Keeping ambiguity in mind, if this were a Python or JavaScript
or even just on the whiteboard or on a piece of paper in mathematics,
this is a mathematical expression. What might it evaluate to?
I've got four choices in this multiple multiple choice quiz.
Check all that apply.
プログラミング言語と自然言語に共通する特徴は
あいまいさです
I saw Jane Austen using binoculars
という文を見てみます
割と意味が明確ですよね
私がここで双眼鏡もしくはズボンを持っています
いや双眼鏡ということにしてください
それをのぞいていると遠くに
ジェーン・オースティンが見えます
公園にいるのでその人物がジェーンだと分かります
マンスフィールドパークです
私がジェーン・オースティンを見るために
双眼鏡を使っています
しかしよく考えてみると
この文には別の解釈が考えられます
別の見方をするとこちらもまた完全に通じます
この解釈では私は
ジェーン・オースティンを肉眼で見ています
彼女は何かを見るために双眼鏡を使っています
おそらくここの修道院を見張っているのです
ノーサンガー修道院ですね
絵が下手なので納屋のように見えますが
想像してください
この解釈はどちらも正しいです
元の文があいまいなのです
双眼鏡を使うことがジェーン・オースティンを
修飾しているのかはっきりしません
双眼鏡を使っているのは彼女ですか?
using binocularsが左の図のように
I sawにかかっているのでしょうか?
あいまいさに関する小テストの時間です
1-2+3の式を考えてください
あいまいさを頭に置きながら
これがPythonであれ JavaScriptであれ
単なるホワイトボード上の計算式であれ
これを数式としてどう評価できますか?
4つの選択肢を設けました
該当するものすべてを選択してください
Um problema que ocorre tanto em linguagens de programação como em linguagens naturais é ambiguidade.
Considere a sengtença "Eu vi Jane Austen usando binóculos"
É relativamente claro que ela significa, não é?
Aqui sou eu. Eu tenho binóculos (ou talvez calças, mas vamos imaginar que isso sejam binóculos).
Estou olhando através deles. Aqui, mais longe, está Jane Austen.
Você pode saber que é Jane Austen porque ela está em um parque -- Parque Mansfield.
Eu estou usando binóculos para ver Jane Austen.
Entretanto, se você pensar bem, existe uma implementação alternativa,
ou uma interpretação alternativa, para esta sentença --
outra maneira de olhar que é também perfeitamente válida.
Aqui está essa interpretação alternativa -- eu velho Jane Austen a olhos nus,
ela está usando binóculos para olhar para alguma outra coisa.
Talvez ela esteja espionando Abbey aqui -- vamos chamá-lo de Northanger Abbey.
De fato, parece mais uma garagem mal desenhada, mas vamos imaginar que seja.
As duas interpretaçãoes estão corretas -- a sentença é ambígua.
Não é claro se `usando binóculos' modifica Jane Austen,
é ela a pessoa que está usando binóculos?
Ou `usando binóculos' modifica `Eu vi'. O desenho da esquerda é como eu vejo.
É hora de uym teste -- um teste sobre ambiguidade.
Considere a expressão `1 - 2 + 3'.
Levando em conta ambiguidade, se isso fosse uma expressão em Python ou JavaScript,
ou mesmo escrita em um quadro ou uma folha de papel,
qual seria o resultado da sua avaliação ?
Eu tenho 4 opções neste teste de múltipla, múltipla escolha.
Marque todas as possíveis.