The first part is about if there is נזק (damages) caused by the self-driving car
(א) אַרְבָּעָה אֲבוֹת נְזִיקִין, הַשּׁוֹר וְהַבּוֹר וְהַמַּבְעֶה וְהַהֶבְעֵר. לֹא הֲרֵי הַשּׁוֹר כַּהֲרֵי הַמַּבְעֶה, וְלֹא הֲרֵי הַמַּבְעֶה כַּהֲרֵי הַשּׁוֹר. וְלֹא זֶה וָזֶה, שֶׁיֵּשׁ בָּהֶן רוּחַ חַיִּים, כַּהֲרֵי הָאֵשׁ, שֶׁאֵין בּוֹ רוּחַ חַיִּים. וְלֹא זֶה וָזֶה, שֶׁדַּרְכָּן לֵילֵךְ וּלְהַזִּיק, כַּהֲרֵי הַבּוֹר, שֶׁאֵין דַּרְכּוֹ לֵילֵךְ וּלְהַזִּיק. הַצַּד הַשָּׁוֶה שֶׁבָּהֶן, שֶׁדַּרְכָּן לְהַזִּיק וּשְׁמִירָתָן עָלֶיךָ. וּכְשֶׁהִזִּיק, חָב הַמַּזִּיק לְשַׁלֵּם תַּשְׁלוּמֵי נֶזֶק בְּמֵיטַב הָאָרֶץ:
(1) [There are] four categories of damages: The ox, the pit, the grazer, and the fire. The [characteristics] of the ox are not similar to the [characteristics] of the grazer. And the [characteristics] of the grazer are not similar to the [characteristics] of the ox. Nor are either of these, which have a living spirit, similar to the fire, which has no living spirit. Nor are any of these, which move and do damage, similar to the pit, which does not move and does damage. What is common among them is that they do damage, and the responsibility for their supervision is upon you. And when they do damage, the damager must pay from the best of the land.
קצות החושן סימן שפו
מיהו נראה באש דכלו לו חציו דהיינו בענין שהיה לו לגודרה ולא גדרה דחייב באשו משום ממונו וכמבואר בטור ושו"ע סימן תי"ח (סעיף י"ז), ובזה נראה דשרף שטרות כה"ג פטור לדעת הרמ"א (כאן) דאינו חייב בדינא דגרמי אלא בנזקי גופו ולא בנזקי בהמתו, וזה שכלו לו חציו אין בו משום חציו ותו לא הוי נזקי גופו אלא נזקי ממונו ופטור בשטרות:
However, it appears that a fire which was partially completed, that is, you should have fenced it, but didn't, you are liable for your fire because it is like your money...
אבן עזרא הפירוש הקצר שמות פרק לה פסוק ג
לא תבערו אש - בעבור שאמר בפסח: כל מלאכה לא יעשה בהם אך אשר יאכל לכל נפש (שמות יב, טז), אסר לעשות מאכל הנפש בשבת, כי לא יעשה מאכל כי אם בהדלקת האש. והשם יכפיל שכר הגאון שהשיב תשובות גמורות על הצדוקים האוסרים נר בשבת.
Don't burn a Fire- Becasue it says by pesach: All work you shall not do on them, except for that which is to be eaten by any soul (Exodus 12, 16), it is forbidden to prepare food on Shabbat because preparing food can only be done via fire. And HaShem should double the reward of the genius who completely answered the Sadducees who say that you can't have candles on Shabbat.
The end of the long discussion according to the Ibn Ezra here is that fire on Shabbat is only a problem in the kindling. This is an important distinction to make between Shabbat and Damages (נזק) because by Shabbat, the violation is at the time of lighting. However, by fire damages, it is even that which burns thereafter because his money is an extension of him.
(ג) בַּמֶּה דְּבָרִים אֲמוּרִים בִּרְשׁוּת הַנִּזָּק. אֲבָל בִּרְשׁוּת הַמַּזִּיק אֵינוֹ חַיָּב לְשַׁלֵּם אֶלָּא אִם הִזִּיק בְּזָדוֹן אֲבָל בִּשְׁגָגָה אוֹ בְּאֹנֶס פָּטוּר. וְכֵן אִם הָיוּ שְׁנֵיהֶן בִּרְשׁוּת אוֹ שְׁנֵיהֶם שֶׁלֹּא בִּרְשׁוּת וְהִזִּיק אֶחָד מֵהֶן מָמוֹן חֲבֵרוֹ שֶׁלֹּא בְּכַוָּנָה פָּטוּר:
(3) This applies only [to damage done] on the premises of the injured party; on the premises of the defendant, however, he must pay only if he caused the damage willfully ; but if he acted unwittingly or accidentally, he is exempt.— —
חושן משפט שצ"ה א
א) המשסה את הכלב בחבירו או בעצמו ובו סעיף א':
המשסה (פי' משלח ומקניט) כלבו של חבירו בחבירו פטור מדיני אדם וחייב בדיני שמים ובעל הכלב חייב חצי נזק שכיון שהוא יודע שאם שסה את כלבו להזיק נושך לא היה לו להניחו ...
1) One who sicks a dog on his friend or himself...
One who sicks his friend's dog onto his friend (3rd party), he is exempt from monetary payment, but is liable in the heavenly court. The owner of the dog is responsible to pay half of the damages since he knew that if his dog was sicked to damage through biting, he should not have left the dog out...
At this point the focus of discussion will shift from Damages, to the moral question regarding programming the car to kill someone while attempting to avoid killing others, and other such moral dilemmas
(ה) נָשִׁים שֶׁאָמְרוּ לָהֶם עוֹבְדֵי כּוֹכָבִים תְּנוּ לָנוּ אַחַת מִכֶּן וּנְטַמֵּא אוֹתָהּ וְאִם לָאו נְטַמֵּא אֶת כֻּלְּכֶן יִטָּמְאוּ כֻּלָּן וְאַל יִמְסְרוּ לָהֶם נֶפֶשׁ אַחַת מִיִּשְׂרָאֵל. וְכֵן אִם אָמְרוּ לָהֶם עוֹבְדֵי כּוֹכָבִים תְּנוּ לָנוּ אֶחָד מִכֶּם וְנַהַרְגֶּנּוּ וְאִם לָאו נַהֲרֹג כֻּלְּכֶם. יֵהָרְגוּ כֻּלָּם וְאַל יִמְסְרוּ לָהֶם נֶפֶשׁ אַחַת מִיִּשְׂרָאֵל. וְאִם יִחֲדוּהוּ לָהֶם וְאָמְרוּ תְּנוּ לָנוּ פְּלוֹנִי אוֹ נַהֲרֹג אֶת כֻּלְּכֶם. אִם הָיָה מְחֻיָּב מִיתָה כְּשֶׁבַע בֶּן בִּכְרִי יִתְּנוּ אוֹתוֹ לָהֶם. וְאֵין מוֹרִין לָהֶם כֵּן לְכַתְּחִלָּה. וְאִם אֵינוֹ חַיָּב מִיתָה יֵהָרְגוּ כֻּלָּן וְאַל יִמְסְרוּ לָהֶם נֶפֶשׁ אַחַת מִיִּשְׂרָאֵל:
(5) If idolaters will demand one of a group of women, saying: "Yield us one of among you and we will defile her, if not we will defile you all", let all be defiled, rather than surrender to them one soul in Israel.4Terumot, 8.12. C. G. Likewise, if idolaters will say to a group of men: "Yield us one of you and we will kill him, if not we will kill you all", let all of them be killed rather than surrender to them one soul in Israel. If, however, they single out the one, saying: "Give us that man, if not we will kill you all", if he be guilty of a capital crime, as, for example, Sheba son of Bichri5See Second Samuel; 20. 1. G., they may surrender him to them, but it is not commendable to advise them to do so; if he be not guilty of a capital crime, they all must submit rather than surrender them one soul in Israel.
כסף משנה הלכות יסודי התורה פרק ה
כתב הרמ"ך אף על פי שנמצא בתוספתא כדבריו לא ידענא טעמא מאי דהא מסיק בגמרא (פסחים כ"ה) דמש"ה אמרינן בש"ד יהרג ואל יעבור דסברא הוא מאי חזית דדמא דידך סומק טפי והכא ליכא האי סברא דהא יהרגו כלם והוא עצמו ומוטב שיהרג הוא עצמו ואל יהרגו כולם.
The Ramach writes that even though the Rambam is just writing the conclusion of the Tosefta, I don;t understand why! The Gemara says that by cases of murder, you should give yourself up (to die) and not violate the prohibition of killing another because of the logic of whose blood is redder, and here that logical reasoning doesn't apply because they will all be killed as well as him himself, and it would be better if he killed himself and save the group.
שו"ת ציץ אליעזר חלק טו סימן ע
המנחה שהתוו לנו חז"ל על כגון דא של שאלת נפשות הוא לבחור להיות בזה במצב של שב ואל תעשה. ולאיזה צד היוצא השב ואל תעשה כאותו צד צריך להתנהג, בהיות ואי אפשר לנו לקבוע איזה דמא סומק טפי בזה, ועל כן יש לנו לנקוט בקו של מניעה מלעשות שום עבירה בידים ועיקרו של דבר זה שיש חילוק בין אי עביד מעשה לבין לא עביד מעשה יוצא בעצם גם מדברי התוס' בסנהדרין שם ד"ה והא אסתר, ורק דלא נחתי להכלל האמור בזה בר"י.
The guide that we have been given by Chazal on the questions regarding life and death issues is to choose to be passive, and whichever way being passive results (be it fewer casualties or more), that is how we should lean, and we don;t have the right to determine whose blood is redder. Therefore, we need to take the side of restraint from performing any sin because the main point is that there is a difference between active and passive. This is the conclusion of a Tosafot in Sanhedrin there, s.v. "V'ha Esther", and I am just not satisfied with the rule written by the Rabbeinu Yona.