Lab Assignment 1

Total Page:16

File Type:pdf, Size:1020Kb

Lab Assignment 1 CS181: Programming Languages Vladimir Vacic, Christos Koufogiannakis University of California, Riverside Lab Assignment 1 1. Given the following graph of possible flights between seven US cities: (graph taken from the web site of the American Mathematical Society, http://www.ams.org) a) Write a Prolog program that would check if there is a route from Fresno to Dallas, from Seattle to Boston, and from Atlanta to Fresno. b) Write a C program that does the same thing. Note: you have to write complete, working programs, run them and show the results. As far as C goes, the choice of data structure to store the relations between cities is yours. Warning: if there are cycles in the graph, Prolog might never find a solution and may never say that there are no solutions. If this happens in your assignment, make a note of that. 2. Given the partial family tree of the gods of the ancient Greeks encoded as a Prolog database: parent(chaos, gaea). parent(gaea, cyclope). parent(gaea, chronos). parent(gaea, coeus). parent(gaea, oceanus). parent(uranus, cyclope). parent(uranus, chronos). parent(uranus, coeus). parent(uranus, oceanus). parent(chronos, hades). parent(chronos, poseidon). parent(chronos, zeus). parent(rhea, hades). parent(rhea, poseidon). parent(rhea, zeus). parent(coeus, leto). parent(phoebe, leto). parent(leto, apollo). parent(leto, artemis). parent(zeus, apollo). parent(zeus, artemis). parent(oceanus, iapetus). parent(tethys, iapetus). parent(hera, ares). parent(zeus, ares). male(chaos). male(cyclope). male(uranus). male(chronos). male(coeus). male(oceanus). male(hades). male(poseidon). male(zeus). male(ares). male(apollo). male(iapetus). female(gaea). female(rhea). female(leto). female(hera). female(phoebe). female(tethys). female(artemis). define rules for the following relationships: a) father b) mother c) child d) son e) daughter f) sibling g) aunt and answer the following questions: h) Father of Ares i) Mother of Apollo j) Children of Uranus k) Son of Zeus l) Daughter of Gaea m) All siblings of Hades n) Who is the aunt of Leto? .
Recommended publications
  • The Hellenic Saga Gaia (Earth)
    The Hellenic Saga Gaia (Earth) Uranus (Heaven) Oceanus = Tethys Iapetus (Titan) = Clymene Themis Atlas Menoetius Prometheus Epimetheus = Pandora Prometheus • “Prometheus made humans out of earth and water, and he also gave them fire…” (Apollodorus Library 1.7.1) • … “and scatter-brained Epimetheus from the first was a mischief to men who eat bread; for it was he who first took of Zeus the woman, the maiden whom he had formed” (Hesiod Theogony ca. 509) Prometheus and Zeus • Zeus concealed the secret of life • Trick of the meat and fat • Zeus concealed fire • Prometheus stole it and gave it to man • Freidrich H. Fuger, 1751 - 1818 • Zeus ordered the creation of Pandora • Zeus chained Prometheus to a mountain • The accounts here are many and confused Maxfield Parish Prometheus 1919 Prometheus Chained Dirck van Baburen 1594 - 1624 Prometheus Nicolas-Sébastien Adam 1705 - 1778 Frankenstein: The Modern Prometheus • Novel by Mary Shelly • First published in 1818. • The first true Science Fiction novel • Victor Frankenstein is Prometheus • As with the story of Prometheus, the novel asks about cause and effect, and about responsibility. • Is man accountable for his creations? • Is God? • Are there moral, ethical constraints on man’s creative urges? Mary Shelly • “I saw the pale student of unhallowed arts kneeling beside the thing he had put together. I saw the hideous phantasm of a man stretched out, and then, on the working of some powerful engine, show signs of life, and stir with an uneasy, half vital motion. Frightful must it be; for supremely frightful would be the effect of any human endeavour to mock the stupendous mechanism of the Creator of the world” (Introduction to the 1831 edition) Did I request thee, from my clay To mould me man? Did I solicit thee From darkness to promote me? John Milton, Paradise Lost 10.
    [Show full text]
  • Homework Assignment 1
    CS171: Expert Systems Vladimir Vacic University of California, Riverside Homework Assignment 1 Primer This is a classical Prolog application. Given the following graph of possible flights between seven US cities: (graph taken from the web site of the American Mathematical Society, http://www.ams.org) Write a Prolog program that would check if there is a route from a city A to a city B: Steps: 1. Encode your database of facts: flight(fresno, seattle). flight(seattle, omaha). and so on. 2. Write the rules: What does it mean that there is a route from city A to city B? Well, we either have a direct connection, or we can to go from A to some city from which we have a direct connection to B. This is written as: route(A, B) :- flight(A, B). route(A, B) :- route(A, X), flight(X, B). And that’s it. Now you can ask Prolog if there is a routs from a city to a city, for example: ?- route(fresno, atlanta). You do not have to turn in the primer, but it will be useful to code it, as a warm-up, and to get a sense of working in Prolog. Note that the way the route rule was written is actually a recursion. route(A, B) :- flight(A, B). is the base case, and: route(A, B) :- route(A, X), flight(X, B). is the recursive step. Every time we apply the recursive step, we should be getting one city closer to the source. Homework assignment To be turned-in on Monday, April 11, 2005, in the discussion section, as a printout.
    [Show full text]
  • The Topography of Iapetus' Leading Side
    Icarus 193 (2008) 359–371 www.elsevier.com/locate/icarus The topography of Iapetus’ leading side Bernd Giese a,∗, Tilmann Denk b, Gerhard Neukum b, Thomas Roatsch a, Paul Helfenstein c, Peter C. Thomas c, Elizabeth P. Turtle d, Alfred McEwen e, Carolyn C. Porco f a DLR, Institute of Planetary Research, Rutherfordstr. 2, 12489 Berlin, Germany b Department of Earth Sciences, Freie Universität Berlin, 12249 Berlin, Germany c Center for Radiophysics and Space Research, Cornell University, Ithaca, NY 14853, USA d Johns Hopkins University Applied Physics Laboratory, 11100 Johns Hopkins Rd., Laurel, MD 20723, USA e Lunar and Planetary Laboratory, University of Arizona, 1541 E. University Blvd., Tucson, AZ 85721, USA f Cassini Imaging Central Laboratory for Operations, Space Science Institute, 4750 Walnut Street, Suite 205, Boulder, CO 80301, USA Received 12 December 2006; revised 15 May 2007 Available online 18 July 2007 Abstract We have used Cassini stereo images to study the topography of Iapetus’ leading side. A terrain model derived at resolutions of 4–8 km reveals that Iapetus has substantial topography with heights in the range of −10 km to +13 km, much more than observed on the other middle-sized satellites of Saturn so far. Most of the topography is older than 4 Ga [Neukum, G., Wagner, R., Denk, T., Porco, C.C., 2005. Lunar Planet. Sci. XXXVI. Abstract 2034] which implies that Iapetus must have had a thick lithosphere early in its history to support this topography. Models of lithospheric deflection by topographic loads provide an estimate of the required elastic thickness in the range of 50–100 km.
    [Show full text]
  • Read Book ^ Titans: Atlas, Titan, Rhea, Helios, Eos, Prometheus, Hecate
    [PDF] Titans: Atlas, Titan, Rhea, Helios, Eos, Prometheus, Hecate, Oceanus, Metis, Mnemosyne, Titanomachy, Selene, Themis, Tethys,... Titans: Atlas, Titan, Rhea, Helios, Eos, Prometheus, Hecate, Oceanus, Metis, Mnemosyne, Titanomachy, Selene, Themis, Tethys, Theia, Iapetus, Coeus, Crius, Asteria, Epimetheus, Hyperion, Astraeus, Cron Book Review A superior quality pdf along with the font used was intriguing to read through. It can be rally exciting throgh reading through time period. You may like how the blogger create this book. (Dr. Rylee Berg e) TITA NS: ATLA S, TITA N, RHEA , HELIOS, EOS, PROMETHEUS, HECATE, OCEA NUS, METIS, MNEMOSYNE, TITA NOMA CHY, SELENE, THEMIS, TETHYS, THEIA , IA PETUS, COEUS, CRIUS, A STERIA , EPIMETHEUS, HYPERION, A STRA EUS, CRON - To download Titans: A tlas, Titan, Rhea, Helios, Eos, Prometheus, Hecate, Oceanus, Metis, Mnemosyne, Titanomachy, Selene, Themis, Tethys, Theia, Iapetus, Coeus, Crius, A steria, Epimetheus, Hyperion, A straeus, Cron PDF, you should access the web link under and save the ebook or have accessibility to other information which are have conjunction with Titans: Atlas, Titan, Rhea, Helios, Eos, Prometheus, Hecate, Oceanus, Metis, Mnemosyne, Titanomachy, Selene, Themis, Tethys, Theia, Iapetus, Coeus, Crius, Asteria, Epimetheus, Hyperion, Astraeus, Cron book. » Download Titans: A tlas, Titan, Rhea, Helios, Eos, Prometheus, Hecate, Oceanus, Metis, Mnemosyne, Titanomachy, Selene, Themis, Tethys, Theia, Iapetus, Coeus, Crius, A steria, Epimetheus, Hyperion, A straeus, Cron PDF « Our solutions was introduced with a want to serve as a total on the internet electronic digital catalogue that provides use of multitude of PDF file book assortment. You could find many kinds of e-publication and also other literatures from your paperwork database.
    [Show full text]
  • Athena ΑΘΗΝΑ Zeus ΖΕΥΣ Poseidon ΠΟΣΕΙΔΩΝ Hades ΑΙΔΗΣ
    gods ΑΠΟΛΛΩΝ ΑΡΤΕΜΙΣ ΑΘΗΝΑ ΔΙΟΝΥΣΟΣ Athena Greek name Apollo Artemis Minerva Roman name Dionysus Diana Bacchus The god of music, poetry, The goddess of nature The goddess of wisdom, The god of wine and art, and of the sun and the hunt the crafts, and military strategy and of the theater Olympian Son of Zeus by Semele ΕΡΜΗΣ gods Twin children ΗΦΑΙΣΤΟΣ Hermes of Zeus by Zeus swallowed his first Mercury Leto, born wife, Metis, and as a on Delos result Athena was born ΑΡΗΣ Hephaestos The messenger of the gods, full-grown from Vulcan and the god of boundaries Son of Zeus the head of Zeus. Ares by Maia, a Mars The god of the forge who must spend daughter The god and of artisans part of each year in of Atlas of war Persephone the underworld as the consort of Hades ΑΙΔΗΣ ΖΕΥΣ ΕΣΤΙΑ ΔΗΜΗΤΗΡ Zeus ΗΡΑ ΠΟΣΕΙΔΩΝ Hades Jupiter Hera Poseidon Hestia Pluto Demeter The king of the gods, Juno Vesta Ceres Neptune The goddess of The god of the the god of the sky The goddess The god of the sea, the hearth, underworld The goddess of and of thunder of women “The Earth-shaker” household, the harvest and marriage and state ΑΦΡΟΔΙΤΗ Hekate The goddess Aphrodite First-generation Second- generation of magic Venus ΡΕΑ Titans ΚΡΟΝΟΣ Titans The goddess of MagnaRhea Mater Astraeus love and beauty Mnemosyne Kronos Saturn Deucalion Pallas & Perses Pyrrha Kronos cut off the genitals Crius of his father Uranus and threw them into the sea, and Asteria Aphrodite arose from them.
    [Show full text]
  • The Children of Earth and Starry Heaven: The
    Bryn Mawr College Scholarship, Research, and Creative Work at Bryn Mawr College Greek, Latin, and Classical Studies Faculty Research Greek, Latin, and Classical Studies and Scholarship 2010 The hiC ldren of Earth and Starry Heaven: The Meaning and Function of the Formula in the 'Orphic' Gold Tablets Radcliffe .G Edmonds III Bryn Mawr College, [email protected] Let us know how access to this document benefits ouy . Follow this and additional works at: http://repository.brynmawr.edu/classics_pubs Part of the Classics Commons, and the Religion Commons Custom Citation R. G. Edmonds III, “The hiC ldren of Earth and Starry Heaven: The eM aning and Function of the Formula in the 'Orphic' Gold Tablets,” in Orfeo y el orfismo: nuevas perspectivas, Alberto Bernabé, Francesc Casadesús y Marco Antonio Santamaría (eds.), Alicante : Biblioteca Virtual Miguel de Cervantes (2010), pp. 98-121. This paper is posted at Scholarship, Research, and Creative Work at Bryn Mawr College. http://repository.brynmawr.edu/classics_pubs/98 For more information, please contact [email protected]. 4 THE CHILDREN OF EARTH AND STARRY HEAVEN: THE MEANING AND FUNCTION OF THE FORMULA IN THE ʹORPHICʹ GOLD TABLETS Radcliffe G. Edmonds III Bryn Mawr University The most striking aspect of the tiny gold tablets often known as the Orphic gold leaves is undoubtedly the enigmatic declaration: ʺI am the child of Earth and starry Heavenʺ. All of the tablets which, following Zuntzʹs classification, have been labelled B tablets, contain this mysterious formula, whether the scenario of the deceasedʹs journey through the underworld is described in greater or lesser detail1. The statement captures the imagination with its imagery and its simplicity, but also with its mysterious nature.
    [Show full text]
  • The Project Gutenberg Ebook of Bulfinch's Mythology: the Age of Fable, by Thomas Bulfinch
    The Project Gutenberg EBook of Bulfinch's Mythology: The Age of Fable, by Thomas Bulfinch This eBook is for the use of anyone anywhere at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.net Title: Bulfinch's Mythology: The Age of Fable Author: Thomas Bulfinch Posting Date: February 4, 2012 [EBook #3327] Release Date: July 2002 First Posted: April 2, 2001 Language: English Character set encoding: ISO-8859-1 *** START OF THIS PROJECT GUTENBERG EBOOK BULFINCH'S MYTHOLOGY: AGE OF FABLE *** Produced by an anonymous Project Gutenberg volunteer. BULFINCH'S MYTHOLOGY THE AGE OF FABLE Revised by Rev. E. E. Hale CONTENTS Chapter I Origin of Greeks and Romans. The Aryan Family. The Divinities of these Nations. Character of the Romans. Greek notion of the World. Dawn, Sun, and Moon. Jupiter and the gods of Olympus. Foreign gods. Latin Names.-- Saturn or Kronos. Titans. Juno, Vulcan, Mars, Phoebus-Apollo, Venus, Cupid, Minerva, Mercury, Ceres, Bacchus. The Muses. The Graces. The Fates. The Furies. Pan. The Satyrs. Momus. Plutus. Roman gods. Chapter II Roman Idea of Creation. Golden Age. Milky Way. Parnassus. The Deluge. Deucalion and Pyrrha. Pandora. Prometheus. Apollo and Daphne. Pyramus and Thisbe. Davy's Safety Lamp. Cephalus and Procris Chapter III Juno. Syrinx, or Pandean Pipes. Argus's Eyes. Io. Callisto Constellations of Great and Little Bear. Pole-star. Diana. Actaeon. Latona. Rustics turned to Frogs. Isle of Delos. Phaeton.
    [Show full text]
  • Read Book Fate
    FATE PDF, EPUB, EBOOK Jennifer Lynn Barnes | 355 pages | 10 Mar 2009 | Bantam Doubleday Dell Publishing Group Inc | 9780385735377 | English | New York, United States Moirai - Wikipedia Pausanias mentions an ancient role of Eileythia as "the clever spinner", relating her with destiny too. The Moirai assigned to the terrible chthonic goddesses Erinyes who inflicted the punishment for evil deeds their proper functions, and with them directed fate according to necessity. As goddesses of death they appeared together with the daemons of death Keres and the infernal Erinyes. In earlier times they were represented as only a few—perhaps only one—individual goddess. Homer's Iliad xxiv. In the Odyssey vii. At Delphi, only the Fates of Birth and Death were revered. Some Greek mythographers went so far as to claim that the Moirai were the daughters of Zeus —paired with Themis "fundament" , as Hesiod had it in one passage. Whether or not providing a father even for the Moirai was a symptom of how far Greek mythographers were willing to go, in order to modify the old myths to suit the patrilineal Olympic order, [56] the claim of a paternity was certainly not acceptable to Aeschylus , Herodotus , or Plato. Despite their forbidding reputation, the Moirai could be placated as goddesses. Brides in Athens offered them locks of hair, and women swore by them. They may have originated as birth goddesses and only later acquired their reputation as the agents of destiny. According to the mythographer Apollodorus , in the Gigantomachy , the war between the Giants and Olympians, the Moirai killed the Giants Agrios and Thoon with their bronze clubs.
    [Show full text]
  • Deviant Origins: Hesiodic Theogony and the Orphica Radcliffe .G Edmonds III Bryn Mawr College, [email protected]
    Bryn Mawr College Scholarship, Research, and Creative Work at Bryn Mawr College Greek, Latin, and Classical Studies Faculty Research Greek, Latin, and Classical Studies and Scholarship 2018 Deviant Origins: Hesiodic Theogony and the Orphica Radcliffe .G Edmonds III Bryn Mawr College, [email protected] Let us know how access to this document benefits ouy . Follow this and additional works at: https://repository.brynmawr.edu/classics_pubs Part of the Classics Commons Custom Citation Edmonds, Radcliffe .G 2018. "Deviant Origins: Hesiodic Theogony and the Orphica." In In Oxford Handbook of Hesiod, edited by A. Loney & S. Scully, 225-242. New York/Oxford: Oxford University Press. This paper is posted at Scholarship, Research, and Creative Work at Bryn Mawr College. https://repository.brynmawr.edu/classics_pubs/125 For more information, please contact [email protected]. Deviant Origins: Hesiod’s Theogony and the Orphica Oxford Handbooks Online Deviant Origins: Hesiod’s Theogony and the Orphica Radcliffe G. Edmonds III The Oxford Handbook of Hesiod Edited by Alexander C. Loney and Stephen Scully Print Publication Date: Sep 2018 Subject: Classical Studies, Classical Poetry, Classical Religions and Mythologies Online Publication Date: Aug 2018 DOI: 10.1093/oxfordhb/9780190209032.013.43 Abstract and Keywords Hesiod’s Theogony provides one of the most widely authoritative accounts of the origin of the cosmos, but his account has always been challenged by rivals claiming to be older, wiser, and better, and the name of Orpheus has always been privileged in the evidence for ancient rivals to Hesiod. The Orphic accounts play their variations on the Hesiodic themes, riffing in different ways on the idea of the ultimate origin of the cosmos; the processes of reproduction by which subsequent entities were generated; the conflicts between these divinities that created the changes from the original state to the current one; the way in which humans entered the story; and the final resolution of the conflicts and changes that created the current, normal order of Zeus.
    [Show full text]
  • Pan's Labyrinth
    Southey, 2016 Pan’s Labyrinth: A Critical Analysis by Safia Southey Table of Contents: Eyes and Obedience………………………………………………………….…….… 2 ​ Stories, Fantasy and Reality……………………………………………………….…. 8 ​ Hamlet Connections…………………………………………………………..……….14 ​ Cinematography and Sound…………………………………………………….……..19 ​ Good vs. Evil……………………………………………………………….……….…26 ​ Folklore and Religion………………………………………………………….….…...31 ​ Time………………………………………………………………………….…….…..41 ​ Femininity…………………………………………………………………….…….….45 ​ Appendix…………………………………………………………………….…….…...51 ​ Works Cited……………………………………………………………………..….….79 ​ 1 Southey, 2016 Eyes and Obedience Guillermo del Toro’s Pan’s Labyrinth is an exploration into the life of a young girl, ​ Ofelia. Ripped from her home and forced into the world of her stepfather, Captain Vidal and the Spanish Civil War, she hides herself away in her books and fairytales. When she is told by a Faun that she is the Princess of the Underworld, she immediately leaps at the chance to prove that she’s not mortal in order to distract herself from the patriarchal and violent world around her. Every character in the film must decide what part they play in her story, whether they will obey their superiors or create their own path, whether they will see beyond their instructions or blindly follow orders. Symbolism of eyes and sight appear everywhere, posing as a theme to guide the audience through the story and raise questions about what it really means to see. In Pan’s Labyrinth, only those who are able to open their eyes and not blind themselves with rage ​ and make decisions beyond what they are expressly instructed to do are able to succeed. The film begins with a fantastical story about a Princess who lives in the Underworld realm who dreams of joining the human world.
    [Show full text]
  • Atlas (Mythology) from Wikipedia, the Free Encyclopedia
    AAttllaas ((mmyytthhoollooggyy) - WWiikkiippeeddiiaa, tthhe ffrreee eennccyyccllooppeeddiiaa hhttttpp::////eenn..wwiikkiippeeddiiaa..oorrgg//wwiikkii//AAttllaass__((mmyytthhoollooggyy)) Atlas (mythology) From Wikipedia, the free encyclopedia InIn Greek mythologygy,, Atlas (/ˈætləs/; Ancient Greek: Ἄτλας) was the primordial Titan who held up thehe celestialal Atlas spheres. He is also the titan of astronomy and navigation. Although associated with various places, he became commonly identified with the Atlas Mountains in northwest Africa (Modern-day Morocco, Algeria and Tunisia).[1][1] Atlas was the son of the Titanan Iapetus and the Oceanidd Asiaa[2][2] or or ClClymene..[3][3] In contexts where a Titan and a Titaness are assigned each of the seven planetary powers, Atlas is paired with Phoebe and governs the moon..[4][4] Hyginus emphasises the primordial nature of Atlas by making him the son of Aether andd Gaia.a.[5][5] The first part of the term Atlantic Ocean refers to "Sea of Atlas", the term Atlantis refers to "island of Atlas". Titan of Astronomy Abode WWestern edge ofof Gaia (thethe Earth)) Contents Symbol Globe 11 EtEtymolologygy Parents Iapetus and Asia or Clymenee 22 Puninishmenentt Children Hesperides,s, Hyades,s, Hyas, Pleiades, Calypso,so, Dione and 2.1 VVariations Maera 33 Encounter with Heracleses Roman equivalent Atlas 44 Etruscan Arill 55 Chilildrdrenen 66 Cultural influencece 77 SeSee alalsoso 88 NNototeses 99 References 1010 External linkss Etymology The etymology of the name Atlas is uncertain. Virgil took pleasure in translating etymologies of Greek names by combining them with adjectives that explained them: for Atlas his adjective is durus, "hard, enduring",[6][6] which suggested to George Doig[7][7] that Virgil was aware of the Greek τλῆναι "to endure"; Doig offers the further possibility that Virgil was aware of Strabo’s remark that the native North African name for this mountain was Douris.
    [Show full text]
  • Atlas (Mythology) - Wikipedia, the Free Encyclopedia
    ַא ְט ָלס atlas http://www.morfix.co.il/en/%D7%90%D7%98%D7%9C%D7%A1 Atlas (mythology) - Wikipedia, the free encyclopedia https://en.wikipedia.org/wiki/Atlas_(mythology) Atlas (mythology) From Wikipedia, the free encyclopedia In Greek mythology, Atlas (/ˈætləs/; Ancient Greek: Ἄτλας ) was the primordial Titan who held up the celestial spheres. Atlas He is also the titan of astronomy and navigation. Although associated with various places, he became commonly identified with the Atlas Mountains in northwest Africa (Modern-day Morocco, Algeria and Tunisia). [1] Atlas was the son of the Titan Iapetus and the Oceanid Asia [2] or Clymene.[3] In contexts where a Titan and a Titaness are assigned each of the seven planetary powers, Atlas is paired with Phoebe and governs the moon.[4] Hyginus emphasises the primordial nature of Atlas by making him the son of Aether and Gaia.[5] The first part of the term Atlantic Ocean refers to "Sea of Atlas", the term Atlantis refers to "island of Atlas". Titan of Astronomy Abode Western edge of Gaia ( the Earth ) Contents Symbol Globe Parents Iapetus and Asia or Clymene 1 Etymology Children Hesperides, Hyades, Hyas, 2 Punishment Pleiades, Calypso, Dione and 2.1 Variations Maera 3 Encounter with Heracles Roman equivalent Atlas 4 Etruscan Aril 5 Children 6 Cultural influence 7 See also 8 Notes 9 References 10 External links Etymology The etymology of the name Atlas is uncertain. Virgil took pleasure in translating etymologies of Greek names by combining them with adjectives that explained them: for Atlas his adjective is durus , "hard, enduring", [6] 1 of 6 10/8/2014 11:41 PM Atlas (mythology) - Wikipedia, the free encyclopedia https://en.wikipedia.org/wiki/Atlas_(mythology) which suggested to George Doig [7] that Virgil was aware of the Greek τλῆναι "to endure"; Doig offers the further possibility that Virgil was aware of Strabo's remark that the native North African name for this mountain was Douris .
    [Show full text]