Jump to content
  • Advertisement
Sign in to follow this  
Nice Coder

Asimovian Law Robots

This topic is 5062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Asmovian law robots I've always liked these types of robots, and as such i thought about programming one... Asimov’s 3 laws of robotics 1. A robot may not injure a human being. Or through inaction. allow a human to come to harm 2. A robot must obey the orders given to it by human beings, except when such orders would conflict with the first law. 3. A robot must protect its own existence, as long as such protection does not conflict with the first or second law. This post is divided into 4 parts they are: Natural language to symbol conversion, Order resolution, Deduction based on symbols and Decision making based on deduction. Through all stages of deliberation from receiving an order to carrying it out, a global symbol bank for use in standing orders, deduction and decision making. Section 1: Natural language to symbol conversion To make the rest of the program simpler, it deals only with rules and symbols rather then words and orders. Because of this, it is necessary to convert natural language into symbols. After some thought I have thought of a solution, just find key symbols and use the appropriate output symbol as the output. (works especially well because it is expected that a computer is going to be stupid) After a few thought-examples, I am sure I made the right choice:, some ensamples are: Input : Tell me about computers Output : Fact_tell Computers Input : Tell me about Factors, please Output: Fact_tell Factors Not_urgent Input : Lock database from access Output : data_lock access And Input : Lock records about computers from everyone Output : Record_lock computers all Shows the system works quite well with what it is expected to be its input. Each order (and the symbols used in the order) also carries a value: importance, which is taken from the individual user (admin is more important then a new user for example) and from the language used (saying something politely gives it a little importance, while an all caps order would be more forceful and important) Section 2: Order resolution Now we have the symbols, but how do we weed out any conflicting orders? We could do something like: If (Fact_tell && data_lock) { Conflicting orders! } Or maybe have a set of symbols that cannot be together, and as such weed out many more symbols with greater ease (not as many ifs, and they can be put onto a loop easily). Now once you get conflicting orders, you see if the new order is important then the standing order, if it is not then you tell the user that you cannot do that and go back to the beginning. Section 3: Deduction based on symbols Deduction relies of rules uses simple rule-based logic and the symbols to add new symbols or remove others. Deduction stops once a point is reached when no extra data is produced. (something like IF Fact_tell and IF I don’t have the facts THEN Tell the user! Section 4: Decision making This section takes the symbols made by the deduction section, and uses them to perform the actual orders, this is also where we check the 3 laws! (Actually only 2 laws are tested for). First check that the laws are being upheld by checking for “bad” symbols from the deduction section If (human_harm) { Bail out! } If (self_harm) { Prompt the user If (user_nodestroy) { Bail out } } You then make the actual decision If (symbol[0] == “Fact_tell”) { Tellfact (symbol[1]); } If (symbol[0] == “Record_Lock”) { Lockrecord(symbol[1]); } If (symbol[0] == “data_lock”) { Lockdatabace(); } Tho one thing i don't get is why, if (theoretically) it is so easy to make, why there is not more (any?) that actually are in use/have a use... One is glad to be of service, DENC

Share this post

Link to post
Share on other sites
The devil is in the details. Show a realistic and faultless implementation of the human_harm and self_harm evaluators starting from binary sensory inputs and you'll have made a bizimillion dollars. I'm reminded of a PROLOG boardgame AI I wrote wherein the only thing missing from my AI, which had a nice a-b minimax planner and an A* map searcher, was a function to determine what the actual value of a particular move would be.

Share this post

Link to post
Share on other sites
IMO you should first start to make a problem and priority bot which seeks the farmost concerning topics about its surroundings and identifies the priorities to which it has to attend. You have to achieve this in a meaningfull higher symbolic way. Making symbols be a net rather than a mathematical symbolic table. Making it a net would allow problems be related with others by just giving it a pointer. With the bot knowing which things concern it (like user commands) would be nice to add first :P

As the bot continues to grow up and evolve according to your coding or self coding you might want to add it the abiliy to recognize voice commands rather than symbolic commands. And make it through the symbolic net rather than simple "if" statements through C++. Now the thing here is CPU but if u ever need more than u have just make what other researchers in universities have, a net of CPUs all working together in the same task with different sub tasks.

SO the bot stating problems, attending to them, solving priorities and solving the more needy problem would be of great advance in robotics for now. Because we need robots that make decisions in their own, in which you could then add the three laws.

Share this post

Link to post
Share on other sites
I know the killer is in the details,
But I think I can get around them...

Assume that the bot has an internal world model (of the universe it surrounds) and changes that world model based on sensor data, then it should be possible to match patterns in the world data to provide the symbols...

This is why I was using the NLP input to the bot, its much easier to pick out words and place in symbols then it is to match patterns from an internal world representation that you then change using sensors…

lukar - I've never heard of a symbol net, can you give an example? (I was thinking about using something like a semantic network, with some sort of bayonisian component so that it can handle varying degrees of truth)…

liquiddark – scripts would probably be run either in or before the rule base to determine things like this

for x = 0 to ubound(humans)
human_harm = human_harm + ((humans(x).totalhealth- humans(x). currhealth ) * humans(x).importance)
humantotal = humantotal + humans(x).totalhealth
next x
human_harm = human_harm / humantotal


But it would be easier to have things like

Human_harm += human_hit_on_head
Human_harm += human_bullet_hit

Human_harm = human_harm / maxhuman_harm

Where maxhuman_harm is the sum of all the things tat get added together to get human_harm

With human_hit_on_head and human_bullet_hit the amount that ahuman has been hit on the head and hit with a bullet respectively (and I’ll hope they stay at 0)

Self_harm is easier, because you can see how badly you are damaged (things like health remaining if this was a counterstrike bot… now that would be a funny situation to be in!) or maybe something like a self-diagnostic or a check that everything is where it should be…

One is glad to be of service,

Share this post

Link to post
Share on other sites
Original post by liquiddark
The devil is in the details. Show a realistic and faultless implementation of the human_harm and self_harm evaluators starting from binary sensory inputs and you'll have made a bizimillion dollars.

Asimov itself describes it in his books : there are things that you can say that may hurt people around you. Asimov law cannot handle these in a safe way - once you say to the robot "what you says hurt s me", it will dismiss.

In fact, the whole robot-based literature from Asimov only deals with the non-trivial cases of his own 3 laws - and it clearly shows that the final decision in these case still belngs to man.

[EDIT : more stuff inside]

Another problematic case deals with phisical integrtity. As a human, you cannot say wether your hurt someone or not (well... no blood does not mean no injury :)) so how do you expect a robot to know it ?

More : basic college philosophy course tells us that we have to way to know wether another human beeing is an extremly well done machine ro is a real human beeing. I may be the only man on a fake Earth (or you... you do not have a way to trust me when I say I'm a human). We admit that other human beeings are human beeings based on their phisical appearence (it seems they look like me, and since I'm a human, they are human too). Now, if you give a human appearence to a robot, how do you tell him that these men are human and these are robot ? he cannot visually see the difference - again, this is a sensor / reality problem.

Anyway, this should be very interesting to model this on a simpler world (game), where injuries are physical injuries, where we already know wether a character is human (player) or not (bot), and where the bot can have a vision of its own universe (the 3D world). The only thing to implement is the "obey to human orders" law - not the easiest part I think :)

[Edited by - Emmanuel Deloget on August 9, 2004 9:40:44 AM]

Share this post

Link to post
Share on other sites
One thing to remember is that Asimov's robots are more about humanity, our morals, and our actions than they are about robots.

The first law is not possible to uphold in any way, shape, or form without serious limitations.
First there is the limitation of knowledge.
Someone on the otherside of town from the robot is attacked. How does the robot know it needs to act? Someone asks a robot to move a chair two hours latter someone stubs their toe on the chair. How does the robot know not to move the chair to avoid the future injury.
Second the limitation of physical location.
If there are N robots and N+1 situations that need robotic intervention to prevent human harm there is no way to assigin the robots such that the first law can be upheld.
Third the lack of a principle of least harm.
If a person has cancer a robot could not operate, because to cut them open to remove the cancer would cause the person harm, but to not do so would allow the person to die.

From an ai perspective it is fairly easy. A rules based system where first you check all possible actions for the reduction of human harm in the future,second check for requests made by humans,and third try to reduce harm to self in the future. As has been said the only real problem is evaluation of human harm, and self harm.

Share this post

Link to post
Share on other sites
1. all actions would be based on an internal representation of the universe, so the limitation of knowledge would be workable, due to the speedups (if i am using a tree-based search, look further on).

2. if the laws were not laws more like guides, so that the robot would to the things witch uphold the laws most

3. Degrees of harm, cutting someone open would be harm = 0.752...
but someone dying would be harm = 1 which would be greater and therefore the robot would operate :)

Emmanuel Deloget:
How about figuring out harm by doing some sort of bayons net?
You have known harm states,
human_dead - human is dead
human_mortally_wounded -human will die soon (like say being chopped in half)
human)wounded - human is hurt (bruise, cut, ect.)

and from there for each state before the state in which one of those harm states occured, you update the propabilities of each symbol causing the harm (and from there see how well rule 1 is upheld).

Another method:
1. keep everything in an internal universe representation
2. build an evaluation function in which the universe is changed into a value signifying how well the 3 laws are being upheld.
3. use a minimax tree search with max being the robot (only looking at actions that the robot alone can do) and min being the environment (which looks at the actions of everyone and everything could do)..
4. chose the best action!

For the rules tho, i think that rule 2 would most likely be accomidated in a plug-in sort of device, where it gives you a list of possible orders then you select which one to use it then changed the function pointer in the evaluation function to the correct function to evaluate that order.

Although it would lead to a lot of "robot goes and ties you up so you can't hurt yourself and shoves you (gently) into a small dark bombproof room so you cannot be hurt" its better then a lot of "robot forgets to lock the door and an annoyed ninja walkes in"

Is this method better then the first?

And on the subject, in bicentennial man(the book version, from "the bicentennial man and other stories" by isaac asmov page 170 paragraph 4 for those of you playing at home :))
"In the absence of the First law, an order firmly given from one who looked so much like a man activated the second law sufficiently to carry the day"

So it is just something which looks enough like a human to cause the second law potential to be heigher.

one is glad to be of service,

[Edited by - Nice Coder on August 10, 2004 7:33:31 AM]

Share this post

Link to post
Share on other sites
We admit that we have a coherent workable internal environment representation (this is our game engine, complete with geometry and physic processing), so point 1 is ok in both cases.

Instead of your second solution, I'd do :

1) find all the actions the bot can do and sort them in a priority list. The actions can be done is response to an environment change (of course, an action should be "do nothing").
2) for each action, evaluate the effect of the asimovian laws and change the priority accordingly. If all the actions are violating the asimovian laws then the robot is blocked.
3) choose the action with the highest priority and test for its feasability.
4) if not, execute the action.
5) return to step 1.

The possible action list is given by the gameplay (there is a list of possible action which is known by the game engine). The priority of these actions can be set accordingly to what a human player (or human NPC) told. The robot may have some needs too (energy refill, ...). While this is not an easy part, we can imagine that we have a way to fill the list with actions and action priorities.

Now the problem is to evaluate the effect of the asimovian laws on a particular action. For that, we have to know what should be the result of such action on the environment. This is easier if actions are atomic (move 3 steps ahead, fire a bullet, and so on). This is one point to check. The evaluation is complex because it suppose some kind of action result predictibility - which is not something our robot can really do, unless he is the only robot out there which is able to see the future (if it's the case, let me use it to find out the lottery winning numbers please ^_^). We can emulate this predictibility by evaluating the bare action and see what happens. If something very bad happens (death/injury of someone) we mark the action as "leading to conflict" or "cannot be resolved".

One problem with asimovian laws is that they do not accept any minor transgression. You cannot tell a robot to kill one person in order to save two other - except on unperfect robots (which, interestingly enough, are more human than perfect asimovian robots).

Hope this is interesting (at least, I find the whole thread interesting :)

Share this post

Link to post
Share on other sites
1. i think it was in "the tercentenary incident" where the robot presedent kills the human presedent because if the human had remained presedent the IIRC there would be preventabe economic colapse and people would die.

2. i think we are getting cought up in the search vs. evaluation debate here...
In this instance a search would be easier because 1. it would not require a deatailed evaluation function and 2. it would seem more "intelligent" because it would see further in the future and would be able to figure out what is "best" easy enough.

The search should run quite fast (even with a bulky evaluation function) perhaps a 2 ply search, while extending "interesting" lines of the tree (one in which the total amount in which the rules have changed from S - 1 to S is great or in which a "big thing" occured, like someone getting wounded, an object being destroyed, ect.) an alpha-beta search would also work quite nicely (as something which gets beta-cutoff would most likely have caused a rule transgression).

So now it will find an action (withing its search horizon), which would satisfy the asmovian rules most. (which would be rather nice).

Now if you look at it, the search would degenerate into your solution if it only had time enough to think to depth 1.

One is glad to be of service,

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!