[Translation from English to Japanese ] Inverting Logical Expressions with De Morgan's Laws A Javascript expression ...

This requests contains 1402 characters . It has been translated 4 times by the following translators : ( ysasaki , matsu11765 ) and was completed in 1 hour 16 minutes .

Requested by xargs at 28 Nov 2013 at 19:24 2357 views
Time left: Finished

Inverting Logical Expressions with De Morgan's Laws

A Javascript expression will sometimes be more intuitive (and easier to understand) when written a certain way - but we may actually need the inverse of the expression. For example in listing 1 our code only needs to react if (x && y) is false. We need to invert the expression.
De Morgan's laws describe how to invert a logical expression. In listing 2 let's look at De Morgan's Laws in Javascript syntax.

The rule is to invert each logical term and invert each logical operator.

In listing 3 we invert the expression from listing 1 by applying De Morgan's Laws.
Sometimes a logical term is more complex than a simple boolean variable.

ysasaki
Rating 67
Translation / Japanese
- Posted at 28 Nov 2013 at 20:12
ド・モルガンの法則による論理表現の反転

Javaスクリプトの表現は、適切な方法で書かれた場合には、より直感的な(そして理解しやすい)ものとなる。しかし、表現の反転が必要となる場合もあるかもしれない。例えば、リスト1において、我々のコードは、(x && y)が偽の場合にのみ反応を要する。表現の反転が必要である。
ド・モルガンの法則は、論理表現を反転する方法について述べている。リスト2において、そのJavaスクリプト構文を見てみよう。

そのルールは、それぞれの論理記号とオペレータを反転させる、というものである。

リスト3で、ド・モルガンの法則を用いて、リスト1から反転を行っている。
時には、論理記号は、単純なプール変数よりも複雑になることがある。
xargs likes this translation
★★★★☆ 4.0/1
matsu11765
Rating 51
Translation / Japanese
- Posted at 28 Nov 2013 at 20:13
Re:

デ・モーガンの法則による反転論理的表現

ジャバスクリプトの表現は、一定の方法で言及されるとき、時にはより直観的になるでしょう(そして、理解するのがより簡単になるでしょう)−しかし、我々は実は、逆の表現を必要とするのかもしれません。例えば、1をリストアップする際に、こちらのコードが、もしxとyのみに反応するのであれば失敗してしまいます。我々は、表現を逆にする必要があります。
デ・モーガンの法則は、論理的表現をいかに逆にするかを著しています。
2をリストアップする際、ジャバスクリプトの統語論をもとに、デ・モーガンの法則を考えてみましょう。

法則は、それぞれの論理的項と論理演算子を逆にすることです。

3をリストアップする際には、デ・モーガンの法則を適用することによって、リストアップした1の表現を逆にします。
時折、論理的項は単純なブール変数よりも複雑になります。
xargs likes this translation
★★★☆☆ 3.0/1

A logical term may be a relational expression such as (p < q) from listing 4. We must invert the relational expression as a whole.
Let's invert the expression step by step.

Note that this expression is of the same form as our original expression in listing 1 (x && y) where x is replaced with (p < q) and y is replaced with (r != s). De Morgan's rule is to invert each logical term and invert each logical operator.
Inverting the first logical term (p < q) we get (p >= q)
Inverting the next logical term (r != s) we get (r == s)
Inverting the logical operator && we get ||
Our result is in lst5.
So if you find yourself struggling with a Javascript problem, pick up an old math textbook - your solution is probably in there.

ysasaki
Rating 67
Translation / Japanese
- Posted at 28 Nov 2013 at 20:39
論理項は、リスト4の(p < q)のように、関係を表現するものである場合がある。これについては、その全体を反転する必要がある。この表現を、ステップを追って反転してみよう。

この表現は、リスト1の元の表現である(x && y)において、xを(p < q)に、yを(r != s)にそれぞれ置き換えたものと同じであることに着目しよう。ド・モルガンの法則は、それぞれの論理項と演算子を反転することであった。
第1項の(p < q) の反転により、(p >= q)を得る。
次の項の(r != s)の反転により、(r == s)を得る。
演算子の&&の反転により、||を得る。
その結果が、リスト5である。
以上より、もしJavaスクリプトの問題に直面したら、昔の数学の教科書を持ってこよう。答えは恐らくそこにあるだろう。
★★★★★ 5.0/1
matsu11765
Rating 51
Translation / Japanese
- Posted at 28 Nov 2013 at 20:29
Re:

論理的項は、例えば4をリストアップすることから、(p<q)のような相関的な表現になるかもしれません。
我々は、全体を通じて相関的な表現を逆にしなければなりません。
段階的に表現を逆にしてみましょう。

リスト1(x && y)と同じような独自の表現である場合、xの位置は(p<q)と置き換えられ、yは(r != s)と置き換えられます。
デ・モーガンの法則は、それぞれの論理的項と論理演算子を逆にすることです。
初めの論理的項である、(p<q)と(p≧q)を逆にします。
次の論理的項である(r!=s)と(r ==s)を逆にします。
論理演算子である、&&と||を逆にします。
リスト5が我々の結果です。

だから、あなた自身がジャバスクリプトの問題と戦っていることに気づくならば、古い数学の教科書を拾ってみてください。あなたの求めている解決策はそこにあるでしょう。
★★☆☆☆ 2.0/1

Try “Standard Translation” for specialized translation such as business purpose.

  • We can receive files such as Word, Excel, and PowerPoint.
  • There is no maximum word limit, and we deliver translations fast.
  • Higher-skilled translators will work on your request.

Feel free to contact
anytime