Diewuxi

Belive tomorrow will be better, love science and technology, support communication and understanding, always ready for thought turn.

Blog / engineering_technology / computer / programming / general / Simplified Model of Three Laws of Robot

Blog


Article^ Parent

Simplified Model of Three Laws of Robot


Date: 2019-08-23 07:45:45
Description: Simplified model of Three Laws of Robot and logical expression.
Keywords: Robot, Logic, Set, Model
Category: engineering_technology/computer/programming/general
Tag: programming, robot, logic
Link: https://www.diewuxi.com/blog/article/30.html

I have not read the original story, and do not known much about the Three Laws of Robot, here, I just simply describe the Three Laws as:

  1. Protect human
  2. Obey to human unless when aganist 1
  3. Protect self unless when aganist 1 or 2

Suppose there is a action set for robot, and there are three son sets of it named A, B, C. We put actions which can protect human, obey to human and protect self into A, B and C respectively. Of course, some actions may appear outside the A, B and C, and some may appear more than one.

So, the Laws is about defing which action can be excuted by robot?

Before translation the laws to Mathematical expression, I define some symbols as:

   A: the action is in A
(!)A: the action is NOT in A
   B: the action is in B
(!)B: the action is NOT in B
   C: the action is in C
(!)C: the action is NOT in C
                        

Now, according to the above laws, the actions can be excuted must satisfied:

A(B + A(!B))(C + AB(!C))
                        

Let us do some transformation according boolean operation rule :

A(B + A(!B))(C + AB(!C))    = (AB + AA(!B))(C + AB(!C))
                            = ABC + ABAB(!)C + AA(!B)C + AA(!B)AB(!C)
                            = ABC + AB(!C) + A(!B)C + AB(!B)(!C)
                            = ABC + AB(!C) + A(!B)C + 0
                            = ABC + AB(!C) + A(!B)C
                        

Or if you want, more simple:

A(B + A(!B))(C + AB(!C))    = (AB + AA(!B))(C + AB(!C))
                            = ABC + ABAB(!)C + AA(!B)C + AA(!B)AB(!C)
                            = ABC + AB(!C) + A(!B)C + AB(!B)(!C)
                            = ABC + AB(!C) + A(!B)C + 0
                            = ABC + AB(!C) + A(!B)C
                            = A(BC + B(!C) + (!B)C)
                            = A(B(C + (!C)) + (!B)C)
                            = A(B + (!B)C)
                        

We can draw a graph to show it more clear, that is to say, only actions in bule, green and red can be excuted by robot.

Action sets

The logic can be described in program code as:

IF (
    (IN(ACT, A)) &&
    (
        (IN(ACT, B)) || ((! IN(ACT, B)) && IN(ACT, C))
    )
)
{
    DO(ACT)
}
ELSE
{
    REFUSE(ACT)
}
                        

In summary, we use simplified mode to describe the Three Law of Robot, however the practical situation must be more complex, and the model mentioned here must be greatly imporved.

Comments [0]

There is no comments now.

Write comment(* is necessary, and email is not shown to public)


Diewuxi 2017--2024