Skip to content

web search done right

Ftr/entity sidebar (#11)

Mikkel Denkerd1ece2af4636
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..20739a9d
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+data/** filter=lfs diff=lfs merge=lfs -text
diff --git a/.gitignore b/.gitignore
index f3303773..92b18922 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@ data
static/**/*.css
node_modules
package-lock.json
+notes
diff --git a/Cargo.toml b/Cargo.toml
index 8e5b5ff4..666e6e88 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -48,6 +48,10 @@ image = "0.24.3"
chrono = "0.4.20"
uuid = "1.1.2"
futures = "0.3.21"
+quick-xml = "0.23.0"
+bzip2 = "0.4.3"
+parse_wiki_text = "0.1.5"
+md5 = "0.7.0"
[dev-dependencies]
maplit = "1.0.2"
diff --git a/justfile b/justfile
index 7a04ac2d..b4f10bc0 100644
--- a/justfile
+++ b/justfile
@@ -9,7 +9,7 @@
cargo run --release -- configs/webgraph/master.toml
@frontend:
- cargo watch -x 'run -- frontend data/index queries_us.csv'
+ cargo watch -x 'run -- frontend data/index queries_us.csv data/entity'
@local:
wget -nc -P data/warc_files https://data.commoncrawl.org/crawl-data/CC-MAIN-2022-05/segments/1642320299852.23/warc/CC-MAIN-20220116093137-20220116123137-00049.warc.gz
@@ -17,3 +17,7 @@
cargo run --release -- indexer local configs/indexer/local.toml
mv data/index/CC-MAIN-20220116093137-20220116123137-00049.warc.gz/* data/index/
just frontend
+
+@entity:
+ rm -rf data/entity
+ cargo run --release -- indexer entity data/enwiki-20220801-pages-articles-multistream.xml.bz2 data/entity
diff --git a/src/entity_index/entity.rs b/src/entity_index/entity.rs
new file mode 100644
index 00000000..85e4177d
--- /dev/null
+++ b/src/entity_index/entity.rs
@@ -0,0 +1,146 @@
+// Cuely is an open source web search engine.
+// Copyright (C) 2022 Cuely ApS
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use std::collections::{BTreeMap, HashSet};
+
+use parse_wiki_text::Node;
+use serde::{Deserialize, Serialize};
+
+use crate::webpage::Url;
+
+#[derive(Debug)]
+pub struct Paragraph {
+ pub title: Option<String>,
+ pub content: Span,
+}
+
+#[derive(Debug)]
+pub struct Entity {
+ pub title: String,
+ pub page_abstract: Span,
+ pub info: BTreeMap<String, Span>,
+ pub image: Option<Url>,
+ pub paragraphs: Vec<Paragraph>,
+ pub categories: HashSet<String>,
+}
+
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
+pub struct Span {
+ pub text: String,
+ pub links: Vec<Link>,
+}
+
+impl Span {
+ pub fn merge(&mut self, other_span: Span) {
+ let orig_end = self.text.len();
+ self.text.push_str(&other_span.text);
+
+ for link in other_span.links {
+ self.links.push(Link {
+ start: orig_end + link.start,
+ end: orig_end + link.end,
+ target: link.target,
+ });
+ }
+ }
+
+ pub fn add_link(&mut self, text: String, link: Link) {
+ debug_assert_eq!(self.text.chars().count() + text.chars().count(), link.end);
+ debug_assert_eq!(self.text.chars().count(), link.start);
+ self.links.push(link);
+ self.text.push_str(&text);
+ }
+}
+
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
+pub struct Link {
+ pub start: usize,
+ pub end: usize,
+ pub target: String,
+}
+
+impl<'a> From<Vec<Node<'a>>> for Span {
+ fn from(nodes: Vec<Node<'a>>) -> Self {
+ let mut span = Span {
+ text: String::new(),
+ links: Vec::new(),
+ };
+
+ for node in nodes {
+ match node {
+ Node::Link {
+ end: _,
+ start: _,
+ target,
+ text,
+ } => {
+ let text: String = itertools::intersperse(
+ text.into_iter().filter_map(|node| match node {
+ Node::Text {
+ end: _,
+ start: _,
+ value,
+ } => Some(value),
+ _ => None,
+ }),
+ "",
+ )
+ .collect();
+
+ let link = Link {
+ target: target.to_string(),
+ start: span.text.chars().count(),
+ end: span.text.chars().count() + text.chars().count(),
+ };
+ span.add_link(text, link);
+ }
+ Node::Text {
+ end: _,
+ start: _,
+ value,
+ } => {
+ if value == "\n" {
+ if !span.text.is_empty() {
+ span.text.push_str(". ");
+ }
+ continue;
+ } else {
+ span.text.push_str(value);
+ }
+ }
+ Node::Template {
+ end: _,
+ name: _,
+ parameters,
+ start: _,
+ } if span.text.is_empty() => {
+ for other_span in parameters
+ .into_iter()
+ .filter(|parameter| parameter.name.is_none())
+ .map(|parameter| Span::from(parameter.value))
+ {
+ span.merge(other_span);
+ span.text.push(' ');
+ }
+ span.text = span.text.trim_end().to_string();
+ }
+ _ => {}
+ }
+ }
+
+ span
+ }
+}
diff --git a/src/entity_index/mod.rs b/src/entity_index/mod.rs
new file mode 100644
index 00000000..42481c0b
--- /dev/null
+++ b/src/entity_index/mod.rs
@@ -0,0 +1,450 @@
+// Cuely is an open source web search engine.
+// Copyright (C) 2022 Cuely ApS
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use std::{
+ collections::{BTreeMap, HashSet},
+ fs,
+ path::Path,
+ sync::Arc,
+ time::Duration,
+};
+
+use tantivy::{
+ collector::TopDocs,
+ query::{BooleanQuery, MoreLikeThisQuery, Occur, QueryClone, TermQuery},
+ schema::{BytesOptions, IndexRecordOption, Schema, TextFieldIndexing, TextOptions},
+ DocAddress, IndexReader, IndexWriter, LeasedItem, Searcher, Term,
+};
+use tracing::info;
+
+use crate::{
+ image_downloader::{ImageDownloadJob, ImageDownloader},
+ image_store::{EntityImageStore, Image, ImageStore},
+ kv::{rocksdb_store::RocksDbStore, Kv},
+ tokenizer::NormalTokenizer,
+ webpage::Url,
+ Result,
+};
+
+use self::entity::{Entity, Link, Span};
+pub(crate) mod entity;
+
+pub struct EntityIndex {
+ image_store: EntityImageStore,
+ image_downloader: ImageDownloader<String>,
+ writer: IndexWriter,
+ reader: IndexReader,
+ schema: Arc<Schema>,
+ stopwords: HashSet<String>,
+ attribute_occurrences: Box<dyn Kv<String, u32>>,
+}
+
+fn schema() -> Schema {
+ let mut builder = tantivy::schema::Schema::builder();
+
+ builder.add_text_field(
+ "title",
+ TextOptions::default()
+ .set_indexing_options(
+ TextFieldIndexing::default()
+ .set_tokenizer(NormalTokenizer::as_str())
+ .set_index_option(IndexRecordOption::WithFreqsAndPositions),
+ )
+ .set_stored(),
+ );
+ builder.add_text_field(
+ "abstract",
+ TextOptions::default()
+ .set_indexing_options(
+ TextFieldIndexing::default()
+ .set_tokenizer(NormalTokenizer::as_str())
+ .set_index_option(IndexRecordOption::WithFreqsAndPositions),
+ )
+ .set_stored(),
+ );
+ builder.add_bytes_field("info", BytesOptions::default().set_stored());
+ builder.add_bytes_field("links", BytesOptions::default().set_stored());
+ builder.add_text_field(
+ "has_image",
+ TextOptions::default()
+ .set_indexing_options(
+ TextFieldIndexing::default()
+ .set_index_option(IndexRecordOption::WithFreqsAndPositions),
+ )
+ .set_stored(),
+ );
+
+ builder.build()
+}
+
+fn entity_to_tantivy(entity: Entity, schema: &tantivy::schema::Schema) -> tantivy::Document {
+ let mut doc = tantivy::Document::new();
+
+ doc.add_text(schema.get_field("title").unwrap(), entity.title);
+ doc.add_text(
+ schema.get_field("abstract").unwrap(),
+ entity.page_abstract.text,
+ );
+ doc.add_bytes(
+ schema.get_field("info").unwrap(),
+ bincode::serialize(&entity.info).unwrap(),
+ );
+ doc.add_bytes(
+ schema.get_field("links").unwrap(),
+ bincode::serialize(&entity.page_abstract.links).unwrap(),
+ );
+ let has_image = if entity.image.is_some() {
+ "true"
+ } else {
+ "false"
+ };
+
+ doc.add_text(schema.get_field("has_image").unwrap(), has_image);
+
+ doc
+}
+
+fn wikipedify_url(url: Url) -> Vec<Url> {
+ let mut name = url.raw().replace(' ', "_");
+
+ if name.starts_with("File:") {
+ if let Some(index) = name.find("File:") {
+ name = name[index + "File:".len()..].to_string();
+ }
+ }
+
+ let hex = format!("{:?}", md5::compute(&name));
+ vec![
+ format!(
+ "https://upload.wikimedia.org/wikipedia/commons/{:}/{:}",
+ hex[0..1].to_string() + "/" + &hex[0..2],
+ name
+ )
+ .into(),
+ format!(
+ "https://upload.wikimedia.org/wikipedia/en/{:}/{:}",
+ hex[0..1].to_string() + "/" + &hex[0..2],
+ name
+ )
+ .into(),
+ ]
+}
+
+#[derive(Debug, PartialEq, Eq)]
+pub struct StoredEntity {
+ pub title: String,
+ pub entity_abstract: String,
+ pub image: Option<String>,
+ pub related_entities: Vec<StoredEntity>,
+ pub info: BTreeMap<String, Span>,
+ pub links: Vec<Link>,
+}
+
+impl EntityIndex {
+ pub fn open<P: AsRef<Path>>(path: P) -> Result<Self> {
+ if !path.as_ref().exists() {
+ fs::create_dir_all(path.as_ref())?;
+ }
+
+ let schema = schema();
+ let tv_path = path.as_ref().join("inverted_index");
+ let tantivy_index = if tv_path.exists() {
+ tantivy::Index::open_in_dir(&tv_path)?
+ } else {
+ fs::create_dir_all(&tv_path)?;
+ tantivy::Index::create_in_dir(&tv_path, schema.clone())?
+ };
+
+ let attribute_occurrences = RocksDbStore::open(path.as_ref().join("attribute_occurrences"));
+
+ let stopwords: HashSet<String> = include_str!("../../stopwords/English.txt")
+ .lines()
+ .take(50)
+ .map(|word| word.to_ascii_lowercase())
+ .collect();
+
+ tantivy_index.tokenizers().register(
+ NormalTokenizer::as_str(),
+ NormalTokenizer::with_stopwords(stopwords.clone().into_iter().collect()),
+ );
+
+ let image_store = EntityImageStore::open(path.as_ref().join("images"));
+
+ let writer = tantivy_index.writer(10_000_000_000)?;
+ let reader = tantivy_index.reader()?;
+
+ Ok(Self {
+ image_store,
+ writer,
+ reader,
+ image_downloader: ImageDownloader::new(),
+ schema: Arc::new(schema),
+ stopwords,
+ attribute_occurrences,
+ })
+ }
+
+ pub fn insert(&mut self, entity: Entity) {
+ for attribute in entity.info.keys() {
+ let current = self.attribute_occurrences.get(attribute).unwrap_or(0);
+ self.attribute_occurrences
+ .insert(attribute.to_string(), current + 1);
+ }
+
+ if let Some(image) = entity.image.clone() {
+ let image = wikipedify_url(image);
+ self.image_downloader.schedule(ImageDownloadJob {
+ key: entity.title.clone(),
+ urls: image,
+ timeout: Some(Duration::from_secs(10)),
+ })
+ }
+ let doc = entity_to_tantivy(entity, &self.schema);
+ self.writer.add_document(doc).unwrap();
+ }
+
+ pub fn commit(&mut self) {
+ self.writer.commit().unwrap();
+ self.reader.reload().unwrap();
+ self.attribute_occurrences.flush();
+ info!("downloading images");
+ self.image_downloader.download(&mut self.image_store);
+ }
+
+ fn related_entities(&self, doc: DocAddress) -> Vec<StoredEntity> {
+ let searcher = self.reader.searcher();
+ let more_like_this_query = MoreLikeThisQuery::builder()
+ .with_min_doc_frequency(1)
+ .with_min_term_frequency(1)
+ .with_min_word_length(2)
+ .with_boost_factor(1.0)
+ .with_document(doc);
+
+ let image_query = TermQuery::new(
+ Term::from_field_text(self.schema.get_field("has_image").unwrap(), "true"),
+ IndexRecordOption::WithFreqsAndPositions,
+ );
+
+ let query = BooleanQuery::from(vec![
+ (Occur::Must, more_like_this_query.box_clone()),
+ (Occur::Must, image_query.box_clone()),
+ ]);
+
+ match searcher.search(&query, &TopDocs::with_limit(1_000)) {
+ Ok(result) => result
+ .into_iter()
+ .filter(|(_, related_doc)| doc != *related_doc)
+ .map(|(_, doc_address)| {
+ self.retrieve_stored_entity(&searcher, &doc_address, false, false, false)
+ })
+ .filter(|entity| entity.image.is_some())
+ .take(4)
+ .collect(),
+ Err(_) => Vec::new(),
+ }
+ }
+
+ pub fn search(&self, query: String) -> Option<StoredEntity> {
+ let searcher = self.reader.searcher();
+
+ let title = self.schema.get_field("title").unwrap();
+ let entity_abstract = self.schema.get_field("abstract").unwrap();
+
+ let term_queries: Vec<(Occur, Box<dyn tantivy::query::Query>)> = query
+ .split(' ')
+ .map(|term| term.to_ascii_lowercase())
+ .filter(|term| !self.stopwords.contains(term))
+ .flat_map(|term| {
+ vec![
+ (
+ Occur::Must,
+ TermQuery::new(
+ Term::from_field_text(title, &term),
+ IndexRecordOption::WithFreqsAndPositions,
+ )
+ .box_clone(),
+ ),
+ (
+ Occur::Should,
+ TermQuery::new(
+ Term::from_field_text(entity_abstract, &term),
+ IndexRecordOption::WithFreqsAndPositions,
+ )
+ .box_clone(),
+ ),
+ ]
+ })
+ .collect();
+
+ let query = BooleanQuery::from(term_queries);
+
+ searcher
+ .search(&query, &TopDocs::with_limit(1))
+ .unwrap()
+ .first()
+ .map(|(_score, doc_address)| {
+ self.retrieve_stored_entity(&searcher, doc_address, true, true, true)
+ })
+ }
+
+ fn retrieve_stored_entity(
+ &self,
+ searcher: &LeasedItem<Searcher>,
+ doc_address: &DocAddress,
+ get_related: bool,
+ decode_info: bool,
+ get_links: bool,
+ ) -> StoredEntity {
+ let title = self.schema.get_field("title").unwrap();
+ let entity_abstract = self.schema.get_field("abstract").unwrap();
+ let info = self.schema.get_field("info").unwrap();
+ let links = self.schema.get_field("links").unwrap();
+
+ let doc = searcher.doc(*doc_address).unwrap();
+ let title = doc
+ .get_first(title)
+ .and_then(|val| match val {
+ tantivy::schema::Value::Str(string) => Some(string.clone()),
+ _ => None,
+ })
+ .unwrap();
+
+ let entity_abstract = doc
+ .get_first(entity_abstract)
+ .and_then(|val| match val {
+ tantivy::schema::Value::Str(string) => Some(string.clone()),
+ _ => None,
+ })
+ .unwrap();
+
+ let info = if decode_info {
+ bincode::deserialize(
+ doc.get_first(info)
+ .and_then(|val| match val {
+ tantivy::schema::Value::Bytes(bytes) => Some(bytes),
+ _ => None,
+ })
+ .unwrap(),
+ )
+ .unwrap()
+ } else {
+ BTreeMap::new()
+ };
+
+ let related_entities = if get_related {
+ self.related_entities(*doc_address)
+ } else {
+ Vec::new()
+ };
+
+ let image = self.retrieve_image(&title).map(|_| title.clone());
+
+ let links: Vec<Link> = if get_links {
+ bincode::deserialize(
+ doc.get_first(links)
+ .and_then(|val| match val {
+ tantivy::schema::Value::Bytes(bytes) => Some(bytes),
+ _ => None,
+ })
+ .unwrap(),
+ )
+ .unwrap()
+ } else {
+ Vec::new()
+ };
+
+ StoredEntity {
+ title,
+ entity_abstract,
+ image,
+ related_entities,
+ info,
+ links,
+ }
+ }
+
+ pub fn retrieve_image(&self, key: &String) -> Option<Image> {
+ self.image_store.get(key)
+ }
+
+ pub fn get_attribute_occurrence(&self, attribute: &String) -> Option<u32> {
+ self.attribute_occurrences.get(attribute)
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use std::collections::HashSet;
+
+ use super::*;
+
+ #[test]
+ fn wikipedia_image_url_aristotle() {
+ assert_eq!(
+ wikipedify_url("Aristotle Altemps Inv8575.jpg".to_string().into())
+ .first()
+ .unwrap()
+ .full(),
+ "https://upload.wikimedia.org/wikipedia/commons/a/ae/Aristotle_Altemps_Inv8575.jpg"
+ .to_string()
+ );
+ }
+
+ #[test]
+ fn wikipedia_image_url_with_file() {
+ assert_eq!(
+ wikipedify_url("File:Aristotle Altemps Inv8575.jpg".to_string().into())
+ .first()
+ .unwrap()
+ .full(),
+ "https://upload.wikimedia.org/wikipedia/commons/a/ae/Aristotle_Altemps_Inv8575.jpg"
+ .to_string()
+ );
+ }
+
+ #[test]
+ fn stopwords_title_ignored() {
+ let mut index = EntityIndex::open(crate::gen_temp_path()).unwrap();
+
+ index.insert(Entity {
+ title: "the ashes".to_string(),
+ page_abstract: Span {
+ text: String::new(),
+ links: Vec::new(),
+ },
+ info: BTreeMap::new(),
+ image: None,
+ paragraphs: Vec::new(),
+ categories: HashSet::new(),
+ });
+
+ index.commit();
+
+ assert_eq!(index.search("the".to_string()), None);
+ assert_eq!(
+ index.search("ashes".to_string()).unwrap().title.as_str(),
+ "the ashes"
+ );
+ assert_eq!(
+ index
+ .search("the ashes".to_string())
+ .unwrap()
+ .title
+ .as_str(),
+ "the ashes"
+ );
+ }
+}
diff --git a/src/entrypoint/entity.rs b/src/entrypoint/entity.rs
new file mode 100644
index 00000000..530ebc5b
--- /dev/null
+++ b/src/entrypoint/entity.rs
@@ -0,0 +1,504 @@
+// Cuely is an open source web search engine.
+// Copyright (C) 2022 Cuely ApS
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use std::{
+ collections::{BTreeMap, HashSet},
+ fs::File,
+ io::{BufRead, BufReader},
+};
+
+use crate::{
+ entity_index::{
+ entity::{Entity, Link, Paragraph, Span},
+ EntityIndex,
+ },
+ Result,
+};
+
+use bzip2::bufread::MultiBzDecoder;
+use parse_wiki_text::Node;
+use quick_xml::{events::Event, Reader};
+
+struct EntityIterator<R: BufRead> {
+ inside_title: bool,
+ inside_text: bool,
+ buf: Vec<u8>,
+ current_entity: Option<EntityBuilder>,
+ reader: Reader<R>,
+}
+
+impl<R: BufRead> From<R> for EntityIterator<R> {
+ fn from(reader: R) -> Self {
+ Self {
+ inside_title: false,
+ inside_text: false,
+ buf: Vec::new(),
+ current_entity: None,
+ reader: Reader::from_reader(reader),
+ }
+ }
+}
+
+impl<R: BufRead> Iterator for EntityIterator<R> {
+ type Item = Entity;
+
+ fn next(&mut self) -> Option<Self::Item> {
+ loop {
+ match self.reader.read_event(&mut self.buf) {
+ Ok(Event::Start(ref e)) if e.name() == b"page" => {
+ self.current_entity = Some(EntityBuilder::new());
+ }
+ Ok(Event::End(ref e)) if e.name() == b"page" => {
+ if let Some(entity) = self.current_entity.take() {
+ if let Some(entity) = entity.build() {
+ return Some(entity);
+ }
+ }
+ }
+ Ok(Event::Empty(ref e)) if e.name() == b"redirect" => {
+ self.current_entity = None;
+ }
+ Ok(Event::Start(ref e)) if e.name() == b"title" => {
+ self.inside_title = true;
+ }
+ Ok(Event::End(ref e)) if e.name() == b"title" => {
+ self.inside_title = false;
+ }
+ Ok(Event::Start(ref e)) if e.name() == b"text" => {
+ self.inside_text = true;
+ }
+ Ok(Event::End(ref e)) if e.name() == b"text" => {
+ self.inside_text = false;
+ }
+ Ok(Event::Text(e)) => {
+ if self.inside_title {
+ if let Some(entity) = &mut self.current_entity {
+ let bytes = e.unescaped().unwrap();
+ entity.append_title(self.reader.decode(&bytes).unwrap());
+ }
+ } else if self.inside_text {
+ if let Some(entity) = &mut self.current_entity {
+ let bytes = e.unescaped().unwrap();
+ entity.append_text(self.reader.decode(&bytes).unwrap());
+ }
+ }
+ }
+ Ok(Event::Eof) | Err(_) => break,
+ _ => (),
+ }
+ }
+
+ None
+ }
+}
+
+pub struct EntityIndexer;
+
+impl EntityIndexer {
+ pub fn run(wikipedia_dump_path: String, output_path: String) -> Result<()> {
+ let reader = BufReader::new(File::open(wikipedia_dump_path)?);
+ let reader = BufReader::new(MultiBzDecoder::new(reader));
+ let mut index = EntityIndex::open(output_path)?;
+ EntityIterator::from(reader)
+ .into_iter()
+ .filter(|entity| !entity.categories.is_empty())
+ .take(200_000)
+ .for_each(|entity| {
+ index.insert(entity);
+ });
+
+ index.commit();
+
+ Ok(())
+ }
+}
+
+#[derive(Debug)]
+pub struct EntityBuilder {
+ title: String,
+ text: String,
+}
+
+impl EntityBuilder {
+ pub fn new() -> Self {
+ EntityBuilder {
+ title: String::new(),
+ text: String::new(),
+ }
+ }
+
+ pub fn append_title(&mut self, text: &str) {
+ self.title.push_str(text);
+ }
+
+ pub fn append_text(&mut self, text: &str) {
+ self.text.push_str(text);
+ }
+
+ fn extract_info(&self) -> BTreeMap<String, Span> {
+ let parsed_wiki = parse_wiki_text::Configuration::default().parse(&self.text);
+ let mut result = BTreeMap::new();
+ for node in parsed_wiki.nodes.into_iter() {
+ match node {
+ Node::Template { end: _, name, parameters, start: _ } if name.iter().any(|n| matches!(n, Node::Text { end: _, start: _, value } if value.starts_with("Infobox"))) => {
+ for parameter in parameters {
+ if let Some(names) = parameter.name {
+ if let Some(&Node::Text { end: _, start: _, value: info_name}) = names.first() {
+ let value = Span::from(parameter.value);
+ result.insert(info_name.to_string(), value);
+ }
+ }
+ }
+ break;
+ }
+ _ => {}
+ }
+ }
+
+ result
+ .into_iter()
+ .filter(|(_key, val)| !val.text.is_empty())
+ .collect()
+ }
+
+ fn extract_text(&self) -> (Option<Span>, Vec<Paragraph>) {
+ let parsed_wiki = parse_wiki_text::Configuration::default().parse(&self.text);
+ let mut current_paragraph: Option<Paragraph> = None;
+ let mut paragraphs = Vec::new();
+
+ for node in parsed_wiki
+ .nodes
+ .into_iter()
+ .skip_while(|node| matches!(node, Node::ParagraphBreak { end: _, start: _ }))
+ {
+ match node {
+ Node::Text {
+ end: _,
+ start: _,
+ value,
+ } => match current_paragraph.as_mut() {
+ Some(current_paragraph) => {
+ current_paragraph.content.text.push_str(value);
+ }
+ None => {
+ current_paragraph = Some(Paragraph {
+ title: None,
+ content: Span {
+ text: value.to_string(),
+ links: Vec::new(),
+ },
+ })
+ }
+ },
+ Node::Heading {
+ end: _,
+ level: _,
+ nodes,
+ start: _,
+ } => {
+ if let Some(current_paragraph) = current_paragraph.take() {
+ paragraphs.push(current_paragraph)
+ }
+
+ let title: String = itertools::intersperse(
+ nodes.into_iter().filter_map(|node| match node {
+ Node::Text {
+ end: _,
+ start: _,
+ value,
+ } => Some(value),
+ _ => None,
+ }),
+ "",
+ )
+ .collect();
+
+ let title = if title.is_empty() { None } else { Some(title) };
+
+ current_paragraph = Some(Paragraph {
+ title,
+ content: Span {
+ text: String::new(),
+ links: Vec::new(),
+ },
+ })
+ }
+ Node::Link {
+ end: _,
+ start: _,
+ target,
+ text,
+ } => {
+ let text: String = itertools::intersperse(
+ text.into_iter().filter_map(|node| match node {
+ Node::Text {
+ end: _,
+ start: _,
+ value,
+ } => Some(value),
+ _ => None,
+ }),
+ "",
+ )
+ .collect();
+
+ match current_paragraph.as_mut() {
+ Some(current_paragraph) => {
+ let link = Link {
+ start: current_paragraph.content.text.chars().count(),
+ end: current_paragraph.content.text.chars().count()
+ + text.chars().count(),
+ target: target.to_string(),
+ };
+ current_paragraph.content.add_link(text, link)
+ }
+ None => {
+ let link = Link {
+ start: 0,
+ end: text.chars().count(),
+ target: target.to_string(),
+ };
+ current_paragraph = Some(Paragraph {
+ title: None,
+ content: Span {
+ text,
+ links: vec![link],
+ },
+ })
+ }
+ }
+ }
+ _ => {}
+ }
+ }
+
+ let page_abstract = if !paragraphs.is_empty() {
+ let page_abstract = paragraphs.remove(0).content;
+ Some(page_abstract)
+ } else {
+ None
+ };
+
+ (page_abstract, paragraphs)
+ }
+
+ fn extract_categories(&self) -> HashSet<String> {
+ let mut result = HashSet::new();
+ let parsed_wiki = parse_wiki_text::Configuration::default().parse(&self.text);
+
+ for node in parsed_wiki.nodes {
+ if let Node::Category {
+ end: _,
+ ordinal: _,
+ start: _,
+ target,
+ } = node
+ {
+ if let Some((_, cat)) = target.split_once(':') {
+ result.insert(cat.to_string());
+ }
+ }
+ }
+
+ result
+ }
+
+ pub fn build(self) -> Option<Entity> {
+ let categories = self.extract_categories();
+
+ if categories.contains("Disambiguation") {
+ return None;
+ }
+
+ let mut info = self.extract_info();
+ let image = info.remove("image").map(|span| span.text.into());
+
+ let (page_abstract, paragraphs) = self.extract_text();
+
+ page_abstract.map(|page_abstract| Entity {
+ title: self.title,
+ info,
+ image,
+ page_abstract,
+ paragraphs,
+ categories,
+ })
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn aristotle() {
+ let entity = EntityBuilder {
+ title: "Aristotle".to_string(),
+ text: include_str!("../../testcases/entity/aristotle.txt").to_string(),
+ }
+ .build()
+ .unwrap();
+
+ assert_eq!(&entity.title, "Aristotle");
+ assert_eq!(
+ entity.info.get("birth_date"),
+ Some(&Span {
+ text: "384 BC".to_string(),
+ links: vec![]
+ })
+ );
+ assert_eq!(
+ entity.info.get("birth_place"),
+ Some(&Span {
+ text: "Stagira, Chalcidice".to_string(),
+ links: vec![
+ Link {
+ start: 0,
+ end: 7,
+ target: "Stagira (ancient city)".to_string()
+ },
+ Link {
+ start: 9,
+ end: 19,
+ target: "Chalcidice".to_string()
+ }
+ ]
+ })
+ );
+ assert_eq!(
+ entity.info.get("death_date"),
+ Some(&Span {
+ text: "322 BC (aged 61–62)".to_string(),
+ links: vec![]
+ })
+ );
+
+ assert_eq!(
+ entity.image,
+ Some("Aristotle Altemps Inv8575.jpg".to_string().into())
+ );
+
+ assert!(
+ entity.page_abstract.text.trim().starts_with("Aristotle (; Aristotélēs, ; 384–322BC) was a Greek philosopher and polymath during the Classical period in Ancient Greece"));
+
+ assert!(entity.categories.contains("Aristotle"));
+ assert!(entity.categories.contains("Acting theorists"));
+
+ assert_eq!(
+ entity.page_abstract.links[0],
+ Link {
+ start: 58,
+ end: 69,
+ target: "philosopher".to_string()
+ }
+ )
+ }
+
+ #[test]
+ fn barack_obama() {
+ let entity = EntityBuilder {
+ title: "Barack Obama".to_string(),
+ text: include_str!("../../testcases/entity/obama.txt").to_string(),
+ }
+ .build()
+ .unwrap();
+
+ assert_eq!(&entity.title, "Barack Obama");
+ assert_eq!(
+ entity.info.get("office"),
+ Some(&Span {
+ text: "President of the United States".to_string(),
+ links: vec![]
+ })
+ );
+ assert_eq!(
+ entity.info.get("birth_date"),
+ Some(&Span {
+ text: "1961 8 4".to_string(), // this is not optimal, but good enough for now
+ links: vec![]
+ })
+ );
+ assert_eq!(
+ entity.info.get("spouse"),
+ Some(&Span {
+ text: "Michelle Robinson October 3, 1992".to_string(),
+ links: vec![Link {
+ start: 0,
+ end: 17,
+ target: "Michelle Obama".to_string()
+ }]
+ })
+ );
+ assert_eq!(
+ entity.info.get("birth_place"),
+ Some(&Span {
+ text: "Honolulu, Hawaii, U.S.".to_string(),
+ links: vec![
+ Link {
+ start: 0,
+ end: 8,
+ target: "Honolulu".to_string()
+ },
+ Link {
+ start: 10,
+ end: 16,
+ target: "Hawaii".to_string()
+ }
+ ]
+ })
+ );
+ assert_eq!(entity.info.get("death_date"), None);
+
+ assert_eq!(
+ entity.image,
+ Some("President Barack Obama.jpg".to_string().into())
+ );
+
+ assert!(
+ entity.page_abstract.text.trim().starts_with("Barack Hussein Obama II ( ; born August 4, 1961) is an American politician who served as the 44th president of the United States from 2009 to 2017. A member of the Democratic Party, he was the first African-American president of the United States."));
+
+ assert!(entity.categories.contains("Nobel Peace Prize laureates"));
+ assert!(entity.categories.contains("Obama family"));
+ }
+
+ #[test]
+ fn algorithm() {
+ let entity = EntityBuilder {
+ title: "Algorithm".to_string(),
+ text: include_str!("../../testcases/entity/algorithm.txt").to_string(),
+ }
+ .build()
+ .unwrap();
+
+ assert_eq!(&entity.title, "Algorithm");
+ assert!(entity.info.is_empty());
+ assert!(entity.image.is_none());
+
+ assert!(entity.page_abstract.text.trim().starts_with("In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problemss or to perform a computation."));
+
+ assert!(entity.categories.contains("Algorithms"));
+ }
+
+ #[test]
+ fn skip_disambiguation_pages() {
+ assert!(EntityBuilder {
+ title: "Test".to_string(),
+ text: include_str!("../../testcases/entity/disambiguation.txt").to_string(),
+ }
+ .build()
+ .is_none());
+ }
+}
diff --git a/src/entrypoint/frontend.rs b/src/entrypoint/frontend.rs
index e7af1fab..27b88c2d 100644
--- a/src/entrypoint/frontend.rs
+++ b/src/entrypoint/frontend.rs
@@ -18,8 +18,13 @@ use anyhow::Result;
use crate::frontend::router;
-pub async fn run(index_path: &str, queries_csv_path: &str, host: &str) -> Result<()> {
- let app = router(index_path, queries_csv_path)?;
+pub async fn run(
+ index_path: &str,
+ queries_csv_path: &str,
+ entity_index_path: Option<String>,
+ host: &str,
+) -> Result<()> {
+ let app = router(index_path, queries_csv_path, entity_index_path)?;
let addr = host.parse()?;
tracing::info!("listening on {}", addr);
axum::Server::bind(&addr)
diff --git a/src/entrypoint/mod.rs b/src/entrypoint/mod.rs
index 220fc6a6..eba431b0 100644
--- a/src/entrypoint/mod.rs
+++ b/src/entrypoint/mod.rs
@@ -14,10 +14,12 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
mod centrality;
+mod entity;
pub mod frontend;
mod indexer;
mod webgraph;
pub use centrality::CentralityEntrypoint;
+pub use entity::EntityIndexer;
pub use indexer::Indexer;
pub use webgraph::WebgraphEntrypoint;
diff --git a/src/frontend/entity_image.rs b/src/frontend/entity_image.rs
new file mode 100644
index 00000000..d33440b5
--- /dev/null
+++ b/src/frontend/entity_image.rs
@@ -0,0 +1,43 @@
+// Cuely is an open source web search engine.
+// Copyright (C) 2022 Cuely ApS
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use std::sync::Arc;
+
+use axum::body::Body;
+use axum::extract::Path;
+use axum::http::Response;
+use axum::response::IntoResponse;
+use axum::Extension;
+use reqwest::StatusCode;
+
+use super::State;
+
+pub async fn route(
+ Path(entity): Path<String>,
+ Extension(state): Extension<Arc<State>>,
+) -> impl IntoResponse {
+ let img = state.searcher.entity_image(entity);
+
+ let bytes = match img {
+ Some(img) => img.as_raw_bytes(),
+ None => Vec::new(),
+ };
+
+ Response::builder()
+ .status(StatusCode::OK)
+ .body(Body::from(bytes))
+ .unwrap()
+}
diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs
index c26f68f9..2c41b481 100644
--- a/src/frontend/mod.rs
+++ b/src/frontend/mod.rs
@@ -16,7 +16,9 @@
use axum::{Extension, Router};
-use crate::{autosuggest::Autosuggest, index::Index, searcher::Searcher};
+use crate::{
+ autosuggest::Autosuggest, entity_index::EntityIndex, index::Index, searcher::Searcher,
+};
use anyhow::Result;
use std::sync::Arc;
@@ -29,6 +31,7 @@ use axum::{
use axum_extra::routing::SpaRouter;
mod autosuggest;
+mod entity_image;
mod favicons;
mod index;
mod primary_image;
@@ -57,10 +60,15 @@ where
}
}
-pub fn router(index_path: &str, queries_csv_path: &str) -> Result<Router> {
+pub fn router(
+ index_path: &str,
+ queries_csv_path: &str,
+ entity_index_path: Option<String>,
+) -> Result<Router> {
+ let entity_index = entity_index_path.map(|path| EntityIndex::open(path).unwrap());
let search_index = Index::open(index_path)?;
let autosuggest = Autosuggest::load_csv(queries_csv_path)?;
- let searcher = Searcher::from(search_index);
+ let searcher = Searcher::new(search_index, entity_index);
let state = Arc::new(State {
searcher,
@@ -73,6 +81,7 @@ pub fn router(index_path: &str, queries_csv_path: &str) -> Result<Router> {
.route("/autosuggest", get(autosuggest::route))
.route("/favicons/:site", get(favicons::route))
.route("/image/:uuid", get(primary_image::route))
+ .route("/entity/image/:entity", get(entity_image::route))
.merge(SpaRouter::new("/static", "static"))
.layer(Extension(state)))
}
diff --git a/src/frontend/search.rs b/src/frontend/search.rs
index 6d4026b9..022d8897 100644
--- a/src/frontend/search.rs
+++ b/src/frontend/search.rs
@@ -15,10 +15,15 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use axum::Extension;
-use chrono::{NaiveDateTime, Utc};
-
-use crate::{inverted_index::RetrievedWebpage, webpage::Url};
-use std::collections::HashMap;
+use chrono::{NaiveDate, NaiveDateTime, Utc};
+
+use crate::{
+ entity_index::{entity::Span, StoredEntity},
+ inverted_index::RetrievedWebpage,
+ searcher::Searcher,
+ webpage::Url,
+};
+use std::collections::{BTreeMap, HashMap};
use std::sync::Arc;
use super::{HtmlTemplate, State};
@@ -120,11 +125,115 @@ impl From<RetrievedWebpage> for DisplayedWebpage {
}
}
+pub struct DisplayedEntity {
+ pub title: String,
+ pub small_abstract: String,
+ pub image: Option<String>,
+ pub related_entities: Vec<DisplayedEntity>,
+ pub info: Vec<(String, String)>,
+}
+
+fn prepare_info(info: BTreeMap<String, Span>, searcher: &Searcher) -> Vec<(String, String)> {
+ let mut info: Vec<_> = info.into_iter().collect();
+
+ info.sort_by(|(a, _), (b, _)| {
+ searcher
+ .attribute_occurrence(b)
+ .unwrap_or(0)
+ .cmp(&searcher.attribute_occurrence(a).unwrap_or(0))
+ });
+
+ info.into_iter()
+ .map(|(key, value)| {
+ let mut value = entity_link_to_html(value, 150).replace('*', "•");
+
+ if value.starts_with('•') || value.starts_with("\n•") {
+ if let Some(first_bullet) = value.find('•') {
+ value = value.chars().skip(first_bullet + 1).collect();
+ }
+ }
+
+ let value = maybe_prettify_entity_date(value);
+
+ (key.replace('_', " "), value)
+ })
+ .filter(|(key, _)| {
+ !matches!(
+ key.as_str(),
+ "caption"
+ | "image size"
+ | "label"
+ | "landscape"
+ | "signature"
+ | "name"
+ | "website"
+ | "logo"
+ | "image caption"
+ )
+ })
+ .take(5)
+ .collect()
+}
+
+impl DisplayedEntity {
+ fn from(entity: StoredEntity, searcher: &Searcher) -> Self {
+ let entity_abstract = Span {
+ text: entity.entity_abstract,
+ links: entity.links,
+ };
+
+ let small_abstract = entity_link_to_html(entity_abstract, 300);
+
+ Self {
+ title: entity.title,
+ small_abstract,
+ image: entity.image,
+ related_entities: entity
+ .related_entities
+ .into_iter()
+ .map(|entity| DisplayedEntity::from(entity, searcher))
+ .collect(),
+ info: prepare_info(entity.info, searcher),
+ }
+ }
+}
+
+fn maybe_prettify_entity_date(value: String) -> String {
+ if let Ok(date) = NaiveDate::parse_from_str(value.trim(), "%Y %-m %-d") {
+ return format!("{}", date.format("%d/%m/%Y"));
+ }
+
+ if value.split_whitespace().count() == 6 {
+ let first_date = NaiveDate::parse_from_str(
+ itertools::intersperse(value.split_whitespace().take(3), " ")
+ .collect::<String>()
+ .as_str(),
+ "%Y %-m %-d",
+ );
+ let second_date = NaiveDate::parse_from_str(
+ itertools::intersperse(value.split_whitespace().skip(3), " ")
+ .collect::<String>()
+ .as_str(),
+ "%Y %-m %-d",
+ );
+
+ if let (Ok(first_date), Ok(second_date)) = (first_date, second_date) {
+ // the dates are reversed from the parser, so we need to return second_date before first_date
+ return format!("{}", second_date.format("%d/%m/%Y"))
+ + " - "
+ + format!("{}", first_date.format("%d/%m/%Y")).as_str();
+ }
+ }
+
+ value
+}
+
#[derive(Template)]
#[template(path = "search.html", escape = "none")]
struct SearchTemplate {
search_result: Vec<DisplayedWebpage>,
query: String,
+ entity: Option<DisplayedEntity>,
}
pub async fn route(
@@ -133,29 +242,107 @@ pub async fn route(
) -> impl IntoResponse {
let mut search_result = Vec::new();
let mut displayed_query = String::new();
+ let mut entity = None;
if let Some(query) = params.get("q") {
displayed_query = query.clone();
let result = state.searcher.search(query).expect("Search failed");
search_result = result
+ .webpages
.documents
.into_iter()
+ .map(|mut webpage| {
+ webpage.primary_image_uuid = webpage.primary_image_uuid.and_then(|uuid| {
+ if state.searcher.primary_image(uuid.clone()).is_some() {
+ Some(uuid)
+ } else {
+ None
+ }
+ });
+
+ webpage
+ })
.map(DisplayedWebpage::from)
.collect();
+
+ entity = result
+ .entity
+ .map(|entity| DisplayedEntity::from(entity, &state.searcher));
}
let template = SearchTemplate {
search_result,
query: displayed_query,
+ entity,
};
HtmlTemplate(template)
}
+fn entity_link_to_html(span: Span, trunace_to: usize) -> String {
+ let mut s = span.text;
+
+ let truncated = s.len() > trunace_to;
+ if truncated {
+ s = s.chars().take(trunace_to).collect();
+ }
+
+ let chars = s.chars();
+ let num_chars = chars.clone().count();
+
+ let mut res = String::new();
+
+ let mut last_link_end = 0;
+ for link in span.links {
+ if link.start > num_chars {
+ break;
+ }
+
+ res += chars
+ .clone()
+ .skip(last_link_end)
+ .take(link.start - last_link_end)
+ .collect::<String>()
+ .as_str();
+
+ let link_text: String = chars
+ .clone()
+ .skip(link.start)
+ .take(link.end - link.start)
+ .collect();
+
+ res += format!(
+ "<a href=\"https://en.wikipedia.org/wiki/{}\">",
+ link.target.replace(' ', "_")
+ )
+ .as_str();
+
+ res += link_text.as_str();
+
+ res += "</a>";
+
+ last_link_end = link.end;
+ }
+
+ res += chars
+ .clone()
+ .skip(last_link_end)
+ .collect::<String>()
+ .as_str();
+
+ if truncated {
+ res += "...";
+ }
+
+ res
+}
+
#[cfg(test)]
mod tests {
use chrono::{DateTime, Utc};
+ use crate::entity_index::entity::Link;
+
use super::*;
#[test]
@@ -183,4 +370,57 @@ mod tests {
.naive_local();
assert_eq!(prettify_date(date), "19. Dec. 1996".to_string());
}
+
+ #[test]
+ fn simple_link_to_html() {
+ assert_eq!(
+ entity_link_to_html(
+ Span {
+ text: "some text with a link".to_string(),
+ links: vec![Link {
+ start: 5,
+ end: 9,
+ target: "text article".to_string()
+ }]
+ },
+ 10000
+ ),
+ "some <a href=\"https://en.wikipedia.org/wiki/text_article\">text</a> with a link"
+ .to_string()
+ )
+ }
+
+ #[test]
+ fn truncated_link_to_html() {
+ assert_eq!(
+ entity_link_to_html(
+ Span {
+ text: "some text".to_string(),
+ links: vec![Link {
+ start: 5,
+ end: 9,
+ target: "text article".to_string()
+ }]
+ },
+ 7
+ ),
+ "some <a href=\"https://en.wikipedia.org/wiki/text_article\">te</a>...".to_string()
+ )
+ }
+
+ #[test]
+ fn einstein_date() {
+ assert_eq!(
+ maybe_prettify_entity_date("1879 3 14 ".to_string()),
+ "14/03/1879".to_string()
+ );
+ }
+
+ #[test]
+ fn entity_date_span_prettify() {
+ assert_eq!(
+ maybe_prettify_entity_date(" 1999 5 27 1879 3 14 ".to_string()),
+ "14/03/1879 - 27/05/1999".to_string()
+ );
+ }
}
diff --git a/src/image_downloader.rs b/src/image_downloader.rs
new file mode 100644
index 00000000..aba0c63e
--- /dev/null
+++ b/src/image_downloader.rs
@@ -0,0 +1,136 @@
+// Cuely is an open source web search engine.
+// Copyright (C) 2022 Cuely ApS
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+use futures::StreamExt;
+use std::{collections::HashSet, hash::Hash, time::Duration};
+
+use serde::Serialize;
+
+use crate::{
+ image_store::{Image, ImageStore},
+ webpage::Url,
+};
+
+#[derive(Clone, Debug)]
+pub struct ImageDownloadJob<K>
+where
+ K: std::fmt::Debug + Serialize + Hash + PartialEq + Eq + Clone,
+{
+ pub key: K,
+ pub urls: Vec<Url>,
+ pub timeout: Option<Duration>,
+}
+
+impl<K> ImageDownloadJob<K>
+where
+ K: std::fmt::Debug + Serialize + Hash + PartialEq + Eq + Clone,
+{
+ async fn download(self) -> Option<DownloadedImage<K>> {
+ for url in &self.urls {
+ if let Some(image) = url
+ .download_bytes(self.timeout.unwrap_or_else(|| Duration::from_secs(20)))
+ .await
+ .and_then(|bytes| Image::from_bytes(bytes).ok())
+ .map(|image| DownloadedImage {
+ image,
+ key: self.key.clone(),
+ })
+ {
+ return Some(image);
+ }
+ }
+
+ None
+ }
+}
+
+impl<K> Hash for ImageDownloadJob<K>
+where
+ K: std::fmt::Debug + Serialize + Hash + PartialEq + Eq + Clone,
+{
+ fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
+ self.key.hash(state);
+ }
+}
+
+impl<K> PartialEq for ImageDownloadJob<K>
+where
+ K: std::fmt::Debug + Serialize + Hash + PartialEq + Eq + Clone,
+{
+ fn eq(&self, other: &Self) -> bool {
+ self.key == other.key
+ }
+}
+
+impl<K> Eq for ImageDownloadJob<K> where
+ K: std::fmt::Debug + Serialize + Hash + PartialEq + Eq + Clone
+{
+}
+
+#[derive(Debug)]
+struct DownloadedImage<K>
+where
+ K: std::fmt::Debug + Serialize,
+{
+ image: Image,
+ key: K,
+}
+pub struct ImageDownloader<K>
+where
+ K: std::fmt::Debug + Serialize + Hash + PartialEq + Eq + Clone,
+{
+ image_download_jobs: HashSet<ImageDownloadJob<K>>,
+}
+
+impl<K> ImageDownloader<K>
+where
+ K: std::fmt::Debug + Serialize + Hash + PartialEq + Eq + Clone,
+{
+ pub fn new() -> Self {
+ Self {
+ image_download_jobs: HashSet::new(),
+ }
+ }
+ pub fn download(&mut self, store: &mut impl ImageStore<K>) {
+ tokio::runtime::Builder::new_multi_thread()
+ .enable_all()
+ .build()
+ .unwrap()
+ .block_on(async { self.download_pending_images_async(store).await });
+
+ self.image_download_jobs.clear();
+ }
+
+ async fn download_pending_images_async(&mut self, store: &mut impl ImageStore<K>) {
+ let results = futures::stream::iter(
+ self.image_download_jobs
+ .drain()
+ .map(|job| async move { job.download().await }),
+ )
+ .buffer_unordered(20)
+ .collect::<Vec<Option<DownloadedImage<K>>>>()
+ .await;
+
+ for result in results.into_iter().flatten() {
+ store.insert(result.key, result.image);
+ }
+
+ store.flush();
+ }
+
+ pub fn schedule(&mut self, image_download_job: ImageDownloadJob<K>) {
+ self.image_download_jobs.insert(image_download_job);
+ }
+}
diff --git a/src/image_store.rs b/src/image_store.rs
index 6fd05ba6..d817417b 100644
--- a/src/image_store.rs
+++ b/src/image_store.rs
@@ -77,12 +77,19 @@ impl<'de> de::Deserialize<'de> for Image {
}
}
-struct ImageStore {
+pub trait ImageStore<K: Serialize> {
+ fn insert(&mut self, key: K, image: Image);
+ fn get(&self, key: &K) -> Option<Image>;
+ fn merge(&mut self, other: Self);
+ fn flush(&self);
+}
+
+struct BaseImageStore {
store: Box<dyn Kv<String, Image>>,
filters: Vec<Box<dyn ImageFilter>>,
}
-impl ImageStore {
+impl BaseImageStore {
#[cfg(test)]
fn open<P: AsRef<Path>>(path: P) -> Self {
Self::open_with_filters(path, Vec::new())
@@ -94,25 +101,29 @@ impl ImageStore {
Self { store, filters }
}
- fn insert(&mut self, key: &str, mut image: Image) {
+ fn insert(&mut self, key: String, mut image: Image) {
for filter in &self.filters {
image = filter.transform(image);
}
- self.store.insert(key.to_string(), image)
+ self.store.insert(key, image)
+ }
+
+ fn flush(&self) {
+ self.store.flush();
}
- fn contains(&self, key: &str) -> bool {
- self.store.get(&key.to_string()).is_some()
+ fn contains(&self, key: &String) -> bool {
+ self.store.get(key).is_some()
}
- fn get(&self, key: &str) -> Option<Image> {
- self.store.get(&key.to_string())
+ fn get(&self, key: &String) -> Option<Image> {
+ self.store.get(key)
}
- fn merge(&mut self, other: ImageStore) {
+ fn merge(&mut self, other: BaseImageStore) {
for (key, image) in other.store.iter() {
- self.insert(&key, image);
+ self.insert(key, image);
}
}
}
@@ -136,11 +147,11 @@ impl ImageFilter for ResizeFilter {
}
}
-pub struct FaviconStore(ImageStore);
+pub struct FaviconStore(BaseImageStore);
impl FaviconStore {
pub fn open<P: AsRef<Path>>(path: P) -> Self {
- let store = ImageStore::open_with_filters(
+ let store = BaseImageStore::open_with_filters(
path,
vec![Box::new(ResizeFilter {
width: FAVICON_SIZE,
@@ -151,31 +162,37 @@ impl FaviconStore {
Self(store)
}
- pub fn insert(&mut self, key: &str, image: Image) {
- self.0.insert(key, image)
+ pub fn contains(&self, key: &String) -> bool {
+ self.0.contains(key)
}
+}
- pub fn contains(&self, key: &str) -> bool {
- self.0.contains(key)
+impl ImageStore<String> for FaviconStore {
+ fn insert(&mut self, key: String, image: Image) {
+ self.0.insert(key, image)
}
- pub fn get(&self, key: &str) -> Option<Image> {
+ fn get(&self, key: &String) -> Option<Image> {
self.0.get(key)
}
- pub fn merge(&mut self, other: Self) {
+ fn merge(&mut self, other: Self) {
self.0.merge(other.0)
}
+
+ fn flush(&self) {
+ self.0.flush()
+ }
}
pub struct PrimaryImageStore {
- store: ImageStore,
+ store: BaseImageStore,
promised_uuids: HashSet<Uuid>,
}
impl PrimaryImageStore {
pub fn open<P: AsRef<Path>>(path: P) -> Self {
- let store = ImageStore::open_with_filters(
+ let store = BaseImageStore::open_with_filters(
path,
vec![Box::new(ResizeFilter {
width: 200,
@@ -189,35 +206,88 @@ impl PrimaryImageStore {
}
}
- pub fn insert(&mut self, uuid: Uuid, image: Image) {
+ pub fn generate_uuid(&mut self) -> Uuid {
+ let mut uuid = Uuid::new_v4();
+
+ while self.store.contains(&uuid.to_string()) || self.promised_uuids.contains(&uuid) {
+ uuid = Uuid::new_v4();
+ }
+
+ self.promised_uuids.insert(uuid);
+
+ uuid
+ }
+}
+
+impl ImageStore<Uuid> for PrimaryImageStore {
+ fn insert(&mut self, uuid: Uuid, image: Image) {
self.promised_uuids.remove(&uuid);
- self.store.insert(&uuid.to_string(), image);
+ self.store.insert(uuid.to_string(), image);
}
- pub fn get(&self, uuid: &Uuid) -> Option<Image> {
- self.store.get(uuid.to_string().as_str())
+ fn get(&self, uuid: &Uuid) -> Option<Image> {
+ self.store.get(&uuid.to_string())
}
- pub fn merge(&mut self, other: Self) {
+ fn merge(&mut self, other: Self) {
self.store.merge(other.store)
}
- pub fn generate_uuid(&mut self) -> Uuid {
- let mut uuid = Uuid::new_v4();
+ fn flush(&self) {
+ self.store.flush()
+ }
+}
- while self.store.contains(&uuid.to_string()) || self.promised_uuids.contains(&uuid) {
- uuid = Uuid::new_v4();
- }
+pub struct EntityImageStore {
+ store: BaseImageStore,
+}
- self.promised_uuids.insert(uuid);
+impl EntityImageStore {
+ pub fn open<P: AsRef<Path>>(path: P) -> Self {
+ let store = BaseImageStore::open_with_filters(
+ path,
+ vec![Box::new(ResizeFilter {
+ width: 200,
+ height: 200,
+ })],
+ );
- uuid
+ Self { store }
+ }
+}
+
+impl ImageStore<String> for EntityImageStore {
+ fn insert(&mut self, entity_name: String, image: Image) {
+ self.store.insert(entity_name, image);
+ }
+
+ fn get(&self, entity_name: &String) -> Option<Image> {
+ self.store.get(entity_name)
+ }
+
+ fn merge(&mut self, other: Self) {
+ self.store.merge(other.store)
+ }
+
+ fn flush(&self) {
+ self.store.flush()
}
}
impl Image {
pub(crate) fn from_bytes(bytes: Vec<u8>) -> Result<Image> {
- Ok(Self(image::load_from_memory(&bytes)?))
+ if let Ok(img) = image::load_from_memory(&bytes) {
+ Ok(Self(img))
+ } else if let Ok(img) =
+ image::load_from_memory_with_format(&bytes, image::ImageFormat::Jpeg)
+ {
+ Ok(Self(img))
+ } else {
+ Ok(Self(image::load_from_memory_with_format(
+ &bytes,
+ image::ImageFormat::Png,
+ )?))
+ }
}
pub(crate) fn as_raw_bytes(&self) -> Vec<u8> {
@@ -257,14 +327,14 @@ mod tests {
let image = Image(
ImageBuffer::from_pixel(2, 2, image::Rgb::<u16>([u16::MAX, u16::MAX, u16::MAX])).into(),
);
- let key = "test";
- let mut store = ImageStore::open(crate::gen_temp_path());
-
- assert!(!store.contains(key));
- assert_eq!(store.get(key), None);
- store.insert(key, image.clone());
- assert!(store.contains(key));
- assert_eq!(store.get(key), Some(image));
+ let key = "test".to_string();
+ let mut store = BaseImageStore::open(crate::gen_temp_path());
+
+ assert!(!store.contains(&key));
+ assert_eq!(store.get(&key), None);
+ store.insert(key.clone(), image.clone());
+ assert!(store.contains(&key));
+ assert_eq!(store.get(&key), Some(image));
}
#[test]
@@ -301,14 +371,14 @@ mod tests {
let mut store = FaviconStore::open(crate::gen_temp_path());
- let key = "test";
+ let key = "test".to_string();
- assert!(!store.contains(key));
- assert_eq!(store.get(key), None);
- store.insert(key, image);
- assert!(store.contains(key));
+ assert!(!store.contains(&key));
+ assert_eq!(store.get(&key), None);
+ store.insert(key.clone(), image);
+ assert!(store.contains(&key));
- let retrieved_image = store.get(key).unwrap();
+ let retrieved_image = store.get(&key).unwrap();
assert_eq!(retrieved_image.0.width(), FAVICON_SIZE);
assert_eq!(retrieved_image.0.height(), FAVICON_SIZE);
}
diff --git a/src/index.rs b/src/index.rs
index 99f2d8f1..ea9b7f42 100644
--- a/src/index.rs
+++ b/src/index.rs
@@ -15,23 +15,21 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use std::cmp::Ordering;
-use std::collections::HashSet;
use std::fs;
use std::path::Path;
use std::sync::Arc;
use std::time::Duration;
-use futures::StreamExt;
use serde::{Deserialize, Serialize};
use tantivy::collector::Collector;
use tantivy::schema::Schema;
use uuid::Uuid;
use crate::directory::{self, DirEntry};
-use crate::image_store::{FaviconStore, Image, PrimaryImageStore};
-use crate::inverted_index::InvertedIndex;
+use crate::image_downloader::{ImageDownloadJob, ImageDownloader};
+use crate::image_store::{FaviconStore, Image, ImageStore, PrimaryImageStore};
+use crate::inverted_index::{InvertedIndex, InvertedIndexSearchResult};
use crate::query::Query;
-use crate::searcher::SearchResult;
use crate::webpage::{Url, Webpage};
use crate::Result;
@@ -40,49 +38,12 @@ const FAVICON_STORE_SUBFOLDER_NAME: &str = "favicon_store";
const PRIMARY_IMAGE_STORE_SUBFOLDER_NAME: &str = "primary_image_store";
const IMAGE_WEBPAGE_CENTRALITY_THRESHOLD: f64 = 0.0;
-#[derive(Clone, Hash, PartialEq, Eq, Debug)]
-enum ImageDownloadJob {
- Favicon(Url),
- PrimaryImage { key: Uuid, url: Url },
-}
-
-#[derive(Debug)]
-struct DownloadedImage {
- image: Image,
- key: String,
- original_job: ImageDownloadJob,
-}
-
-impl ImageDownloadJob {
- pub async fn download(&self) -> Option<DownloadedImage> {
- match self {
- ImageDownloadJob::Favicon(url) => url
- .download_bytes(Duration::from_secs(1))
- .await
- .and_then(|bytes| Image::from_bytes(bytes).ok())
- .map(|image| DownloadedImage {
- image,
- key: url.domain().to_string(),
- original_job: self.clone(),
- }),
- ImageDownloadJob::PrimaryImage { key, url } => url
- .download_bytes(Duration::from_secs(5))
- .await
- .and_then(|bytes| Image::from_bytes(bytes).ok())
- .map(|image| DownloadedImage {
- image,
- key: key.to_string(),
- original_job: self.clone(),
- }),
- }
- }
-}
-
pub struct Index {
inverted_index: InvertedIndex,
favicon_store: FaviconStore,
primary_image_store: PrimaryImageStore,
- image_download_jobs: HashSet<ImageDownloadJob>,
+ favicon_downloader: ImageDownloader<String>,
+ primary_image_downloader: ImageDownloader<Uuid>,
pub path: String,
}
@@ -103,8 +64,9 @@ impl Index {
inverted_index,
favicon_store,
primary_image_store,
+ primary_image_downloader: ImageDownloader::new(),
+ favicon_downloader: ImageDownloader::new(),
path: path.as_ref().to_str().unwrap().to_string(),
- image_download_jobs: HashSet::new(),
})
}
@@ -125,7 +87,7 @@ impl Index {
self.inverted_index.commit()
}
- pub fn search<C>(&self, query: &Query, collector: C) -> Result<SearchResult>
+ pub fn search<C>(&self, query: &Query, collector: C) -> Result<InvertedIndexSearchResult>
where
C: Collector<Fruit = Vec<(f64, tantivy::DocAddress)>>,
{
@@ -145,13 +107,20 @@ impl Index {
}
fn maybe_insert_favicon(&mut self, webpage: &Webpage) {
- if self.favicon_store.contains(webpage.html.domain()) {
+ if !webpage.html.is_homepage()
+ || self
+ .favicon_store
+ .contains(&webpage.html.domain().to_string())
+ {
return;
}
if let Some(favicon) = webpage.html.favicon() {
- self.image_download_jobs
- .insert(ImageDownloadJob::Favicon(favicon.link));
+ self.favicon_downloader.schedule(ImageDownloadJob {
+ key: favicon.link.domain().to_string(),
+ urls: vec![favicon.link],
+ timeout: Some(Duration::from_secs(1)),
+ });
}
}
@@ -168,45 +137,16 @@ impl Index {
let uuid = self.primary_image_store.generate_uuid();
webpage.set_primary_image_uuid(uuid);
- self.image_download_jobs
- .insert(ImageDownloadJob::PrimaryImage { key: uuid, url });
- }
- }
-
- pub fn download_pending_images(&mut self) {
- tokio::runtime::Builder::new_multi_thread()
- .enable_all()
- .build()
- .unwrap()
- .block_on(async { self.download_pending_images_async().await });
-
- self.image_download_jobs.clear();
- }
-
- async fn download_pending_images_async(&mut self) {
- let results = futures::stream::iter(
- self.image_download_jobs
- .iter()
- .map(|job| async move { job.download().await }),
- )
- .buffer_unordered(20)
- .collect::<Vec<Option<DownloadedImage>>>()
- .await;
-
- for result in results.into_iter().flatten() {
- match result.original_job {
- ImageDownloadJob::Favicon(_) => {
- self.favicon_store.insert(&result.key, result.image)
- }
- ImageDownloadJob::PrimaryImage { key, url: _ } => {
- self.primary_image_store.insert(key, result.image)
- }
- }
+ self.primary_image_downloader.schedule(ImageDownloadJob {
+ key: uuid,
+ urls: vec![url],
+ timeout: Some(Duration::from_secs(5)),
+ });
}
}
pub fn retrieve_favicon(&self, url: &Url) -> Option<Image> {
- self.favicon_store.get(url.domain())
+ self.favicon_store.get(&url.domain().to_string())
}
pub fn retrieve_primary_image(&self, uuid: &Uuid) -> Option<Image> {
@@ -216,6 +156,12 @@ impl Index {
pub fn schema(&self) -> Arc<Schema> {
self.inverted_index.schema()
}
+
+ pub(crate) fn download_pending_images(&mut self) {
+ self.favicon_downloader.download(&mut self.favicon_store);
+ self.primary_image_downloader
+ .download(&mut self.primary_image_store);
+ }
}
#[derive(Debug, Serialize, Deserialize)]
diff --git a/src/inverted_index.rs b/src/inverted_index.rs
index 76f3d376..094ceaf0 100644
--- a/src/inverted_index.rs
+++ b/src/inverted_index.rs
@@ -23,7 +23,6 @@ use tantivy::{DocAddress, Document, IndexReader, IndexWriter, LeasedItem};
use crate::image_store::Image;
use crate::query::Query;
use crate::schema::{Field, ALL_FIELDS};
-use crate::searcher::SearchResult;
use crate::snippet;
use crate::webpage::Webpage;
use crate::Result;
@@ -94,7 +93,7 @@ impl InvertedIndex {
Ok(())
}
- pub fn search<C>(&self, query: &Query, collector: C) -> Result<SearchResult>
+ pub fn search<C>(&self, query: &Query, collector: C) -> Result<InvertedIndexSearchResult>
where
C: Collector<Fruit = Vec<(f64, tantivy::DocAddress)>>,
{
@@ -118,7 +117,7 @@ impl InvertedIndex {
)?;
}
- Ok(SearchResult {
+ Ok(InvertedIndexSearchResult {
num_docs: count,
documents: webpages,
})
@@ -207,6 +206,12 @@ impl InvertedIndex {
}
}
+#[derive(Debug)]
+pub struct InvertedIndexSearchResult {
+ pub num_docs: usize,
+ pub documents: Vec<RetrievedWebpage>,
+}
+
#[derive(Default, Debug)]
pub struct RetrievedWebpage {
pub title: String,
diff --git a/src/lib.rs b/src/lib.rs
index cbc214b7..107ea854 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -28,8 +28,10 @@ pub mod mapreduce;
mod autosuggest;
mod directory;
+mod entity_index;
mod exponential_backoff;
mod frontend;
+mod image_downloader;
mod image_store;
mod index;
mod kv;
@@ -173,6 +175,9 @@ pub enum Error {
#[error("Image error")]
Image(#[from] image::ImageError),
+
+ #[error("XML parser error")]
+ XML(#[from] quick_xml::Error),
}
pub(crate) type Result<T> = std::result::Result<T, Error>;
diff --git a/src/main.rs b/src/main.rs
index 5cd069b5..7a6ae6d8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -15,7 +15,9 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use anyhow::Result;
use clap::{Parser, Subcommand};
-use cuely::entrypoint::{frontend, CentralityEntrypoint, Indexer, WebgraphEntrypoint};
+use cuely::entrypoint::{
+ frontend, CentralityEntrypoint, EntityIndexer, Indexer, WebgraphEntrypoint,
+};
use serde::de::DeserializeOwned;
use std::fs;
use std::path::Path;
@@ -47,6 +49,7 @@ enum Commands {
Frontend {
index_path: String,
queries_csv_path: String,
+ entity_index_path: Option<String>,
#[clap(default_value = "0.0.0.0:3000")]
host: String,
},
@@ -71,6 +74,10 @@ enum IndexingOptions {
Local {
config_path: String,
},
+ Entity {
+ wikipedia_dump_path: String,
+ output_path: String,
+ },
}
fn load_toml_config<T: DeserializeOwned, P: AsRef<Path>>(path: P) -> T {
@@ -102,6 +109,10 @@ fn main() -> Result<()> {
let config = load_toml_config(&config_path);
Indexer::run_locally(&config)?;
}
+ IndexingOptions::Entity {
+ wikipedia_dump_path,
+ output_path,
+ } => EntityIndexer::run(wikipedia_dump_path, output_path)?,
},
Commands::Centrality {
webgraph_path,
@@ -124,10 +135,16 @@ fn main() -> Result<()> {
index_path,
queries_csv_path,
host,
+ entity_index_path,
} => tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()?
- .block_on(frontend::run(&index_path, &queries_csv_path, &host))?,
+ .block_on(frontend::run(
+ &index_path,
+ &queries_csv_path,
+ entity_index_path,
+ &host,
+ ))?,
}
Ok(())
diff --git a/src/ranking/mod.rs b/src/ranking/mod.rs
index e9745a00..965490a6 100644
--- a/src/ranking/mod.rs
+++ b/src/ranking/mod.rs
@@ -95,9 +95,9 @@ mod tests {
index.commit().expect("failed to commit index");
let searcher = Searcher::from(index);
let result = searcher.search("great site").expect("Search failed");
- assert_eq!(result.documents.len(), 2);
- assert_eq!(result.documents[0].url, "https://www.b.com");
- assert_eq!(result.documents[1].url, "https://www.a.com");
+ assert_eq!(result.webpages.documents.len(), 2);
+ assert_eq!(result.webpages.documents[0].url, "https://www.b.com");
+ assert_eq!(result.webpages.documents[1].url, "https://www.a.com");
}
#[test]
@@ -167,8 +167,8 @@ mod tests {
let searcher = Searcher::from(index);
let result = searcher.search("dr dk").expect("Search failed");
- assert_eq!(result.documents.len(), 3);
- assert_eq!(result.documents[0].url, "https://www.dr.dk");
+ assert_eq!(result.webpages.documents.len(), 3);
+ assert_eq!(result.webpages.documents[0].url, "https://www.dr.dk");
}
#[test]
@@ -222,6 +222,6 @@ mod tests {
let searcher = Searcher::from(index);
let result = searcher.search("title").expect("Search failed");
- assert_eq!(result.documents[0].url, "https://www.new.com");
+ assert_eq!(result.webpages.documents[0].url, "https://www.new.com");
}
}
diff --git a/src/searcher.rs b/src/searcher.rs
index 6dad9666..8e43e832 100644
--- a/src/searcher.rs
+++ b/src/searcher.rs
@@ -18,9 +18,10 @@ use std::str::FromStr;
use uuid::Uuid;
+use crate::entity_index::{EntityIndex, StoredEntity};
use crate::image_store::Image;
use crate::index::Index;
-use crate::inverted_index::RetrievedWebpage;
+use crate::inverted_index::InvertedIndexSearchResult;
use crate::query::Query;
use crate::ranking::Ranker;
use crate::webpage::Url;
@@ -28,25 +29,43 @@ use crate::Result;
#[derive(Debug)]
pub struct SearchResult {
- pub num_docs: usize,
- pub documents: Vec<RetrievedWebpage>,
+ pub webpages: InvertedIndexSearchResult,
+ pub entity: Option<StoredEntity>,
}
pub struct Searcher {
index: Index,
+ entity_index: Option<EntityIndex>,
}
impl From<Index> for Searcher {
fn from(index: Index) -> Self {
- Searcher { index }
+ Self::new(index, None)
+ }
+}
+
+impl Searcher {
+ pub fn new(index: Index, entity_index: Option<EntityIndex>) -> Self {
+ Searcher {
+ index,
+ entity_index,
+ }
}
}
impl Searcher {
pub fn search(&self, query: &str) -> Result<SearchResult> {
+ let raw_query = query.to_string();
let query = Query::parse(query, self.index.schema())?;
let ranker = Ranker::new(query.clone());
- self.index.search(&query, ranker.collector())
+ let webpages = self.index.search(&query, ranker.collector())?;
+
+ let entity = self
+ .entity_index
+ .as_ref()
+ .and_then(|index| index.search(raw_query));
+
+ Ok(SearchResult { webpages, entity })
}
pub fn favicon(&self, site: &Url) -> Option<Image> {
@@ -59,4 +78,16 @@ impl Searcher {
}
None
}
+
+ pub fn entity_image(&self, entity: String) -> Option<Image> {
+ self.entity_index
+ .as_ref()
+ .and_then(|index| index.retrieve_image(&entity))
+ }
+
+ pub fn attribute_occurrence(&self, attribute: &String) -> Option<u32> {
+ self.entity_index
+ .as_ref()
+ .and_then(|index| index.get_attribute_occurrence(attribute))
+ }
}
diff --git a/src/snippet.rs b/src/snippet.rs
index 6715d565..79ce71e9 100644
--- a/src/snippet.rs
+++ b/src/snippet.rs
@@ -356,9 +356,9 @@ Survey in 2016, 2017, and 2018."#;
let result = searcher.search("rust language").expect("Search failed");
- assert_eq!(result.num_docs, 1);
- assert_eq!(result.documents.len(), 1);
- assert_eq!(result.documents[0].snippet, "<b>Rust</b> is a systems programming <b>language</b> sponsored by Mozilla which describes it as a \"safe, concurrent, practical <b>language</b>\", supporting functional and imperative-procedural paradigms. <b>Rust</b> is...".to_string());
+ assert_eq!(result.webpages.num_docs, 1);
+ assert_eq!(result.webpages.documents.len(), 1);
+ assert_eq!(result.webpages.documents[0].snippet, "<b>Rust</b> is a systems programming <b>language</b> sponsored by Mozilla which describes it as a \"safe, concurrent, practical <b>language</b>\", supporting functional and imperative-procedural paradigms. <b>Rust</b> is...".to_string());
}
#[test]
@@ -392,9 +392,9 @@ Survey in 2016, 2017, and 2018."#;
let result = searcher.search("describe").expect("Search failed");
- assert_eq!(result.num_docs, 1);
- assert_eq!(result.documents.len(), 1);
- assert_eq!(result.documents[0].snippet, "Rust is a systems programming language sponsored by Mozilla which <b>describes</b> it as a \"safe, concurrent, practical language\", supporting functional and imperative-procedural paradigms. Rust is...".to_string());
+ assert_eq!(result.webpages.num_docs, 1);
+ assert_eq!(result.webpages.documents.len(), 1);
+ assert_eq!(result.webpages.documents[0].snippet, "Rust is a systems programming language sponsored by Mozilla which <b>describes</b> it as a \"safe, concurrent, practical language\", supporting functional and imperative-procedural paradigms. Rust is...".to_string());
}
#[test]
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index db3426d6..7efd8991 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -14,7 +14,9 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
-use tantivy::tokenizer::{Language, LowerCaser, SimpleTokenizer, Stemmer, TextAnalyzer};
+use tantivy::tokenizer::{
+ Language, LowerCaser, SimpleTokenizer, Stemmer, StopWordFilter, TextAnalyzer,
+};
use whatlang::Lang;
struct MyStemmer(Stemmer);
@@ -68,12 +70,20 @@ impl Default for Tokenizer {
}
#[derive(Clone, Default)]
-pub struct NormalTokenizer {}
+pub struct NormalTokenizer {
+ stopwords: Option<Vec<String>>,
+}
impl NormalTokenizer {
pub fn as_str() -> &'static str {
"tokenizer"
}
+
+ pub fn with_stopwords(stopwords: Vec<String>) -> Self {
+ Self {
+ stopwords: Some(stopwords),
+ }
+ }
}
#[derive(Clone, Default)]
@@ -103,15 +113,21 @@ impl tantivy::tokenizer::Tokenizer for Tokenizer {
impl tantivy::tokenizer::Tokenizer for NormalTokenizer {
fn token_stream<'a>(&self, text: &'a str) -> tantivy::tokenizer::BoxTokenStream<'a> {
- TextAnalyzer::from(SimpleTokenizer)
- .filter(LowerCaser)
- .token_stream(text)
+ let mut analyzer = TextAnalyzer::from(SimpleTokenizer).filter(LowerCaser);
+
+ if let Some(stopwords) = &self.stopwords {
+ analyzer = analyzer.filter(StopWordFilter::remove(stopwords.clone()));
+ }
+
+ analyzer.token_stream(text)
}
}
impl tantivy::tokenizer::Tokenizer for StemmedTokenizer {
fn token_stream<'a>(&self, text: &'a str) -> tantivy::tokenizer::BoxTokenStream<'a> {
- let analyzer = TextAnalyzer::from(SimpleTokenizer).filter(LowerCaser);
+ let analyzer = TextAnalyzer::from(SimpleTokenizer)
+ .filter(LowerCaser)
+ .filter(StopWordFilter::remove(vec![]));
let lang = match self.force_language {
Some(lang) => Some(lang),
diff --git a/src/webpage/mod.rs b/src/webpage/mod.rs
index f6a8d2fd..3a699570 100644
--- a/src/webpage/mod.rs
+++ b/src/webpage/mod.rs
@@ -791,7 +791,7 @@ mod tests {
#[test]
#[ignore = "JustText doesn't find any content on the sites. How should we split into words for Japanese, Chinese etc.?"]
fn hard_parsing() {
- let webpage = Html::parse(include_str!("../../testcases_parsing/yasudaya.html"), "");
+ let webpage = Html::parse(include_str!("../../testcases/parsing/yasudaya.html"), "");
assert_eq!(
webpage.title(),
Some("パチンコ大当たり情報 - Pジューシーハニー3 大当たり詳細ページ - やすだひばりヶ丘店".to_string())
@@ -799,7 +799,7 @@ mod tests {
assert!(webpage.clean_text().is_some());
assert!(!webpage.clean_text().unwrap().is_empty());
- let webpage = Html::parse(include_str!("../../testcases_parsing/5390001.html"), "");
+ let webpage = Html::parse(include_str!("../../testcases/parsing/5390001.html"), "");
assert_eq!(
webpage.title(),
Some("特效烟机系列_山东壹线文化传播有限公司".to_string())
@@ -808,7 +808,7 @@ mod tests {
assert!(!webpage.clean_text().unwrap().is_empty());
let webpage = Html::parse(
- include_str!("../../testcases_parsing/77p2p-7.live-105.html"),
+ include_str!("../../testcases/parsing/77p2p-7.live-105.html"),
"",
);
assert_eq!(
diff --git a/src/webpage/url.rs b/src/webpage/url.rs
index ef3902a2..61659bf8 100644
--- a/src/webpage/url.rs
+++ b/src/webpage/url.rs
@@ -153,4 +153,8 @@ impl Url {
Err(_) => None,
}
}
+
+ pub fn raw(&self) -> &str {
+ &self.0
+ }
}
diff --git a/templates/entity.html b/templates/entity.html
new file mode 100644
index 00000000..068b3bd5
--- /dev/null
+++ b/templates/entity.html
@@ -0,0 +1,67 @@
+{% macro show_entity(entity) %}
+<div class="flex grow justify-center pt-3">
+ <div class="max-w-md flex flex-col items-center">
+ {% match entity.image %}
+ {% when Some(image) %}
+ <div class="w-lg mb-3">
+ <a href="https://en.wikipedia.org/wiki/{{ entity.title }}">
+ <img class="h-full w-full rounded-full" src="/entity/image/{{ image }}" />
+ </a>
+ </div>
+ {% when None %}
+ {% endmatch %}
+ <div class="text-xl mb-1">
+ <a href="https://en.wikipedia.org/wiki/{{ entity.title }}">{{ entity.title }}</a>
+ </div>
+ <div class="text-sm">
+ {{ entity.small_abstract }}
+ <span class="italic">
+ source: <a class="text-blue-600" href="https://en.wikipedia.org/wiki/{{ entity.title }}">wikipedia</a>
+ </span>
+ </div>
+ {% if !entity.info.is_empty() %}
+ <div class="flex flex-col text-sm mt-5 w-full">
+ <table class="border-separate border-spacing-x-4 border-spacing-y-1.5">
+ {% for (key, value) in entity.info %}
+ <tr class="align-top">
+ <td class="text-gray-400">
+ {{ key }}
+ </td>
+ <td>
+ {{ value }}
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ {% endif %}
+ {% if !entity.related_entities.is_empty() %}
+ <div class="flex flex-col mt-5 text-gray-500 w-full">
+ <div class="font-light">
+ Related Searches
+ </div>
+ <div class="flex">
+ {% for entity in entity.related_entities %}
+ <div class="flex flex-col items-center p-4">
+ {% match entity.image %}
+ {% when Some(image) %}
+ <div class="h-20 w-20 mb-3">
+ <a href="/search?q={{ entity.title }}">
+ <img class="h-full object-cover w-full rounded-full" src="/entity/image/{{ image }}" />
+ </a>
+ </div>
+ {% when None %}
+ {% endmatch %}
+ <div class="text-center">
+ <a href="/search?q={{ entity.title }}">
+ {{ entity.title }}
+ </a>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ {% endif %}
+ </div>
+</div>
+{% endmacro %}
\ No newline at end of file
diff --git a/templates/search.html b/templates/search.html
index 34ad54bf..cc0313ee 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -1,5 +1,6 @@
{% extends "base.html" %}
{% import "searchbar.html" as scope %}
+{% import "entity.html" as entity_scope %}
{% block content %}
@@ -13,41 +14,53 @@
{% call scope::searchbar("", query) %}
</div>
- <div class="search-result flex flex-col space-y-3 pt-8 pb-8 pl-40">
- {% for item in search_result %}
- <div class="flex max-w-2xl p-3 h-36">
- <div class="flex flex-col">
- <div class="text-sm mb-1 flex">
- <div class="flex items-center mr-2">
- <img src="/favicons/{{ item.domain }}" width="13px" />
+ <div class="flex pt-8">
+ <div class="search-result flex flex-col space-y-3 pb-8 pl-40">
+ {% for item in search_result %}
+ <div class="flex max-w-3xl w-full p-3 h-36">
+ <div class="flex flex-col w-full">
+ <div class="text-sm mb-1 flex">
+ <div class="flex items-center mr-2">
+ <img src="/favicons/{{ item.domain }}" width="13px" />
+ </div>
+ <div>
+ <a class="hover:no-underline text-gray-600" href="{{ item.url }}">{{ item.pretty_url }}</a>
+ </div>
</div>
- <div>
- <a class="hover:no-underline text-gray-600" href="{{ item.url }}">{{ item.pretty_url }}</a>
+ <div class="text-lg font-medium mb-1">
+ <a class="title-link" href="{{ item.url }}">{{ item.title }}</a>
+ </div>
+ <div class="text-sm">
+ {% match item.last_updated %}
+ {% when Some with (val) %}
+ <span class="text-gray-500">
+ {{ val }}
+ </span> —
+ {% when None %}
+ {% endmatch %}
+ {{ item.snippet }}
</div>
</div>
- <div class="text-lg font-medium mb-1">
- <a class="title-link" href="{{ item.url }}">{{ item.title }}</a>
- </div>
- <div class="text-sm">
- {% match item.last_updated %}
- {% when Some with (val) %}
- <span class="text-gray-500">
- {{ val }}
- </span> —
- {% when None %}
- {% endmatch %}
- {{ item.snippet }}
+ <div class="flex h-full items-center">
+ <div class="h-20 w-20 pl-2 pt-1 pb-1">
+ {% match item.primary_image_uuid %}
+ {% when Some with (val) %}
+ <a href="{{ item.url }}">
+ <img class="h-full w-full object-cover rounded-full" src="/image/{{ val }}" />
+ </a>
+ {% when None %}
+ {% endmatch %}
+ </div>
</div>
</div>
- {% match item.primary_image_uuid %}
- {% when Some with (val) %}
- <div class="aspect-square pl-3 h-full max-h-full">
- <img class="max-h-full h-full w-full object-cover rounded-full" src="/image/{{ val }}" />
- </div>
- {% when None %}
- {% endmatch %}
+ {% endfor %}
</div>
- {% endfor %}
+
+ {% match entity %}
+ {% when Some with (entity) %}
+ {% call entity_scope::show_entity(entity) %}
+ {% when None %}
+ {% endmatch %}
</div>
</div>
diff --git a/testcases/entity/algorithm.txt b/testcases/entity/algorithm.txt
new file mode 100644
index 00000000..90600398
--- /dev/null
+++ b/testcases/entity/algorithm.txt
@@ -0,0 +1,651 @@
+{{Short description|Sequence of instructions to perform a task}}
+{{Redirect|Algorithms|the subfield of computer science|Analysis of algorithms}}
+{{Other uses}}
+
+{{More citations needed|date=July 2022}}
+{{Use mdy dates|date=September 2017}}
+
+[[Image:Euclid flowchart.svg|thumb|right| [[Flowchart]] of an algorithm ([[Euclid's algorithm]]) for calculating the greatest common divisor (g.c.d.) of two numbers ''a'' and ''b'' in locations named A and B. The algorithm proceeds by successive subtractions in two loops: IF the test B ≥ A yields "yes" or "true" (more accurately, the ''number'' ''b'' in location B is greater than or equal to the ''number'' ''a'' in location A) THEN, the algorithm specifies B ← B − A (meaning the number ''b'' − ''a'' replaces the old ''b''). Similarly, IF A > B, THEN A ← A − B. The process terminates when (the contents of) B is 0, yielding the g.c.d. in A. (Algorithm derived from Scott 2009:13; symbols and drawing style from Tausworthe 1977).]]
+
+[[File:Diagram for the computation of Bernoulli numbers.jpg|thumb|[[Ada Lovelace]]'s diagram from "note G", the first published computer algorithm]]
+
+In [[mathematics]] and [[computer science]], an '''algorithm''' ({{IPAc-en|audio=en-us-algorithm.ogg|ˈ|æ|l|ɡ|ə|r|ɪ|ð|əm}}) is a finite sequence of [[rigorous]] instructions, typically used to solve a class of specific [[Computational problem|problem]]s or to perform a [[computation]].<ref>{{Cite web|url=https://www.merriam-webster.com/dictionary/algorithm|title=Definition of ALGORITHM|work=Merriam-Webster Online Dictionary |language=en |access-date=2019-11-14 |archive-url=https://web.archive.org/web/20200214074446/https://www.merriam-webster.com/dictionary/algorithm |archive-date=February 14, 2020|url-status=live}}</ref> Algorithms are used as specifications for performing [[calculation]]s and [[data processing]]. By making use of [[artificial intelligence]], algorithms can perform automated deductions (referred to as [[automated reasoning]]) and use mathematical and logical tests to divert the code execution through various routes (referred to as [[automated decision-making]]). Using human characteristics as descriptors of machines in metaphorical ways was already practiced by [[Alan Turing]] with terms such as "memory", "search" and "stimulus".<ref>Blair, Ann, Duguid, Paul, Goeing, Anja-Silvia and Grafton, Anthony. Information: A Historical Companion, Princeton: Princeton University Press, 2021. p. 247</ref>
+
+In contrast, a [[Heuristic (computer science)|heuristic]] is an approach to problem solving that may not be fully specified or may not guarantee correct or optimal results, especially in problem domains where there is no well-defined correct or optimal result.<ref>David A. Grossman, Ophir Frieder, ''Information Retrieval: Algorithms and Heuristics'', 2nd edition, 2004, {{isbn|1402030045}}</ref>
+
+As an [[effective method]], an algorithm can be expressed within a finite amount of space and time,<ref>"Any classical mathematical algorithm, for example, can be described in a finite number of English words" (Rogers 1987:2).</ref> and in a well-defined formal language<ref>Well defined with respect to the agent that executes the algorithm: "There is a computing agent, usually human, which can react to the instructions and carry out the computations" (Rogers 1987:2).</ref> for calculating a [[Function (mathematics)|function]].<ref>"an algorithm is a procedure for computing a ''function'' (with respect to some chosen notation for integers) ... this limitation (to numerical functions) results in no loss of generality", (Rogers 1987:1).</ref> Starting from an initial state and initial input (perhaps [[Empty string|empty]]),<ref>"An algorithm has [[zero]] or more inputs, i.e., [[Quantity|quantities]] which are given to it initially before the algorithm begins" (Knuth 1973:5).</ref> the instructions describe a [[computation]] that, when [[Execution (computing)|executed]], proceeds through a finite<ref>"A procedure which has all the characteristics of an algorithm except that it possibly lacks finiteness may be called a 'computational method{{'"}} (Knuth 1973:5).</ref> number of well-defined successive states, eventually producing "output"<ref>"An algorithm has one or more outputs, i.e. quantities which have a specified relation to the inputs" (Knuth 1973:5).</ref> and terminating at a final ending state. The transition from one state to the next is not necessarily [[deterministic]]; some algorithms, known as [[randomized algorithms]], incorporate random input.<ref>Whether or not a process with random interior processes (not including the input) is an algorithm is debatable. Rogers opines that: "a computation is carried out in a discrete stepwise fashion, without the use of continuous methods or analogue devices ... carried forward deterministically, without resort to random methods or devices, e.g., dice" (Rogers 1987:2).</ref>
+
+== History ==
+The concept of algorithm has existed since antiquity. [[Arithmetic]] algorithms, such as a [[division algorithm]], were used by ancient [[Babylonian mathematics|Babylonian mathematicians]] c. 2500 BC and [[Egyptian mathematics|Egyptian mathematicians]] c. 1550 BC.<ref name="Springer Science & Business Media" /> [[Greek mathematics|Greek mathematicians]] later used algorithms in 240 BC in the [[sieve of Eratosthenes]] for finding prime numbers, and the [[Euclidean algorithm]] for finding the [[greatest common divisor]] of two numbers.<ref name="Cooke2005">{{cite book|last=Cooke|first=Roger L.|title=The History of Mathematics: A Brief Course|date=2005|publisher=John Wiley & Sons|isbn=978-1-118-46029-0}}</ref> [[Arabic mathematics|Arabic mathematicians]] such as [[al-Kindi]] in the 9th century used [[cryptographic]] algorithms for [[code-breaking]], based on [[frequency analysis]].<ref name="Dooley" />
+
+The word ''algorithm'' is derived from the name of the 9th-century Persian mathematician [[Muhammad ibn Musa al-Khwarizmi|Muḥammad ibn Mūsā al-Khwārizmī]], whose [[Nisba (suffix)|nisba]] (identifying him as from [[Khwarazm]]) was Latinized ''as Algoritmi ([[Arabization|Arabized]] [[Persian language|Persian]] الخوارزمی c. 780–850).''<ref>{{cite web|title=Al-Khwarizmi biography|url=http://www-history.mcs.st-andrews.ac.uk/Biographies/Al-Khwarizmi.html|url-status=live|archive-url=https://web.archive.org/web/20190802091553/http://www-history.mcs.st-andrews.ac.uk/Biographies/Al-Khwarizmi.html|archive-date=August 2, 2019|access-date=May 3, 2017|website=www-history.mcs.st-andrews.ac.uk}}</ref><ref>{{cite web|title=Etymology of algorithm|url=http://chambers.co.uk/search/?query=algorithm&title=21st|url-status=live|archive-url=https://web.archive.org/web/20190331204600/https://chambers.co.uk/search/?query=algorithm&title=21st|archive-date=March 31, 2019|access-date=December 13, 2016|website=Chambers Dictionary}}</ref>
+[[Muhammad ibn Musa al-Khwarizmi|Muḥammad ibn Mūsā al-Khwārizmī]] was a mathematician, [[astronomer]], [[geographer]], and scholar in the [[House of Wisdom]] in [[Baghdad]], whose name means 'the native of [[Khwarazm]]', a region that was part of [[Greater Iran]] and is now in [[Uzbekistan]].<ref name="Hogendijk">{{cite journal|first=Jan P. |last=Hogendijk |title=al-Khwarzimi |journal=Pythagoras |volume=38 |issue=2 |year=1998 |pages=4–5 |url=http://www.kennislink.nl/web/show?id=116543 |url-status=dead |archive-url=https://web.archive.org/web/20090412193516/http://www.kennislink.nl/web/show?id=116543 |archive-date=April 12, 2009 }}</ref><ref name="Oaks">{{cite web|first=Jeffrey A.|last=Oaks|url=http://facstaff.uindy.edu/~oaks/MHMC.htm|title=Was al-Khwarizmi an applied algebraist?|publisher=[[University of Indianapolis]]|access-date=May 30, 2008|archive-url=https://web.archive.org/web/20110718094835/http://facstaff.uindy.edu/~oaks/MHMC.htm|archive-date=July 18, 2011|url-status=dead|df=mdy-all}}</ref> About 825, al-Khwarizmi wrote an [[Arabic language]] treatise on the [[Hindu–Arabic numeral system]], which was translated into [[Latin]] during the 12th century. The manuscript starts with the phrase ''Dixit Algorizmi'' ('Thus spake Al-Khwarizmi'), where "Algorizmi" was the translator's [[Latinisation of names|Latinization]] of Al-Khwarizmi's name.<ref>{{cite book| last = Brezina| first = Corona| title = Al-Khwarizmi: The Inventor Of Algebra| url = https://books.google.com/books?id=955jPgAACAAJ| year = 2006| publisher = The Rosen Publishing Group| isbn = 978-1-4042-0513-0 }}</ref> Al-Khwarizmi was the most widely read mathematician in Europe in the late Middle Ages, primarily through another of his books, the [[Al-Jabr|Algebra]].<ref>[http://www-history.mcs.st-and.ac.uk/Extras/Boyer_Foremost_Text.html Foremost mathematical texts in history] {{Webarchive|url=https://web.archive.org/web/20110609224820/http://www-history.mcs.st-and.ac.uk/Extras/Boyer_Foremost_Text.html |date=June 9, 2011 }}, according to [[Carl B. Boyer]].</ref> In late medieval Latin, ''algorismus'', English '[[algorism]]', the corruption of his name, simply meant the "decimal number system".<ref>{{Citation|title=algorismic|url=https://www.thefreedictionary.com/algorismic|work=The Free Dictionary|access-date=2019-11-14|archive-url=https://web.archive.org/web/20191221200124/https://www.thefreedictionary.com/algorismic|archive-date=December 21, 2019|url-status=live}}</ref> In the 15th century, under the influence of the Greek word ἀριθμός (''arithmos''), 'number' (''cf.'' 'arithmetic'), the Latin word was altered to ''algorithmus'', and the corresponding English term 'algorithm' is first attested in the 17th century; the modern sense was introduced in the 19th century.<ref>''[[Oxford English Dictionary]]'', Third Edition, 2012 [http://www.oed.com/view/Entry/4959 ''s.v.'']</ref>
+
+[[Indian mathematics]] was predominantly algorithmic.
+Algorithms that are representative of the Indian mathematical tradition range from the ancient ''[[Sulbasutras|Śulbasūtrās]]'' to the medieval texts of the [[Kerala school of astronomy and mathematics|Kerala School]].<ref>{{cite book |last1=Sriram |first1=M. S. |editor1-last=Emch |editor1-first=Gerard G. |editor2-last=Sridharan |editor2-first=R. |editor3-last=Srinivas |editor3-first=M. D. |title=Contributions to the History of Indian Mathematics |date=2005 |publisher=Springer |isbn=978-93-86279-25-5 |page=153 |chapter-url=https://books.google.com/books?id=qfJdDwAAQBAJ&pg=PA153 |language=en |chapter=Algorithms in Indian Mathematics}}</ref>
+
+In English, the word ''algorithm'' was first used in about 1230 and then by [[Geoffrey Chaucer|Chaucer]] in 1391. English adopted the French term, but it was not until the late 19th century that "algorithm" took on the meaning that it has in modern English.<ref>{{Cite journal|last=Mehri|first=Bahman|date=2017|title=From Al-Khwarizmi to Algorithm|journal=Olympiads in Informatics|volume=11|issue=2|pages=71–74|doi=10.15388/ioi.2017.special.11}}</ref>
+
+Another early use of the word is from 1240, in a manual titled ''Carmen de Algorismo'' composed by [[Alexander of Villedieu|Alexandre de Villedieu]]. It begins with:
+
+{{blockquote|''Haec algorismus ars praesens dicitur, in qua / Talibus Indorum fruimur bis quinque figuris.''}}
+which translates to:
+{{blockquote|Algorism is the art by which at present we use those Indian figures, which number two times five.}}
+
+The poem is a few hundred lines long and summarizes the art of calculating with the new styled Indian dice (''Tali Indorum''), or Hindu numerals.<ref>{{Cite web|url=http://members.peak.org/~jeremy/calculators/alKwarizmi.html|title=Abu Jafar Muhammad ibn Musa al-Khwarizmi|website=members.peak.org|access-date=2019-11-14|archive-url=https://web.archive.org/web/20190821232118/http://members.peak.org/~jeremy/calculators/alKwarizmi.html|archive-date=August 21, 2019|url-status=live}}</ref>
+
+A partial formalization of the modern concept of algorithm began with attempts to solve the ''[[Entscheidungsproblem]] '' (decision problem) posed by [[David Hilbert]] in 1928. Later formalizations were framed as attempts to define "[[effective calculability]]"<ref>Kleene 1943 in Davis 1965:274</ref> or "effective method".<ref>Rosser 1939 in Davis 1965:225</ref> Those formalizations included the [[Kurt Gödel|Gödel]]–[[Jacques Herbrand|Herbrand]]–[[Stephen Cole Kleene|Kleene]] [[Recursion (computer science)|recursive functions]] of 1930, 1934 and 1935, [[Alonzo Church]]'s [[lambda calculus]] of 1936, [[Emil Post]]'s [[Formulation 1]] of 1936, and [[Alan Turing]]'s [[Turing machines]] of 1936–37 and 1939.
+
+==Informal definition==
+{{for|a detailed presentation of the various points of view on the definition of "algorithm"|Algorithm characterizations}}
+An informal definition could be "a set of rules that precisely defines a sequence of operations",<ref>Stone 1973:4</ref>{{qn | reason = Stone (1972) suggests on page 4: "...any sequence of instructions that can be obeyed by a robot, is called an algorithm"|date=July 2020}} which would include all computer programs (including programs that do not perform numeric calculations), and (for example) any prescribed [[bureaucratic]] procedure<ref>
+{{cite book
+ | last1 = Simanowski
+ | first1 = Roberto
+ | author-link1 = Roberto Simanowski
+ | translator1-last = Chase
+ | translator1-first = Jefferson
+ | title = The Death Algorithm and Other Digital Dilemmas
+ | url = https://books.google.com/books?id=RJV5DwAAQBAJ
+ | series = Untimely Meditations
+ | volume = 14
+ | location = Cambridge, Massachusetts
+ | publisher = MIT Press
+ | date = 2018
+ | page = 147
+ | isbn = 9780262536370
+ | access-date = 27 May 2019
+ | quote = [...] the next level of abstraction of central bureaucracy: globally operating algorithms.
+ | archive-url = https://web.archive.org/web/20191222120705/https://books.google.com/books?id=RJV5DwAAQBAJ
+ | archive-date = December 22, 2019
+ | url-status = live
+ }}
+</ref>
+or [[Cookbook|cook-book]] [[recipe]].<ref>
+{{cite book
+ | last1 = Dietrich
+ | first1 = Eric
+ | year = 1999
+ | chapter = Algorithm
+ | editor1-last = Wilson
+ | editor1-first = Robert Andrew
+ | editor2-last = Keil
+ | editor2-first = Frank C.
+ | title = The MIT Encyclopedia of the Cognitive Sciences
+ | url = https://books.google.com/books?id=-wt1aZrGXLYC
+ | series = MIT Cognet library
+ | location = Cambridge, Massachusetts
+ | publisher = MIT Press
+ | publication-date = 2001
+ | page = 11
+ | isbn = 9780262731447
+ | access-date = 22 July 2020
+ | quote = An algorithm is a recipe, method, or technique for doing something.
+}}
+</ref>
+
+In general, a program is only an algorithm if it stops eventually<ref>Stone simply requires that "it must terminate in a finite number of steps" (Stone 1973:7–8).</ref>—even though [[infinite loop#Intentional looping|infinite loop]]s may sometimes prove desirable.
+
+A prototypical example of an algorithm is the [[Euclidean algorithm]], which is used to determine the maximum common divisor of two integers; an example (there are others) is described by the [[flowchart]] above and as an example in a later section.
+
+{{Harvtxt|Boolos|Jeffrey|1974, 1999|ref=CITEREFBoolosJeffrey1999}} offer an informal meaning of the word "algorithm" in the following quotation:
+
+{{blockquote|No human being can write fast enough, or long enough, or small enough† ( †"smaller and smaller without limit ... you'd be trying to write on molecules, on atoms, on electrons") to list all members of an enumerably infinite set by writing out their names, one after another, in some notation. But humans can do something equally useful, in the case of certain enumerably infinite sets: They can give ''explicit instructions for determining the '''n'''th member of the set'', for arbitrary finite ''n''. Such instructions are to be given quite explicitly, in a form in which ''they could be followed by a computing machine'', or by a ''human who is capable of carrying out only very elementary operations on symbols.''<ref>Boolos and Jeffrey 1974,1999:19</ref>}}
+
+An [[recursively enumerable set|"enumerably infinite set"]] is one whose elements can be put into one-to-one correspondence with the integers. Thus Boolos and Jeffrey are saying that an algorithm implies instructions for a process that "creates" output integers from an ''arbitrary'' "input" integer or integers that, in theory, can be arbitrarily large. For example, an algorithm can be an algebraic equation such as ''y = m + n'' (i.e., two arbitrary "input variables" ''m'' and ''n'' that produce an output ''y''), but various authors' attempts to define the notion indicate that the word implies much more than this, something on the order of (for the addition example):
+:Precise instructions (in a language understood by "the computer")<ref>cf Stone 1972:5</ref> for a fast, efficient, "good"<ref>Knuth 1973:7 states: "In practice we not only want algorithms, we want ''good'' algorithms ... one criterion of goodness is the length of time taken to perform the algorithm ... other criteria are the adaptability of the algorithm to computers, its simplicity, and elegance, etc."</ref> process that specifies the "moves" of "the computer" (machine or human, equipped with the necessary internally contained information and capabilities)<ref>cf Stone 1973:6</ref> to find, decode, and then process arbitrary input integers/symbols ''m'' and ''n'', symbols ''+'' and ''='' ... and "effectively"<ref>
+Stone 1973:7–8 states that there must be, "...a procedure that a robot [i.e., computer] can follow in order to determine precisely how to obey the instruction". Stone adds finiteness of the process, and definiteness (having no ambiguity in the instructions) to this definition.
+</ref> produce, in a "reasonable" time,<ref>Knuth, loc. cit</ref> output-integer ''y'' at a specified place and in a specified format.
+
+The concept of ''algorithm'' is also used to define the notion of [[decidability (logic)|decidability]]—a notion that is central for explaining how [[formal system]]s come into being starting from a small set of [[axiom]]s and rules. In [[logic]], the time that an algorithm requires to complete cannot be measured, as it is not apparently related to the customary physical dimension. From such uncertainties, that characterize ongoing work, stems the unavailability of a definition of ''algorithm'' that suits both concrete (in some sense) and abstract usage of the term.
+
+Most algorithms are intended to be [[Implementation|implement]]ed as [[computer programs]]. However, algorithms are also implemented by other means, such as in a [[biological neural network]] (for example, the [[human brain]] implementing [[arithmetic]] or an insect looking for food), in an [[electrical circuit]], or in a mechanical device.
+
+==Formalization==
+<!-- [[Computer program]] links here. -->
+Algorithms are essential to the way computers process data. Many computer programs contain algorithms that detail the specific instructions a computer should perform—in a specific order—to carry out a specified task, such as calculating employees' paychecks or printing students' report cards. Thus, an algorithm can be considered to be any sequence of operations that can be simulated by a [[Turing reduction|Turing-complete]] system. Authors who assert this thesis include Minsky (1967), Savage (1987) and Gurevich (2000):
+{{blockquote| Minsky: "But we will also maintain, with Turing ... that any procedure which could "naturally" be called effective, can, in fact, be realized by a (simple) machine. Although this may seem extreme, the arguments ... in its favor are hard to refute".<ref name="Minsky 1967:105">{{harvnb|Minsky|1967|page=105}}</ref>
+
+ Gurevich: "… Turing's informal argument in favor of his thesis justifies a stronger thesis: every algorithm can be simulated by a Turing machine … according to Savage [1987], an algorithm is a computational process defined by a Turing machine".<ref>Gurevich 2000:1, 3</ref>}}Turing machines can define computational processes that do not terminate. The informal definitions of algorithms generally require that the algorithm always terminates. This requirement renders the task of deciding whether a formal procedure is an algorithm impossible in the general case—due to a major theorem of [[computability theory]] known as the [[halting problem]].
+
+Typically, when an algorithm is associated with processing information, data can be read from an input source, written to an output device and stored for further processing. Stored data are regarded as part of the internal state of the entity performing the algorithm. In practice, the state is stored in one or more [[data structure]]s.
+
+For some of these computational processes, the algorithm must be rigorously defined: specified in the way it applies in all possible circumstances that could arise. This means that any conditional steps must be systematically dealt with, case-by-case; the criteria for each case must be clear (and computable).
+
+Because an algorithm is a precise list of precise steps, the order of computation is always crucial to the functioning of the algorithm. Instructions are usually assumed to be listed explicitly, and are described as starting "from the top" and going "down to the bottom"—an idea that is described more formally by ''[[control flow|flow of control]]''.
+
+So far, the discussion on the formalization of an algorithm has assumed the premises of [[imperative programming]]. This is the most common conception—one which attempts to describe a task in discrete, "mechanical" means. Unique to this conception of formalized algorithms is the [[assignment operation]], which sets the value of a variable. It derives from the intuition of "[[memory]]" as a scratchpad. An example of such an assignment can be found below.
+
+For some alternate conceptions of what constitutes an algorithm, see [[functional programming]] and [[logic programming]].
+
+==Expressing algorithms==
+Algorithms can be expressed in many kinds of notation, including [[natural language]]s, [[pseudocode]], [[flowchart]]s, [[DRAKON|drakon-charts]], [[programming language]]s or [[control table]]s (processed by [[Interpreter (computing)|interpreters]]). Natural language expressions of algorithms tend to be verbose and ambiguous, and are rarely used for complex or technical algorithms. Pseudocode, flowcharts, [[DRAKON|drakon-charts]] and control tables are structured ways to express algorithms that avoid many of the ambiguities common in the statements based on natural language. Programming languages are primarily intended for expressing algorithms in a form that can be executed by a computer, but are also often used as a way to define or document algorithms.
+
+There is a wide variety of representations possible and one can express a given [[Turing machine]] program as a sequence of machine tables (see [[finite-state machine]], [[state transition table]] and [[control table]] for more), as flowcharts and [[DRAKON|drakon-charts]] (see [[state diagram]] for more), or as a form of rudimentary [[machine code]] or [[assembly code]] called "sets of quadruples" (see [[Turing machine]] for more).
+
+Representations of algorithms can be classed into three accepted levels of Turing machine description, as follows:<ref>Sipser 2006:157</ref>
+; 1 High-level description
+: "...prose to describe an algorithm, ignoring the implementation details. At this level, we do not need to mention how the machine manages its tape or head."
+; 2 Implementation description
+: "...prose used to define the way the Turing machine uses its head and the way that it stores data on its tape. At this level, we do not give details of states or transition function."
+; 3 Formal description
+: Most detailed, "lowest level", gives the Turing machine's "state table".
+
+For an example of the simple algorithm "Add m+n" described in all three levels, see [[#Examples|Examples]].
+
+==Design==
+{{See also|Algorithm#By design paradigm}}
+
+Algorithm design refers to a method or a mathematical process for problem-solving and engineering algorithms. The design of algorithms is part of many solution theories of [[operation research]], such as [[dynamic programming]] and [[divide-and-conquer algorithm|divide-and-conquer]]. Techniques for designing and implementing algorithm designs are also called algorithm design patterns,<ref>{{citation|url=http://ww3.algorithmdesign.net/ch00-front.html|title=Algorithm Design: Foundations, Analysis, and Internet Examples|last1=Goodrich|first1=Michael T.|author1-link=Michael T. Goodrich|last2=Tamassia|first2=Roberto|author2-link=Roberto Tamassia|publisher=John Wiley & Sons, Inc.|year=2002|isbn=978-0-471-38365-9|access-date=June 14, 2018|archive-url=https://web.archive.org/web/20150428201622/http://ww3.algorithmdesign.net/ch00-front.html|archive-date=April 28, 2015|url-status=live}}</ref> with examples including the template method pattern and the decorator pattern.
+
+One of the most important aspects of algorithm design is resource (run-time, memory usage) efficiency; the [[big O notation]] is used to describe e.g. an algorithm's run-time growth as the size of its input increases.
+
+Typical steps in the development of algorithms:
+# Problem definition
+# Development of a model
+# Specification of the algorithm
+# Designing an algorithm
+# Checking the [[correctness (computer science)|correctness]] of the algorithm
+# Analysis of algorithm
+# Implementation of algorithm
+# Program testing
+# Documentation preparation{{clarify|reason=These steps are typically used in every day *software* development. In contrast, coming up with a new *algorithm* requires some ingenuity, and often lead(s) to a research article in a computer science journal; it can hardly be broken down into receipt-like steps.|date=December 2020}}
+
+==Computer algorithms==
+[[Image:TTL npn nand.svg|right|thumb|[[Logical NAND]] algorithm implemented electronically in [[7400 series|7400]] chip]]
+[[File:Euclid's algorithm structured blocks 1.png|thumb|Flowchart examples of the canonical [[Structured program theorem|Böhm-Jacopini structures]]: the SEQUENCE (rectangles descending the page), the WHILE-DO and the IF-THEN-ELSE. The three structures are made of the primitive conditional GOTO ({{code|1=IF test THEN GOTO step xxx}}, shown as diamond), the unconditional GOTO (rectangle), various assignment operators (rectangle), and HALT (rectangle). Nesting of these structures inside assignment-blocks result in complex diagrams (cf. Tausworthe 1977:100, 114).]]
+
+''"Elegant" (compact) programs, "good" (fast) programs '': The notion of "simplicity and elegance" appears informally in [[Donald Knuth|Knuth]] and precisely in [[Gregory Chaitin|Chaitin]]:
+:Knuth: " ... we want ''good'' algorithms in some loosely defined aesthetic sense. One criterion ... is the length of time taken to perform the algorithm .... Other criteria are adaptability of the algorithm to computers, its simplicity and elegance, etc."<ref>Knuth 1973:7</ref>
+
+:Chaitin: " ... a program is 'elegant,' by which I mean that it's the smallest possible program for producing the output that it does"<ref>Chaitin 2005:32</ref>
+
+Chaitin prefaces his definition with: "I'll show you can't prove that a program is 'elegant{{'"}}—such a proof would solve the [[Halting problem]] (ibid).
+
+''Algorithm versus function computable by an algorithm'': For a given function multiple algorithms may exist. This is true, even without expanding the available instruction set available to the programmer. Rogers observes that "It is ... important to distinguish between the notion of ''algorithm'', i.e. procedure and the notion of ''function computable by algorithm'', i.e. mapping yielded by procedure. The same function may have several different algorithms".<ref>Rogers 1987:1–2</ref>
+
+Unfortunately, there may be a tradeoff between goodness (speed) and elegance (compactness)—an elegant program may take more steps to complete a computation than one less elegant. An example that uses Euclid's algorithm appears below.
+
+''Computers (and computors), models of computation'': A computer (or human "computor"<ref>In his essay "Calculations by Man and Machine: Conceptual Analysis" Seig 2002:390 credits this distinction to Robin Gandy, cf Wilfred Seig, et al., 2002 ''Reflections on the foundations of mathematics: Essays in honor of Solomon Feferman'', Association for Symbolic Logic, A.K. Peters Ltd, Natick, MA.</ref>) is a restricted type of machine, a "discrete deterministic mechanical device"<ref>cf Gandy 1980:126, Robin Gandy ''Church's Thesis and Principles for Mechanisms'' appearing on pp. 123–148 in [[Jon Barwise|J. Barwise]] et al. 1980 ''The Kleene Symposium'', North-Holland Publishing Company.</ref> that blindly follows its instructions.<ref>A "robot": "A computer is a robot that performs any task that can be described as a sequence of instructions." cf Stone 1972:3</ref> Melzak's and Lambek's primitive models<ref>Lambek's "abacus" is a "countably infinite number of locations (holes, wires etc.) together with an unlimited supply of counters (pebbles, beads, etc.). The locations are distinguishable, the counters are not". The holes have unlimited capacity, and standing by is an agent who understands and is able to carry out the list of instructions" (Lambek 1961:295). Lambek references Melzak who defines his Q-machine as "an indefinitely large number of locations ... an indefinitely large supply of counters distributed among these locations, a program, and an operator whose sole purpose is to carry out the program" (Melzak 1961:283). B-B-J (loc. cit.) add the stipulation that the holes are "capable of holding any number of stones" (p. 46). Both Melzak and Lambek appear in ''The [[Canadian Mathematical Bulletin]]'', vol. 4, no. 3, September 1961.</ref> reduced this notion to four elements: (i) discrete, distinguishable ''locations'', (ii) discrete, indistinguishable ''counters''<ref>If no confusion results, the word "counters" can be dropped, and a location can be said to contain a single "number".</ref> (iii) an agent, and (iv) a list of instructions that are ''effective'' relative to the capability of the agent.<ref>"We say that an instruction is ''effective'' if there is a procedure that the robot can follow in order to determine precisely how to obey the instruction." (Stone 1972:6)</ref>
+
+Minsky describes a more congenial variation of Lambek's "abacus" model in his "Very Simple Bases for [[Computability]]".<ref>cf Minsky 1967: Chapter 11 "Computer models" and Chapter 14 "Very Simple Bases for Computability" pp. 255–281, in particular,</ref> [[Minsky machine|Minsky's machine]] proceeds sequentially through its five (or six, depending on how one counts) instructions unless either a conditional IF-THEN GOTO or an unconditional GOTO changes program flow out of sequence. Besides HALT, Minsky's machine includes three ''assignment'' (replacement, substitution)<ref>cf Knuth 1973:3.</ref> operations: ZERO (e.g. the contents of location replaced by 0: L ← 0), SUCCESSOR (e.g. L ← L+1), and DECREMENT (e.g. L ← L − 1).<ref>But always preceded by IF-THEN to avoid improper subtraction.</ref> Rarely must a programmer write "code" with such a limited instruction set. But Minsky shows (as do Melzak and Lambek) that his machine is [[Turing complete]] with only four general ''types'' of instructions: conditional GOTO, unconditional GOTO, assignment/replacement/substitution, and HALT. However, a few different assignment instructions (e.g. DECREMENT, INCREMENT, and ZERO/CLEAR/EMPTY for a Minsky machine) are also required for Turing-completeness; their exact specification is somewhat up to the designer. The unconditional GOTO is a convenience; it can be constructed by initializing a dedicated location to zero e.g. the instruction " Z ← 0 "; thereafter the instruction IF Z=0 THEN GOTO xxx is unconditional.
+
+''Simulation of an algorithm: computer (computor) language'': Knuth advises the reader that "the best way to learn an algorithm is to try it . . . immediately take pen and paper and work through an example".<ref>Knuth 1973:4</ref> But what about a simulation or execution of the real thing? The programmer must translate the algorithm into a language that the simulator/computer/computor can ''effectively'' execute. Stone gives an example of this: when computing the roots of a quadratic equation the computor must know how to take a square root. If they don't, then the algorithm, to be effective, must provide a set of rules for extracting a square root.<ref>Stone 1972:5. Methods for extracting roots are not trivial: see [[Methods of computing square roots]].</ref>
+
+This means that the programmer must know a "language" that is effective relative to the target computing agent (computer/computor).
+
+But what model should be used for the simulation? Van Emde Boas observes "even if we base [[Computational complexity theory|complexity theory]] on abstract instead of concrete machines, arbitrariness of the choice of a model remains. It is at this point that the notion of ''simulation'' enters".<ref>{{cite book| last = Leeuwen| first = Jan| title = Handbook of Theoretical Computer Science: Algorithms and complexity. Volume A| url = https://books.google.com/books?id=-X39_rA3VSQC| year = 1990| publisher = Elsevier| isbn = 978-0-444-88071-0 | page = 85}}</ref> When speed is being measured, the instruction set matters. For example, the subprogram in Euclid's algorithm to compute the remainder would execute much faster if the programmer had a "[[modular arithmetic|modulus]]" instruction available rather than just subtraction (or worse: just Minsky's "decrement").
+
+''Structured programming, canonical structures'': Per the [[Church–Turing thesis]], any algorithm can be computed by a model known to be [[Turing complete]], and per Minsky's demonstrations, Turing completeness requires only four instruction types—conditional GOTO, unconditional GOTO, assignment, HALT. Kemeny and Kurtz observe that, while "undisciplined" use of unconditional GOTOs and conditional IF-THEN GOTOs can result in "[[spaghetti code]]", a programmer can write structured programs using only these instructions; on the other hand "it is also possible, and not too hard, to write badly structured programs in a structured language".<ref>[[John G. Kemeny]] and [[Thomas E. Kurtz]] 1985 ''Back to Basic: The History, Corruption, and Future of the Language'', Addison-Wesley Publishing Company, Inc. Reading, MA, {{ISBN|0-201-13433-0}}.</ref> Tausworthe augments the three [[Structured program theorem|Böhm-Jacopini canonical structures]]:<ref>Tausworthe 1977:101</ref> SEQUENCE, IF-THEN-ELSE, and WHILE-DO, with two more: DO-WHILE and CASE.<ref>Tausworthe 1977:142</ref> An additional benefit of a structured program is that it lends itself to [[proof of correctness|proofs of correctness]] using [[mathematical induction]].<ref>Knuth 1973 section 1.2.1, expanded by Tausworthe 1977 at pages 100ff and Chapter 9.1</ref>
+
+''Canonical flowchart symbols<ref>cf Tausworthe 1977</ref>'': The graphical aide called a [[flowchart]], offers a way to describe and document an algorithm (and a computer program of one). Like the program flow of a Minsky machine, a flowchart always starts at the top of a page and proceeds down. Its primary symbols are only four: the directed arrow showing program flow, the rectangle (SEQUENCE, GOTO), the diamond (IF-THEN-ELSE), and the dot (OR-tie). The Böhm–Jacopini canonical structures are made of these primitive shapes. Sub-structures can "nest" in rectangles, but only if a single exit occurs from the superstructure. The symbols, and their use to build the canonical structures are shown in the diagram.
+
+==Examples==
+{{further|List of algorithms}}
+
+===Algorithm example===
+One of the simplest algorithms is to find the largest number in a list of numbers of random order. Finding the solution requires looking at every number in the list. From this follows a simple algorithm, which can be stated in a high-level description in English prose, as:
+
+''High-level description:''
+# If there are no numbers in the set then there is no highest number.
+# Assume the first number in the set is the largest number in the set.
+# For each remaining number in the set: if this number is larger than the current largest number, consider this number to be the largest number in the set.
+# When there are no numbers left in the set to iterate over, consider the current largest number to be the largest number of the set.
+
+''(Quasi-)formal description:''
+Written in prose but much closer to the high-level language of a computer program, the following is the more formal coding of the algorithm in [[pseudocode]] or [[pidgin code]]:
+
+{{algorithm-begin|name=LargestNumber}}
+ Input: A list of numbers ''L''.
+ Output: The largest number in the list ''L''.
+
+ '''if''' ''L.size'' = 0 '''return''' null
+ ''largest'' ← ''L''[0]
+ '''for each''' ''item'' '''in''' ''L'', '''do'''
+ '''if''' ''item'' > ''largest'', '''then'''
+ ''largest'' ← ''item''
+ '''return''' ''largest''
+{{algorithm-end}}
+
+===Euclid's algorithm===
+{{further|Euclid's algorithm}}In [[mathematics]], the '''Euclidean algorithm''', or '''Euclid's algorithm''', is an efficient method for computing the [[greatest common divisor]] (GCD) of two integers (numbers), the largest number that divides them both without a [[remainder]]. It is named after the ancient Greek [[mathematician]] [[Euclid]], who first described it in [[Euclid's Elements|his ''Elements'']] ({{circa|300 BC}}).<ref>Heath 1908:300; Hawking's Dover 2005 edition derives from Heath.</ref> It is one of the oldest algorithms in common use. It can be used to reduce [[Fraction (mathematics)|fractions]] to their [[Irreducible fraction|simplest form]], and is a part of many other number-theoretic and cryptographic calculations.
+
+[[File:Euclid's algorithm Book VII Proposition 2 2.png|250px|thumb|left|The example-diagram of Euclid's algorithm from T.L. Heath (1908), with more detail added. Euclid does not go beyond a third measuring and gives no numerical examples. Nicomachus gives the example of 49 and 21: "I subtract the less from the greater; 28 is left; then again I subtract from this the same 21 (for this is possible); 7 is left; I subtract this from 21, 14 is left; from which I again subtract 7 (for this is possible); 7 is left, but 7 cannot be subtracted from 7." Heath comments that "The last phrase is curious, but the meaning of it is obvious enough, as also the meaning of the phrase about ending 'at one and the same number'."(Heath 1908:300).]]
+
+Euclid poses the problem thus: "Given two numbers not prime to one another, to find their greatest common measure". He defines "A number [to be] a multitude composed of units": a counting number, a positive integer not including zero. To "measure" is to place a shorter measuring length ''s'' successively (''q'' times) along longer length ''l'' until the remaining portion ''r'' is less than the shorter length ''s''.<ref>" 'Let CD, measuring BF, leave FA less than itself.' This is a neat abbreviation for saying, measure along BA successive lengths equal to CD until a point F is reached such that the length FA remaining is less than CD; in other words, let BF be the largest exact multiple of CD contained in BA" (Heath 1908:297)</ref> In modern words, remainder ''r'' = ''l'' − ''q''×''s'', ''q'' being the quotient, or remainder ''r'' is the "modulus", the integer-fractional part left over after the division.<ref>For modern treatments using division in the algorithm, see Hardy and Wright 1979:180, Knuth 1973:2 (Volume 1), plus more discussion of Euclid's algorithm in Knuth 1969:293–297 (Volume 2).</ref>
+
+For Euclid's method to succeed, the starting lengths must satisfy two requirements: (i) the lengths must not be zero, AND (ii) the subtraction must be "proper"; i.e., a test must guarantee that the smaller of the two numbers is subtracted from the larger (or the two can be equal so their subtraction yields zero).
+
+Euclid's original proof adds a third requirement: the two lengths must not be prime to one another. Euclid stipulated this so that he could construct a [[reductio ad absurdum]] proof that the two numbers' common measure is in fact the ''greatest''.<ref>Euclid covers this question in his Proposition 1.</ref> While Nicomachus' algorithm is the same as Euclid's, when the numbers are prime to one another, it yields the number "1" for their common measure. So, to be precise, the following is really Nicomachus' algorithm.
+
+[[File:Euclids-algorithm-example-1599-650.gif|350px|thumb|right|A graphical expression of Euclid's algorithm to find the greatest common divisor for 1599 and 650.
+<syntaxhighlight lang="text" highlight="1,5">
+ 1599 = 650×2 + 299
+ 650 = 299×2 + 52
+ 299 = 52×5 + 39
+ 52 = 39×1 + 13
+ 39 = 13×3 + 0</syntaxhighlight>]]
+
+====Computer language for Euclid's algorithm====
+Only a few instruction ''types'' are required to execute Euclid's algorithm—some logical tests (conditional GOTO), unconditional GOTO, assignment (replacement), and subtraction.
+* A ''location'' is symbolized by upper case letter(s), e.g. S, A, etc.
+* The varying quantity (number) in a location is written in lower case letter(s) and (usually) associated with the location's name. For example, location L at the start might contain the number ''l'' = 3009.
+
+====An inelegant program for Euclid's algorithm====
+[[File:Euclid's algorithm Inelegant program 1.png|thumb|163px|right|"Inelegant" is a translation of Knuth's version of the algorithm with a subtraction-based remainder-loop replacing his use of division (or a "modulus" instruction). Derived from Knuth 1973:2–4. Depending on the two numbers "Inelegant" may compute the g.c.d. in fewer steps than "Elegant".]]
+
+The following algorithm is framed as Knuth's four-step version of Euclid's and Nicomachus', but, rather than using division to find the remainder, it uses successive subtractions of the shorter length ''s'' from the remaining length ''r'' until ''r'' is less than ''s''. The high-level description, shown in boldface, is adapted from Knuth 1973:2–4:
+
+'''INPUT''':
+ {{vanchor|1|el1}} [Into two locations L and S put the numbers ''l'' and ''s'' that represent the two lengths]:
+ INPUT L, S
+ {{vanchor|2|el2}} [Initialize R: make the remaining length ''r'' equal to the starting/initial/input length ''l'']:
+ R ← L
+
+'''E0: [Ensure ''r'' ≥ ''s''.]'''
+ {{vanchor|3|el3}} [Ensure the smaller of the two numbers is in S and the larger in R]:
+ IF R > S THEN
+ the contents of L is the larger number so skip over the exchange-steps [[#4|4]], [[#5|5]] and [[#6|6]]:
+ GOTO step [[#7|7]]
+ ELSE
+ swap the contents of R and S.
+ {{vanchor|4|el4}} L ← R (this first step is redundant, but is useful for later discussion).
+ {{vanchor|5|el5}} R ← S
+ {{vanchor|6|el6}} S ← L
+
+'''E1: [Find remainder]''': Until the remaining length ''r'' in R is less than the shorter length ''s'' in S, repeatedly subtract the measuring number ''s'' in S from the remaining length ''r'' in R.
+ {{vanchor|7|el7}} IF S > R THEN
+ done measuring so
+ GOTO [[#10|10]]
+ ELSE
+ measure again,
+ {{vanchor|8|el8}} R ← R − S
+ {{vanchor|9|el9}} [Remainder-loop]:
+ GOTO [[#7|7]].
+
+'''E2: [Is the remainder zero?]''': EITHER (i) the last measure was exact, the remainder in R is zero, and the program can halt, OR (ii) the algorithm must continue: the last measure left a remainder in R less than measuring number in S.
+ {{vanchor|10|el10}} IF R = 0 THEN
+ done so
+ GOTO [[#15|step 15]]
+ ELSE
+ CONTINUE TO [[#11|step 11]],
+
+'''E3: [Interchange ''s'' and ''r'']''': The nut of Euclid's algorithm. Use remainder ''r'' to measure what was previously smaller number ''s''; L serves as a temporary location.
+ {{vanchor|11|el11}} L ← R
+ {{vanchor|12|el12}} R ← S
+ {{vanchor|13|el13}} S ← L
+ {{vanchor|14|el14}} [Repeat the measuring process]:
+ GOTO [[#7|7]]
+
+'''OUTPUT''':
+
+ {{vanchor|15|el15}} [Done. S contains the [[greatest common divisor]]]:
+ PRINT S
+
+'''DONE''':
+ {{vanchor|16|el16}} HALT, END, STOP.
+
+====An elegant program for Euclid's algorithm====
+{{clarify span|The following version of Euclid's algorithm requires only six core instructions to do what thirteen are required to do by "Inelegant"; worse, "Inelegant" requires more ''types'' of instructions.|reason=Contrary to this (unsourced) text, it is general consensus in software engineering that good programming style does not aim at minimizing the number of 'core' (whatever that means) instructions or instruction types. Software engineers during the entire recent 50 years would have ostracized the shown program, if only due to its extensive use of 'goto'. While the program should not be removed here, it could serve as an example of poor programming style, leading to hard-to-understand source code.|date=March 2019}} The flowchart of "Elegant" can be found at the top of this article. In the (unstructured) Basic language, the steps are numbered, and the instruction <syntaxhighlight lang="cbmbas" inline>LET [] = []</syntaxhighlight> is the assignment instruction symbolized by ←.
+<syntaxhighlight lang="cbmbas">
+ 5 REM Euclid's algorithm for greatest common divisor
+ 6 PRINT "Type two integers greater than 0"
+ 10 INPUT A,B
+ 20 IF B=0 THEN GOTO 80
+ 30 IF A > B THEN GOTO 60
+ 40 LET B=B-A
+ 50 GOTO 20
+ 60 LET A=A-B
+ 70 GOTO 20
+ 80 PRINT A
+ 90 END
+</syntaxhighlight>
+''How "Elegant" works'': In place of an outer "Euclid loop", "Elegant" shifts back and forth between two "co-loops", an A > B loop that computes A ← A − B, and a B ≤ A loop that computes B ← B − A. This works because, when at last the minuend M is less than or equal to the subtrahend S (Difference = Minuend − Subtrahend), the minuend can become ''s'' (the new measuring length) and the subtrahend can become the new ''r'' (the length to be measured); in other words the "sense" of the subtraction reverses.
+
+The following version can be used with [[List of C-family programming languages|programming languages from the C-family]]:
+<syntaxhighlight lang="java">
+// Euclid's algorithm for greatest common divisor
+int euclidAlgorithm (int A, int B){
+ A=abs(A);
+ B=abs(B);
+ while (B!=0){
+ while (A>B) A=A-B;
+ B=B-A;
+ }
+ return A;
+}
+</syntaxhighlight>
+
+===Testing the Euclid algorithms===
+Does an algorithm do what its author wants it to do? A few test cases usually give some confidence in the core functionality. But tests are not enough. For test cases, one source<ref>{{cite web |url=http://aleph0.clarku.edu/~djoyce/java/elements/bookVII/propVII2.html |title=Euclid's Elements, Book VII, Proposition 2 |publisher=Aleph0.clarku.edu |access-date=May 20, 2012 |archive-url=https://web.archive.org/web/20120524074919/http://aleph0.clarku.edu/~djoyce/java/elements/bookVII/propVII2.html |archive-date=May 24, 2012 |url-status=live }}</ref> uses 3009 and 884. Knuth suggested 40902, 24140. Another interesting case is the two [[relatively prime]] numbers 14157 and 5950.
+
+But "exceptional cases"<ref>While this notion is in widespread use, it cannot be defined precisely.</ref> must be identified and tested. Will "Inelegant" perform properly when R > S, S > R, R = S? Ditto for "Elegant": B > A, A > B, A = B? (Yes to all). What happens when one number is zero, both numbers are zero? ("Inelegant" computes forever in all cases; "Elegant" computes forever when A = 0.) What happens if ''negative'' numbers are entered? Fractional numbers? If the input numbers, i.e. the [[domain of a function|domain of the function]] computed by the algorithm/program, is to include only positive integers including zero, then the failures at zero indicate that the algorithm (and the program that [[instance (computer science)|instantiates]] it) is a [[partial function]] rather than a [[total function]]. A notable failure due to exceptions is the [[Ariane 5 Flight 501]] rocket failure (June 4, 1996).
+
+''Proof of program correctness by use of mathematical induction'': Knuth demonstrates the application of [[mathematical induction]] to an "extended" version of Euclid's algorithm, and he proposes "a general method applicable to proving the validity of any algorithm".<ref>Knuth 1973:13–18. He credits "the formulation of algorithm-proving in terms of assertions and induction" to R W. Floyd, Peter Naur, C.A.R. Hoare, H.H. Goldstine and J. von Neumann. Tausworth 1977 borrows Knuth's Euclid example and extends Knuth's method in section 9.1 ''Formal Proofs'' (pp. 288–298).</ref> Tausworthe proposes that a measure of the complexity of a program be the length of its correctness proof.<ref>Tausworthe 1997:294</ref>
+
+===Measuring and improving the Euclid algorithms===
+''Elegance (compactness) versus goodness (speed)'': With only six core instructions, "Elegant" is the clear winner, compared to "Inelegant" at thirteen instructions. However, "Inelegant" is ''faster'' (it arrives at HALT in fewer steps). [[Algorithm analysis]]<ref>cf Knuth 1973:7 (Vol. I), and his more-detailed analyses on pp. 1969:294–313 (Vol II).</ref> indicates why this is the case: "Elegant" does ''two'' conditional tests in every subtraction loop, whereas "Inelegant" only does one. As the algorithm (usually) requires many loop-throughs, ''on average'' much time is wasted doing a "B = 0?" test that is needed only after the remainder is computed.
+
+''Can the algorithms be improved?'': Once the programmer judges a program "fit" and "effective"—that is, it computes the function intended by its author—then the question becomes, can it be improved?
+
+The compactness of "Inelegant" can be improved by the elimination of five steps. But Chaitin proved that compacting an algorithm cannot be automated by a generalized algorithm;<ref>Breakdown occurs when an algorithm tries to compact itself. Success would solve the [[Halting problem]].</ref> rather, it can only be done [[heuristic]]ally; i.e., by exhaustive search (examples to be found at [[Busy beaver]]), trial and error, cleverness, insight, application of [[inductive reasoning]], etc. Observe that steps 4, 5 and 6 are repeated in steps 11, 12 and 13. Comparison with "Elegant" provides a hint that these steps, together with steps 2 and 3, can be eliminated. This reduces the number of core instructions from thirteen to eight, which makes it "more elegant" than "Elegant", at nine steps.
+
+The speed of "Elegant" can be improved by moving the "B=0?" test outside of the two subtraction loops. This change calls for the addition of three instructions (B = 0?, A = 0?, GOTO). Now "Elegant" computes the example-numbers faster; whether this is always the case for any given A, B, and R, S would require a detailed analysis.
+
+==Algorithmic analysis==
+{{Main|Analysis of algorithms}}
+It is frequently important to know how much of a particular resource (such as time or storage) is theoretically required for a given algorithm. Methods have been developed for the [[analysis of algorithms]] to obtain such quantitative answers (estimates); for example, an algorithm which adds up the elements of a list of ''n'' numbers would have a time requirement of ''O(n)'', using [[big O notation]]. At all times the algorithm only needs to remember two values: the sum of all the elements so far, and its current position in the input list. Therefore, it is said to have a space requirement of ''O(1)'', if the space required to store the input numbers is not counted, or ''O(n)'' if it is counted.
+
+Different algorithms may complete the same task with a different set of instructions in less or more time, space, or '[[algorithmic efficiency|effort]]' than others. For example, a [[binary search]] algorithm (with cost ''O(log n)'') outperforms a sequential search (cost ''O(n)'' ) when used for [[lookup table|table lookups]] on sorted lists or arrays.
+
+===Formal versus empirical===
+{{Main|Empirical algorithmics|Profiling (computer programming)|Program optimization}}
+The [[analysis of algorithms|analysis, and study of algorithms]] is a discipline of [[computer science]], and is often practiced abstractly without the use of a specific [[programming language]] or implementation. In this sense, algorithm analysis resembles other mathematical disciplines in that it focuses on the underlying properties of the algorithm and not on the specifics of any particular implementation. Usually [[pseudocode]] is used for analysis as it is the simplest and most general representation. However, ultimately, most algorithms are usually implemented on particular hardware/software platforms and their [[algorithmic efficiency]] is eventually put to the test using real code. For the solution of a "one off" problem, the efficiency of a particular algorithm may not have significant consequences (unless n is extremely large) but for algorithms designed for fast interactive, commercial or long life scientific usage it may be critical. Scaling from small n to large n frequently exposes inefficient algorithms that are otherwise benign.
+
+Empirical testing is useful because it may uncover unexpected interactions that affect performance. [[Benchmark (computing)|Benchmarks]] may be used to compare before/after potential improvements to an algorithm after program optimization.
+Empirical tests cannot replace formal analysis, though, and are not trivial to perform in a fair manner.<ref name="KriegelSchubert2016">{{cite journal|last1=Kriegel|first1=Hans-Peter|author-link=Hans-Peter Kriegel|last2=Schubert|first2=Erich|last3=Zimek|first3=Arthur|author-link3=Arthur Zimek|title=The (black) art of run-time evaluation: Are we comparing algorithms or implementations?|journal=Knowledge and Information Systems|volume=52|issue=2|year=2016|pages=341–378|issn=0219-1377|doi=10.1007/s10115-016-1004-2|s2cid=40772241}}</ref>
+
+=== Execution efficiency ===
+{{Main|Algorithmic efficiency}}
+To illustrate the potential improvements possible even in well-established algorithms, a recent significant innovation, relating to [[Fast Fourier transform|FFT]] algorithms (used heavily in the field of image processing), can decrease processing time up to 1,000 times for applications like medical imaging.<ref>{{cite web| title=Better Math Makes Faster Data Networks| author=Gillian Conahan| date=January 2013| url=http://discovermagazine.com/2013/jan-feb/34-better-math-makes-faster-data-networks| publisher=discovermagazine.com| access-date=May 13, 2014| archive-url=https://web.archive.org/web/20140513212427/http://discovermagazine.com/2013/jan-feb/34-better-math-makes-faster-data-networks| archive-date=May 13, 2014| url-status=live}}</ref> In general, speed improvements depend on special properties of the problem, which are very common in practical applications.<ref name="Hassanieh12">Haitham Hassanieh, [[Piotr Indyk]], Dina Katabi, and Eric Price, "[http://siam.omnibooksonline.com/2012SODA/data/papers/500.pdf ACM-SIAM Symposium On Discrete Algorithms (SODA)] {{webarchive|url=https://web.archive.org/web/20130704180806/http://siam.omnibooksonline.com/2012SODA/data/papers/500.pdf |date=July 4, 2013 }}, Kyoto, January 2012. See also the [http://groups.csail.mit.edu/netmit/sFFT/ sFFT Web Page] {{Webarchive|url=https://web.archive.org/web/20120221145740/http://groups.csail.mit.edu/netmit/sFFT/ |date=February 21, 2012 }}.</ref> Speedups of this magnitude enable computing devices that make extensive use of image processing (like digital cameras and medical equipment) to consume less power.
+
+== Classification ==
+There are various ways to classify algorithms, each with its own merits.
+
+=== By implementation ===
+One way to classify algorithms is by implementation means.
+
+{| style="float:right; width:200pt;"
+|-
+|
+<syntaxhighlight lang="C">
+int gcd(int A, int B) {
+ if (B == 0)
+ return A;
+ else if (A > B)
+ return gcd(A-B,B);
+ else
+ return gcd(A,B-A);
+}
+</syntaxhighlight>
+|-
+| Recursive [[C (programming language)|C]] implementation of Euclid's algorithm from the [[#lead|above]] flowchart
+|}
+
+; Recursion
+: A [[recursive algorithm]] is one that invokes (makes reference to) itself repeatedly until a certain condition (also known as termination condition) matches, which is a method common to [[functional programming]]. [[Iteration|Iterative]] algorithms use repetitive constructs like [[Program loops|loops]] and sometimes additional data structures like [[Stack (data structure)|stacks]] to solve the given problems. Some problems are naturally suited for one implementation or the other. For example, [[towers of Hanoi]] is well understood using recursive implementation. Every recursive version has an equivalent (but possibly more or less complex) iterative version, and vice versa.
+; Logical
+: An algorithm may be viewed as controlled [[Deductive reasoning|logical deduction]]. This notion may be expressed as: ''Algorithm = logic + control''.<ref>Kowalski 1979</ref> The logic component expresses the axioms that may be used in the computation and the control component determines the way in which deduction is applied to the axioms. This is the basis for the [[logic programming]] paradigm. In pure logic programming languages, the control component is fixed and algorithms are specified by supplying only the logic component. The appeal of this approach is the elegant [[Formal semantics of programming languages|semantics]]: a change in the axioms produces a well-defined change in the algorithm.
+; Serial, parallel or distributed
+: Algorithms are usually discussed with the assumption that computers execute one instruction of an algorithm at a time. Those computers are sometimes called serial computers. An [[algorithm design]]ed for such an environment is called a serial algorithm, as opposed to [[parallel algorithm]]s or [[distributed algorithms]]. Parallel algorithms take advantage of computer architectures where several processors can work on a problem at the same time, whereas distributed algorithms utilize multiple machines connected with a [[computer network]]. Parallel or distributed algorithms divide the problem into more symmetrical or asymmetrical subproblems and collect the results back together. The resource consumption in such algorithms is not only processor cycles on each processor but also the communication overhead between the processors. Some sorting algorithms can be parallelized efficiently, but their communication overhead is expensive. Iterative algorithms are generally parallelizable. Some problems have no parallel algorithms and are called inherently serial problems.
+; Deterministic or non-deterministic
+: [[Deterministic algorithm]]s solve the problem with exact decision at every step of the algorithm whereas [[non-deterministic algorithm]]s solve problems via guessing although typical guesses are made more accurate through the use of [[heuristics]].
+; Exact or approximate
+: While many algorithms reach an exact solution, [[approximation algorithm]]s seek an approximation that is closer to the true solution. The approximation can be reached by either using a deterministic or a random strategy. Such algorithms have practical value for many hard problems. One of the examples of an approximate algorithm is the [[Knapsack problem]], where there is a set of given items. Its goal is to pack the knapsack to get the maximum total value. Each item has some weight and some value. Total weight that can be carried is no more than some fixed number X. So, the solution must consider weights of items as well as their value.<ref>{{Cite book|url=https://www.springer.com/us/book/9783540402862|title=Knapsack Problems {{!}} Hans Kellerer {{!}} Springer|language=en|isbn=978-3-540-40286-2|publisher=Springer|year=2004|doi=10.1007/978-3-540-24777-7|access-date=September 19, 2017|archive-url=https://web.archive.org/web/20171018181055/https://www.springer.com/us/book/9783540402862|archive-date=October 18, 2017|url-status=live|last1=Kellerer|first1=Hans|last2=Pferschy|first2=Ulrich|last3=Pisinger|first3=David|s2cid=28836720 }}</ref>
+; [[Quantum algorithm]]
+: They run on a realistic model of [[quantum computation]]. The term is usually used for those algorithms which seem inherently quantum, or use some essential feature of [[Quantum computing]] such as [[quantum superposition]] or [[quantum entanglement]].
+
+=== By design paradigm ===
+Another way of classifying algorithms is by their design methodology or [[algorithmic paradigm|paradigm]]. There is a certain number of paradigms, each different from the other. Furthermore, each of these categories includes many different types of algorithms. Some common paradigms are:
+
+; [[Brute-force search|Brute-force]] or exhaustive search
+: This is the [[Naïve algorithm|naive method]] of trying every possible solution to see which is best.<ref>{{cite book| last1 = Carroll| first1 = Sue| last2 = Daughtrey| first2 = Taz| title = Fundamental Concepts for the Software Quality Engineer| url = https://books.google.com/books?id=bz_cl3B05IcC&pg=PA282| date = July 4, 2007| publisher = American Society for Quality| isbn = 978-0-87389-720-4| pages = 282 et seq }}</ref>
+; Divide and conquer
+: A [[divide-and-conquer algorithm]] repeatedly reduces an instance of a problem to one or more smaller instances of the same problem (usually [[recursion|recursively]]) until the instances are small enough to solve easily. One such example of divide and conquer is [[mergesort|merge sorting]]. Sorting can be done on each segment of data after dividing data into segments and sorting of entire data can be obtained in the conquer phase by merging the segments. A simpler variant of divide and conquer is called a ''decrease-and-conquer algorithm'', which solves an identical subproblem and uses the solution of this subproblem to solve the bigger problem. Divide and conquer divides the problem into multiple subproblems and so the conquer stage is more complex than decrease and conquer algorithms. An example of a decrease and conquer algorithm is the [[binary search algorithm]].
+; Search and enumeration
+: Many problems (such as playing [[chess]]) can be modeled as problems on [[graph theory|graphs]]. A [[graph exploration algorithm]] specifies rules for moving around a graph and is useful for such problems. This category also includes [[search algorithm]]s, [[branch and bound]] enumeration and [[backtracking]].
+;[[Randomized algorithm]]
+: Such algorithms make some choices randomly (or pseudo-randomly). They can be very useful in finding approximate solutions for problems where finding exact solutions can be impractical (see heuristic method below). For some of these problems, it is known that the fastest approximations must involve some [[randomness]].<ref>For instance, the [[volume]] of a [[convex polytope]] (described using a membership oracle) can be approximated to high accuracy by a randomized polynomial time algorithm, but not by a deterministic one: see {{citation
+ | last1 = Dyer | first1 = Martin
+ | last2 = Frieze | first2 = Alan
+ | last3 = Kannan | first3 = Ravi
+ | date = January 1991
+ | doi = 10.1145/102782.102783
+ | issue = 1
+ | journal = J. ACM
+ | pages = 1–17
+ | title = A Random Polynomial-time Algorithm for Approximating the Volume of Convex Bodies
+ | volume = 38| citeseerx = 10.1.1.145.4600| s2cid = 13268711
+ }}.</ref> Whether randomized algorithms with [[P (complexity)|polynomial time complexity]] can be the fastest algorithms for some problems is an open question known as the [[P versus NP problem]]. There are two large classes of such algorithms:
+# [[Monte Carlo algorithm]]s return a correct answer with high-probability. E.g. [[RP (complexity)|RP]] is the subclass of these that run in [[polynomial time]].
+# [[Las Vegas algorithm]]s always return the correct answer, but their running time is only probabilistically bound, e.g. [[Zero-error Probabilistic Polynomial time|ZPP]].
+; [[Reduction (complexity)|Reduction of complexity]]
+: This technique involves solving a difficult problem by transforming it into a better-known problem for which we have (hopefully) [[asymptotically optimal]] algorithms. The goal is to find a reducing algorithm whose [[Computational complexity theory|complexity]] is not dominated by the resulting reduced algorithm's. For example, one [[selection algorithm]] for finding the median in an unsorted list involves first sorting the list (the expensive portion) and then pulling out the middle element in the sorted list (the cheap portion). This technique is also known as ''[[Transform and conquer algorithm|transform and conquer]]''.
+; [[Back tracking]]
+: In this approach, multiple solutions are built incrementally and abandoned when it is determined that they cannot lead to a valid full solution.
+
+=== Optimization problems ===
+For [[optimization problem]]s there is a more specific classification of algorithms; an algorithm for such problems may fall into one or more of the general categories described above as well as into one of the following:
+
+; [[Linear programming]]
+: When searching for optimal solutions to a linear function bound to linear equality and inequality constraints, the constraints of the problem can be used directly in producing the optimal solutions. There are algorithms that can solve any problem in this category, such as the popular [[simplex algorithm]].<ref>
+[[George B. Dantzig]] and Mukund N. Thapa. 2003. ''Linear Programming 2: Theory and Extensions''. Springer-Verlag.</ref> Problems that can be solved with linear programming include the [[maximum flow problem]] for directed graphs. If a problem additionally requires that one or more of the unknowns must be an [[integer]] then it is classified in [[integer programming]]. A linear programming algorithm can solve such a problem if it can be proved that all restrictions for integer values are superficial, i.e., the solutions satisfy these restrictions anyway. In the general case, a specialized algorithm or an algorithm that finds approximate solutions is used, depending on the difficulty of the problem.
+; [[Dynamic programming]]
+: When a problem shows [[optimal substructure]]s—meaning the optimal solution to a problem can be constructed from optimal solutions to subproblems—and [[overlapping subproblems]], meaning the same subproblems are used to solve many different problem instances, a quicker approach called ''dynamic programming'' avoids recomputing solutions that have already been computed. For example, [[Floyd–Warshall algorithm]], the shortest path to a goal from a vertex in a weighted [[graph (discrete mathematics)|graph]] can be found by using the shortest path to the goal from all adjacent vertices. Dynamic programming and [[memoization]] go together. The main difference between dynamic programming and divide and conquer is that subproblems are more or less independent in divide and conquer, whereas subproblems overlap in dynamic programming. The difference between dynamic programming and straightforward recursion is in caching or memoization of recursive calls. When subproblems are independent and there is no repetition, memoization does not help; hence dynamic programming is not a solution for all complex problems. By using memoization or maintaining a [[Mathematical table|table]] of subproblems already solved, dynamic programming reduces the exponential nature of many problems to polynomial complexity.
+; The greedy method
+: A [[greedy algorithm]] is similar to a dynamic programming algorithm in that it works by examining substructures, in this case not of the problem but of a given solution. Such algorithms start with some solution, which may be given or have been constructed in some way, and improve it by making small modifications. For some problems they can find the optimal solution while for others they stop at [[local optimum|local optima]], that is, at solutions that cannot be improved by the algorithm but are not optimum. The most popular use of greedy algorithms is for finding the minimal spanning tree where finding the optimal solution is possible with this method. [[Huffman coding|Huffman Tree]], [[kruskal's algorithm|Kruskal]], [[Prim's algorithm|Prim]], [[Sollin's algorithm|Sollin]] are greedy algorithms that can solve this optimization problem.
+;The heuristic method
+:In [[optimization problem]]s, [[heuristic algorithm]]s can be used to find a solution close to the optimal solution in cases where finding the optimal solution is impractical. These algorithms work by getting closer and closer to the optimal solution as they progress. In principle, if run for an infinite amount of time, they will find the optimal solution. Their merit is that they can find a solution very close to the optimal solution in a relatively short time. Such algorithms include [[local search (optimization)|local search]], [[tabu search]], [[simulated annealing]], and [[genetic algorithm]]s. Some of them, like simulated annealing, are non-deterministic algorithms while others, like tabu search, are deterministic. When a bound on the error of the non-optimal solution is known, the algorithm is further categorized as an [[approximation algorithm]].
+
+=== By field of study ===
+{{See also|List of algorithms}}
+Every field of science has its own problems and needs efficient algorithms. Related problems in one field are often studied together. Some example classes are [[search algorithm]]s, [[sorting algorithm]]s, [[merge algorithm]]s, [[numerical analysis|numerical algorithms]], [[graph theory|graph algorithms]], [[string algorithms]], [[computational geometry|computational geometric algorithms]], [[combinatorial|combinatorial algorithms]], [[medical algorithm]]s, [[machine learning]], [[cryptography]], [[data compression]] algorithms and [[parsing|parsing techniques]].
+
+Fields tend to overlap with each other, and algorithm advances in one field may improve those of other, sometimes completely unrelated, fields. For example, dynamic programming was invented for optimization of resource consumption in industry but is now used in solving a broad range of problems in many fields.
+
+=== By complexity ===
+{{See also|Complexity class| Parameterized complexity}}
+Algorithms can be classified by the amount of time they need to complete compared to their input size:
+* Constant time: if the time needed by the algorithm is the same, regardless of the input size. E.g. an access to an [[Array data structure|array]] element.
+* Logarithmic time: if the time is a logarithmic function of the input size. E.g. [[binary search algorithm]].
+* Linear time: if the time is proportional to the input size. E.g. the traverse of a list.
+* Polynomial time: if the time is a power of the input size. E.g. the [[bubble sort]] algorithm has quadratic time complexity.
+* Exponential time: if the time is an exponential function of the input size. E.g. [[Brute-force search]].
+
+Some problems may have multiple algorithms of differing complexity, while other problems might have no algorithms or no known efficient algorithms. There are also mappings from some problems to other problems. Owing to this, it was found to be more suitable to classify the problems themselves instead of the algorithms into equivalence classes based on the complexity of the best possible algorithms for them.
+
+=== Continuous algorithms ===
+The adjective "continuous" when applied to the word "algorithm" can mean:
+* An algorithm operating on data that represents continuous quantities, even though this data is represented by discrete approximations—such algorithms are studied in [[numerical analysis]]; or
+* An algorithm in the form of a [[differential equation]] that operates continuously on the data, running on an [[analog computer]].<ref>{{cite book| author = Tsypkin| title = Adaptation and learning in automatic systems| url = https://books.google.com/books?id=sgDHJlafMskC&pg=PA54| year = 1971| publisher = Academic Press| isbn = 978-0-08-095582-7| page = 54 }}</ref>
+
+== Legal issues ==
+{{see also|Software patent}}
+
+Algorithms, by themselves, are not usually patentable. In the United States, a claim consisting solely of simple manipulations of abstract concepts, numbers, or signals does not constitute "processes" (USPTO 2006), and hence algorithms are not patentable (as in [[Gottschalk v. Benson]]). However practical applications of algorithms are sometimes patentable. For example, in [[Diamond v. Diehr]], the application of a simple [[feedback]] algorithm to aid in the curing of [[synthetic rubber]] was deemed patentable. The [[Software patent debate|patenting of software]] is highly controversial, and there are highly criticized patents involving algorithms, especially [[data compression]] algorithms, such as [[Unisys]]' [[Graphics Interchange Format#Unisys and LZW patent enforcement|LZW patent]].
+
+Additionally, some cryptographic algorithms have export restrictions (see [[export of cryptography]]).
+
+== History: Development of the notion of "algorithm" ==
+=== Ancient Near East ===
+The earliest evidence of algorithms is found in the [[Babylonian mathematics]] of ancient [[Mesopotamia]] (modern Iraq). A [[Sumer]]ian clay tablet found in [[Shuruppak]] near [[Baghdad]] and dated to circa 2500 BC described the earliest [[division algorithm]].<ref name="Springer Science & Business Media">{{cite book |last1=Chabert |first1=Jean-Luc |title=A History of Algorithms: From the Pebble to the Microchip |date=2012 |publisher=Springer Science & Business Media |isbn=9783642181924 |pages=7–8}}</ref> During the [[First Babylonian dynasty|Hammurabi dynasty]] circa 1800-1600 BC, [[Babylonia]]n clay tablets described algorithms for computing [[formulas]].<ref>{{cite journal |last1=Knuth |first1=Donald E. |title=Ancient Babylonian Algorithms |journal=Commun. ACM |date=1972 |volume=15 |issue=7 |pages=671–677 |doi=10.1145/361454.361514 |s2cid=7829945 |url=http://steiner.math.nthu.edu.tw/disk5/js/computer/1.pdf |archive-url=https://web.archive.org/web/20121224100137/http://steiner.math.nthu.edu.tw/disk5/js/computer/1.pdf |url-status=dead |archive-date=2012-12-24 |issn=0001-0782}}</ref> Algorithms were also used in [[Babylonian astronomy]]. Babylonian clay tablets describe and employ algorithmic procedures to compute the time and place of significant astronomical events.<ref>{{Citation | last = Aaboe | first = Asger | author-link = Asger Aaboe | date = 2001 | title = Episodes from the Early History of Astronomy | publisher = Springer | place = New York | pages = 40–62 | isbn = 978-0-387-95136-2 }}</ref>
+
+Algorithms for arithmetic are also found in ancient [[Egyptian mathematics]], dating back to the [[Rhind Mathematical Papyrus]] circa 1550 BC.<ref name="Springer Science & Business Media"/> Algorithms were later used in ancient [[Hellenistic mathematics]]. Two examples are the [[Sieve of Eratosthenes]], which was described in the ''[[Introduction to Arithmetic]]'' by [[Nicomachus]],<ref>{{cite web|url=http://www.math.wichita.edu/history/men/eratosthenes.html|title=Eratosthenes|publisher=Wichita State University: Department of Mathematics and Statistics|first=Courtney|last=Ast|access-date=February 27, 2015|archive-url=https://web.archive.org/web/20150227150653/http://www.math.wichita.edu/history/men/eratosthenes.html|archive-date=February 27, 2015|url-status=live}}</ref><ref name=Cooke2005/>{{rp|Ch 9.2}} and the [[Euclidean algorithm]], which was first described in ''[[Euclid's Elements]]'' ({{circa|300 BC}}).<ref name=Cooke2005/>{{rp|Ch 9.1}}
+
+=== Discrete and distinguishable symbols ===
+Tally-marks: To keep track of their flocks, their sacks of grain and their money the ancients used tallying: accumulating stones or marks scratched on sticks or making discrete symbols in clay. Through the Babylonian and Egyptian use of marks and symbols, eventually [[Roman numerals]] and the [[abacus]] evolved (Dilson, p.&nbsp;16–41). Tally marks appear prominently in [[unary numeral system]] arithmetic used in [[Turing machine]] and [[Post–Turing machine]] computations.
+
+=== Manipulation of symbols as "place holders" for numbers: algebra ===
+[[Muhammad ibn Mūsā al-Khwārizmī]], a [[Mathematics in medieval Islam|Persian mathematician]], wrote the ''[[Al-jabr]]'' in the 9th century. The terms "[[algorism]]" and "algorithm" are derived from the name al-Khwārizmī, while the term "[[algebra]]" is derived from the book ''Al-jabr''. In Europe, the word "algorithm" was originally used to refer to the sets of rules and techniques used by Al-Khwarizmi to solve algebraic equations, before later being generalized to refer to any set of rules or techniques.<ref>{{cite book |last1=Chabert |first1=Jean-Luc |title=A History of Algorithms: From the Pebble to the Microchip |date=2012 |publisher=Springer Science & Business Media |isbn=9783642181924 |page=2}}</ref> This eventually culminated in [[Gottfried Leibniz|Leibniz]]'s notion of the [[calculus ratiocinator]] ({{circa|1680}}):
+
+{{blockquote|A good century and a half ahead of his time, Leibniz proposed an algebra of logic, an algebra that would specify the rules for manipulating logical concepts in the manner that ordinary algebra specifies the rules for manipulating numbers.<ref>Davis 2000:18</ref>}}
+
+=== Cryptographic algorithms ===
+The first [[cryptographic]] algorithm for deciphering encrypted code was developed by [[Al-Kindi]], a 9th-century [[Mathematics in medieval Islam|Arab mathematician]], in ''A Manuscript On Deciphering Cryptographic Messages''. He gave the first description of [[cryptanalysis]] by [[frequency analysis]], the earliest [[codebreaking]] algorithm.<ref name="Dooley">{{cite book |last1=Dooley |first1=John F. |title=A Brief History of Cryptology and Cryptographic Algorithms |date=2013 |publisher=Springer Science & Business Media |isbn=9783319016283 |pages=12–3}}</ref>
+
+=== Mechanical contrivances with discrete states ===
+''The clock'': Bolter credits the invention of the weight-driven [[clock]] as "The key invention [of Europe in the Middle Ages]", in particular, the [[verge escapement]]<ref>Bolter 1984:24</ref> that provides us with the tick and tock of a mechanical clock. "The accurate automatic machine"<ref>Bolter 1984:26</ref> led immediately to "mechanical [[automata theory|automata]]" beginning in the 13th century and finally to "computational machines"—the [[difference engine]] and [[analytical engine]]s of [[Charles Babbage]] and Countess [[Ada Lovelace]], mid-19th century.<ref>Bolter 1984:33–34, 204–206.</ref> Lovelace is credited with the first creation of an algorithm intended for processing on a computer—Babbage's analytical engine, the first device considered a real [[Turing-complete]] computer instead of just a [[calculator]]—and is sometimes called "history's first programmer" as a result, though a full implementation of Babbage's second device would not be realized until decades after her lifetime.
+
+''Logical machines 1870 – [[Stanley Jevons]]' "logical abacus" and "logical machine"'': The technical problem was to reduce [[Boolean equation]]s when presented in a form similar to what is now known as [[Karnaugh map]]s. Jevons (1880) describes first a simple "abacus" of "slips of wood furnished with pins, contrived so that any part or class of the [logical] combinations can be picked out mechanically ... More recently, however, I have reduced the system to a completely mechanical form, and have thus embodied the whole of the indirect process of inference in what may be called a ''Logical Machine''" His machine came equipped with "certain moveable wooden rods" and "at the foot are 21 keys like those of a piano [etc.] ...". With this machine he could analyze a "[[syllogism]] or any other simple logical argument".<ref>All quotes from W. Stanley Jevons 1880 ''Elementary Lessons in Logic: Deductive and Inductive'', Macmillan and Co., London and New York. Republished as a googlebook; cf Jevons 1880:199–201. Louis Couturat 1914 ''the Algebra of Logic'', The Open Court Publishing Company, Chicago and London. Republished as a googlebook; cf Couturat 1914:75–76 gives a few more details; he compares this to a typewriter as well as a piano. Jevons states that the account is to be found at January 20, 1870 ''The Proceedings of the Royal Society''.</ref>
+
+This machine he displayed in 1870 before the Fellows of the Royal Society.<ref>Jevons 1880:199–200</ref> Another logician [[John Venn]], however, in his 1881 ''Symbolic Logic'', turned a jaundiced eye to this effort: "I have no high estimate myself of the interest or importance of what are sometimes called logical machines ... it does not seem to me that any contrivances at present known or likely to be discovered really deserve the name of logical machines"; see more at [[Algorithm characterizations]]. But not to be outdone he too presented "a plan somewhat analogous, I apprehend, to Prof. Jevon's ''abacus'' ... [And] [a]gain, corresponding to Prof. Jevons's logical machine, the following contrivance may be described. I prefer to call it merely a logical-diagram machine ... but I suppose that it could do very completely all that can be rationally expected of any logical machine".<ref>All quotes from John Venn 1881 ''Symbolic Logic'', Macmillan and Co., London. Republished as a googlebook. cf Venn 1881:120–125. The interested reader can find a deeper explanation in those pages.</ref>
+
+''Jacquard loom, Hollerith punch cards, telegraphy and telephony – the electromechanical relay'': Bell and Newell (1971) indicate that the [[Jacquard loom]] (1801), precursor to [[Hollerith cards]] (punch cards, 1887), and "telephone switching technologies" were the roots of a tree leading to the development of the first computers.<ref>Bell and Newell diagram 1971:39, cf. Davis 2000</ref> By the mid-19th century the [[telegraph]], the precursor of the telephone, was in use throughout the world, its discrete and distinguishable encoding of letters as "dots and dashes" a common sound. By the late 19th century the [[ticker tape]] ({{circa|1870s}}) was in use, as was the use of Hollerith cards in the 1890 U.S. census. Then came the [[teleprinter]] ({{circa|1910}}) with its punched-paper use of [[Baudot code]] on tape.
+
+''Telephone-switching networks'' of electromechanical [[relay]]s (invented 1835) was behind the work of [[George Stibitz]] (1937), the inventor of the digital adding device. As he worked in Bell Laboratories, he observed the "burdensome' use of mechanical calculators with gears. "He went home one evening in 1937 intending to test his idea... When the tinkering was over, Stibitz had constructed a binary adding device".<ref>* Melina Hill, Valley News Correspondent, ''A Tinkerer Gets a Place in History'', Valley News West Lebanon NH, Thursday, March 31, 1983, p. 13.</ref>
+
+The mathematician [[Martin Davis (mathematician)|Martin Davis]] observes the particular importance of the electromechanical relay (with its two "binary states" ''open'' and ''closed''):
+: It was only with the development, beginning in the 1930s, of electromechanical calculators using electrical relays, that machines were built having the scope Babbage had envisioned."<ref>Davis 2000:14</ref>
+
+=== Mathematics during the 19th century up to the mid-20th century ===
+''Symbols and rules'': In rapid succession, the mathematics of [[George Boole]] (1847, 1854), [[Gottlob Frege]] (1879), and [[Giuseppe Peano]] (1888–1889) reduced arithmetic to a sequence of symbols manipulated by rules. Peano's ''The principles of arithmetic, presented by a new method'' (1888) was "the first attempt at an axiomatization of mathematics in a [[Symbolic language (programming)|symbolic language]]".<ref>van Heijenoort 1967:81ff</ref>
+
+But Heijenoort gives Frege (1879) this kudos: Frege's is "perhaps the most important single work ever written in logic. ... in which we see a " 'formula language', that is a ''lingua characterica'', a language written with special symbols, "for pure thought", that is, free from rhetorical embellishments ... constructed from specific symbols that are manipulated according to definite rules".<ref>van Heijenoort's commentary on Frege's ''Begriffsschrift, a formula language, modeled upon that of arithmetic, for pure thought'' in van Heijenoort 1967:1</ref> The work of Frege was further simplified and amplified by [[Alfred North Whitehead]] and [[Bertrand Russell]] in their [[Principia Mathematica]] (1910–1913).
+
+''The paradoxes'': At the same time a number of disturbing paradoxes appeared in the literature, in particular, the [[Burali-Forti paradox]] (1897), the [[Russell paradox]] (1902–03), and the [[Richard Paradox]].<ref>Dixon 1906, cf. Kleene 1952:36–40</ref> The resultant considerations led to [[Kurt Gödel]]'s paper (1931)—he specifically cites the paradox of the liar—that completely reduces rules of [[recursion]] to numbers.
+
+''Effective calculability'': In an effort to solve the [[Entscheidungsproblem]] defined precisely by Hilbert in 1928, mathematicians first set about to define what was meant by an "effective method" or "effective calculation" or "effective calculability" (i.e., a calculation that would succeed). In rapid succession the following appeared: [[Alonzo Church]], [[Stephen Kleene]] and [[J.B. Rosser]]'s [[λ-calculus]]<ref>cf. footnote in Alonzo Church 1936a in Davis 1965:90 and 1936b in Davis 1965:110</ref> a finely honed definition of "general recursion" from the work of Gödel acting on suggestions of [[Jacques Herbrand]] (cf. Gödel's Princeton lectures of 1934) and subsequent simplifications by Kleene.<ref>Kleene 1935–6 in Davis 1965:237ff, Kleene 1943 in Davis 1965:255ff</ref> Church's proof<ref>Church 1936 in Davis 1965:88ff</ref> that the Entscheidungsproblem was unsolvable, [[Emil Post]]'s definition of effective calculability as a worker mindlessly following a list of instructions to move left or right through a sequence of rooms and while there either mark or erase a paper or observe the paper and make a yes-no decision about the next instruction.<ref>cf. "Finite Combinatory Processes – formulation 1", Post 1936 in Davis 1965:289–290</ref> Alan Turing's proof of that the Entscheidungsproblem was unsolvable by use of his "a- [automatic-] machine"<ref>Turing 1936–37 in Davis 1965:116ff</ref>—in effect almost identical to Post's "formulation", [[J. Barkley Rosser]]'s definition of "effective method" in terms of "a machine".<ref>Rosser 1939 in Davis 1965:226</ref> Kleene's proposal of a precursor to "[[Church thesis]]" that he called "Thesis I",<ref>Kleene 1943 in Davis 1965:273–274</ref> and a few years later Kleene's renaming his Thesis "Church's Thesis"<ref>Kleene 1952:300, 317</ref> and proposing "Turing's Thesis".<ref>Kleene 1952:376</ref>
+
+=== Emil Post (1936) and Alan Turing (1936–37, 1939) ===
+[[Emil Post]] (1936) described the actions of a "computer" (human being) as follows:
+:"...two concepts are involved: that of a ''symbol space'' in which the work leading from problem to answer is to be carried out, and a fixed unalterable ''set of directions''.
+
+His symbol space would be
+:"a two-way infinite sequence of spaces or boxes... The problem solver or worker is to move and work in this symbol space, being capable of being in, and operating in but one box at a time.... a box is to admit of but two possible conditions, i.e., being empty or unmarked, and having a single mark in it, say a vertical stroke.
+
+:"One box is to be singled out and called the starting point. ...a specific problem is to be given in symbolic form by a finite number of boxes [i.e., INPUT] being marked with a stroke. Likewise, the answer [i.e., OUTPUT] is to be given in symbolic form by such a configuration of marked boxes...
+
+:"A set of directions applicable to a general problem sets up a deterministic process when applied to each specific problem. This process terminates only when it comes to the direction of type (C ) [i.e., STOP]".<ref>Turing 1936–37 in Davis 1965:289–290</ref> See more at [[Post–Turing machine]]
+[[File:Alan Turing.jpg|thumb|200px|Alan Turing's statue at [[Bletchley Park]]]]
+[[Alan Turing]]'s work<ref>Turing 1936 in Davis 1965, Turing 1939 in Davis 1965:160</ref> preceded that of Stibitz (1937); it is unknown whether Stibitz knew of the work of Turing. Turing's biographer believed that Turing's use of a typewriter-like model derived from a youthful interest: "Alan had dreamt of inventing typewriters as a boy; Mrs. Turing had a typewriter, and he could well have begun by asking himself what was meant by calling a typewriter 'mechanical'".<ref>Hodges, p.&nbsp;96</ref> Given the prevalence at the time of Morse code, telegraphy, ticker tape machines, and teletypewriters, it is quite possible that all were influences on Turing during his youth.
+
+Turing—his model of computation is now called a [[Turing machine]]—begins, as did Post, with an analysis of a human computer that he whittles down to a simple set of basic motions and "states of mind". But he continues a step further and creates a machine as a model of computation of numbers.<ref>Turing 1936–37:116</ref>
+
+:"Computing is normally done by writing certain symbols on paper. We may suppose this paper is divided into squares like a child's arithmetic book...I assume then that the computation is carried out on one-dimensional paper, i.e., on a tape divided into squares. I shall also suppose that the number of symbols which may be printed is finite...
+
+:"The behavior of the computer at any moment is determined by the symbols which he is observing, and his "state of mind" at that moment. We may suppose that there is a bound B to the number of symbols or squares that the computer can observe at one moment. If he wishes to observe more, he must use successive observations. We will also suppose that the number of states of mind which need be taken into account is finite...
+
+:"Let us imagine that the operations performed by the computer to be split up into 'simple operations' which are so elementary that it is not easy to imagine them further divided."<ref name="Turing 1936–37 in Davis 1965:136">Turing 1936–37 in Davis 1965:136</ref>
+
+Turing's reduction yields the following:
+:"The simple operations must therefore include:
+::"(a) Changes of the symbol on one of the observed squares
+::"(b) Changes of one of the squares observed to another square within L squares of one of the previously observed squares.
+"It may be that some of these change necessarily invoke a change of state of mind. The most general single operation must, therefore, be taken to be one of the following:
+::"(A) A possible change (a) of symbol together with a possible change of state of mind.
+::"(B) A possible change (b) of observed squares, together with a possible change of state of mind"
+
+:"We may now construct a machine to do the work of this computer."<ref name="Turing 1936–37 in Davis 1965:136"/>
+
+A few years later, Turing expanded his analysis (thesis, definition) with this forceful expression of it:
+:"A function is said to be "effectively calculable" if its values can be found by some purely mechanical process. Though it is fairly easy to get an intuitive grasp of this idea, it is nevertheless desirable to have some more definite, mathematical expressible definition ... [he discusses the history of the definition pretty much as presented above with respect to Gödel, Herbrand, Kleene, Church, Turing, and Post] ... We may take this statement literally, understanding by a purely mechanical process one which could be carried out by a machine. It is possible to give a mathematical description, in a certain normal form, of the structures of these machines. The development of these ideas leads to the author's definition of a computable function, and to an identification of computability † with effective calculability...
+::"† We shall use the expression "computable function" to mean a function calculable by a machine, and we let "effectively calculable" refer to the intuitive idea without particular identification with any one of these definitions".<ref>Turing 1939 in Davis 1965:160</ref>
+
+=== J.B. Rosser (1939) and S.C. Kleene (1943) ===
+[[J. Barkley Rosser]] defined an 'effective [mathematical] method' in the following manner (italicization added):
+:"'Effective method' is used here in the rather special sense of a method each step of which is precisely determined and which is certain to produce the answer in a finite number of steps. With this special meaning, three different precise definitions have been given to date. [his footnote #5; see discussion immediately below]. The simplest of these to state (due to Post and Turing) says essentially that ''an effective method of solving certain sets of problems exists if one can build a machine which will then solve any problem of the set with no human intervention beyond inserting the question and (later) reading the answer''. All three definitions are equivalent, so it doesn't matter which one is used. Moreover, the fact that all three are equivalent is a very strong argument for the correctness of any one." (Rosser 1939:225–226)
+
+Rosser's footnote No. 5 references the work of (1) Church and Kleene and their definition of λ-definability, in particular, Church's use of it in his ''An Unsolvable Problem of Elementary Number Theory'' (1936); (2) Herbrand and Gödel and their use of recursion, in particular, Gödel's use in his famous paper ''On Formally Undecidable Propositions of Principia Mathematica and Related Systems I'' (1931); and (3) Post (1936) and Turing (1936–37) in their mechanism-models of computation.
+
+[[Stephen C. Kleene]] defined as his now-famous "Thesis I" known as the [[Church–Turing thesis]]. But he did this in the following context (boldface in original):
+:"12. ''Algorithmic theories''... In setting up a complete algorithmic theory, what we do is to describe a procedure, performable for each set of values of the independent variables, which procedure necessarily terminates and in such manner that from the outcome we can read a definite answer, "yes" or "no," to the question, "is the predicate value true?"" (Kleene 1943:273)
+
+=== History after 1950 ===
+A number of efforts have been directed toward further refinement of the definition of "algorithm", and activity is on-going because of issues surrounding, in particular, [[foundations of mathematics]] (especially the [[Church–Turing thesis]]) and [[philosophy of mind]] (especially arguments about [[artificial intelligence]]). For more, see [[Algorithm characterizations]].
+
+== See also ==
+{{div col|colwidth=22em}}
+* [[Abstract machine]]
+* [[Algorithm engineering]]
+* [[Algorithm characterizations]]
+* [[Algorithmic bias]]
+* [[Algorithmic composition]]
+* [[Algorithmic entities]]
+* [[Algorithmic synthesis]]
+* [[Algorithmic technique]]
+* [[Algorithmic topology]]
+* [[Garbage in, garbage out]]
+* ''[[Introduction to Algorithms]]'' (textbook)
+* [[Government by algorithm]]
+* [[List of algorithms]]
+* [[List of algorithm general topics]]
+* [[List of important publications in theoretical computer science#Algorithms|List of important publications in theoretical computer science – Algorithms]]
+* [[Regulation of algorithms]]
+* [[Theory of computation]]
+** [[Computability theory]]
+** [[Computational complexity theory]]
+* [[Computational mathematics]]
+{{div col end}}
+
+==Notes==
+{{Reflist}}
+
+==Bibliography==
+{{refbegin|30em}}
+* {{cite journal | last1 = Axt | first1 = P | year = 1959 | title = On a Subrecursive Hierarchy and Primitive Recursive Degrees | journal = Transactions of the American Mathematical Society | volume = 92 | issue = 1| pages = 85–105 | doi=10.2307/1993169| jstor = 1993169 | doi-access = free}}
+* Bell, C. Gordon and Newell, Allen (1971), ''Computer Structures: Readings and Examples'', McGraw–Hill Book Company, New York. {{ISBN|0-07-004357-4}}.
+* {{Cite journal|author1-link=Andreas Blass|first1=Andreas|last1=Blass|author2-link=Yuri Gurevich|first2=Yuri|last2=Gurevich|year=2003|url=http://research.microsoft.com/~gurevich/Opera/164.pdf|title=Algorithms: A Quest for Absolute Definitions|journal= Bulletin of European Association for Theoretical Computer Science|volume= 81}} Includes an excellent bibliography of 56 references.
+* {{cite book| last = Bolter| first = David J.| title = Turing's Man: Western Culture in the Computer Age| edition = 1984| year = 1984| publisher = The University of North Carolina Press|location= Chapel Hill, NC| isbn = 978-0-8078-1564-9 }}, {{ISBN|0-8078-4108-0}}
+* {{cite book| last1 = Boolos| first1 = George| last2 = Jeffrey| first2 = Richard| title = Computability and Logic| url = https://archive.org/details/computabilitylog0000bool_r8y9| url-access = registration| edition = 4th| orig-year = 1974| year = 1999| publisher = Cambridge University Press, London| isbn = 978-0-521-20402-6| author1-link = George Boolos| author2-link = Richard Jeffrey }}: cf. Chapter 3 ''Turing machines'' where they discuss "certain enumerable sets not effectively (mechanically) enumerable".
+* {{cite book| last = Burgin| first = Mark| title = Super-Recursive Algorithms| year = 2004| publisher = Springer| isbn = 978-0-387-95569-8 }}
+* Campagnolo, M.L., [[Cris Moore|Moore, C.]], and Costa, J.F. (2000) An analog characterization of the subrecursive functions. In ''Proc. of the 4th Conference on Real Numbers and Computers'', Odense University, pp.&nbsp;91–109
+* {{Cite journal|last=Church|first=Alonzo|author-link=Alonzo Church|title=An Unsolvable Problem of Elementary Number Theory|journal=The American Journal of Mathematics|volume=58|pages= 345–363|year=1936|doi=10.2307/2371045|issue=2|jstor=2371045}} Reprinted in ''The Undecidable'', p.&nbsp;89ff. The first expression of "Church's Thesis". See in particular page 100 (''The Undecidable'') where he defines the notion of "effective calculability" in terms of "an algorithm", and he uses the word "terminates", etc.
+* {{Cite journal|last=Church|first=Alonzo|author-link=Alonzo Church|title=A Note on the Entscheidungsproblem|journal=The Journal of Symbolic Logic|volume=1|year=1936|pages=40–41|doi=10.2307/2269326|issue=1|jstor=2269326}} {{cite journal|last=Church|first=Alonzo|title=Correction to a Note on the Entscheidungsproblem|journal=The Journal of Symbolic Logic|volume=1|year=1936|pages=101–102|doi=10.2307/2269030|issue=3|jstor=2269030}} Reprinted in ''The Undecidable'', p.&nbsp;110ff. Church shows that the Entscheidungsproblem is unsolvable in about 3 pages of text and 3 pages of footnotes.
+* {{cite book| last = Daffa'| first = Ali Abdullah al-| title = The Muslim contribution to mathematics| year = 1977| publisher = Croom Helm| location = London| isbn = 978-0-85664-464-1 }}
+* {{cite book| last = Davis| first = Martin| author-link = Martin Davis (mathematician)| title = The Undecidable: Basic Papers On Undecidable Propositions, Unsolvable Problems and Computable Functions| url = https://archive.org/details/undecidablebasic0000davi| url-access = registration| year = 1965| publisher = Raven Press| location = New York| isbn = 978-0-486-43228-1 }} Davis gives commentary before each article. Papers of [[Gödel]], [[Alonzo Church]], [[Alan Turing|Turing]], [[J. Barkley Rosser|Rosser]], [[Kleene]], and [[Emil Post]] are included; those cited in the article are listed here by author's name.
+* {{cite book| last = Davis| first = Martin| author-link = Martin Davis (mathematician)| title = Engines of Logic: Mathematicians and the Origin of the Computer| year = 2000| publisher = W.W. Nortion| location = New York| isbn = 978-0-393-32229-3 }} Davis offers concise biographies of [[Gottfried Leibniz|Leibniz]], [[George Boole|Boole]], [[Gottlob Frege|Frege]], [[Georg Cantor|Cantor]], [[David Hilbert|Hilbert]], Gödel and Turing with [[John von Neumann|von Neumann]] as the show-stealing villain. Very brief bios of [[Joseph-Marie Jacquard]], [[Babbage]], [[Ada Lovelace]], [[Claude Shannon]], [[Howard Aiken]], etc.
+* {{DADS|algorithm|algorithm}}
+* {{cite journal|title= Evolution and moral diversity |author=Dean, Tim |journal=Baltic International Yearbook of Cognition, Logic and Communication|year=2012|volume=7|doi=10.4148/biyclc.v7i0.1775 |doi-access=free}}
+* {{cite book| last = Dennett| first = Daniel| author-link = Daniel Dennett| title = Darwin's Dangerous Idea| journal = Complexity| volume = 2| issue = 1| pages = [https://archive.org/details/darwinsdangerous0000denn/page/32 32]–36| year = 1995| publisher = Touchstone/Simon & Schuster| location = New York| isbn = 978-0-684-80290-9| bibcode = 1996Cmplx...2a..32M| doi = 10.1002/(SICI)1099-0526(199609/10)2:1<32::AID-CPLX8>3.0.CO;2-H| url = https://archive.org/details/darwinsdangerous0000denn| url-access = registration}}
+* {{cite book| last = Dilson| first = Jesse| title = The Abacus| edition = (1968, 1994)| year = 2007| publisher = St. Martin's Press, NY| isbn = 978-0-312-10409-2| url = https://archive.org/details/abacusworldsfirs0000dils}}, {{ISBN|0-312-10409-X}}
+* [[Yuri Gurevich]], [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.146.3017&rep=rep1&type=pdf ''Sequential Abstract State Machines Capture Sequential Algorithms''], ACM Transactions on Computational Logic, Vol 1, no 1 (July 2000), pp.&nbsp;77–111. Includes bibliography of 33 sources.
+* {{cite book| last = van Heijenoort| first = Jean| author-link = Jean van Heijenoort| title = From Frege to Gödel, A Source Book in Mathematical Logic, 1879–1931| edition = (1967)| year = 2001| publisher = Harvard University Press, Cambridge| isbn = 978-0-674-32449-7 }}, 3rd edition 1976[?], {{ISBN|0-674-32449-8}} (pbk.)
+* {{cite book| last = Hodges| first = Andrew| author-link = Andrew Hodges| title = Alan Turing: The Enigma| journal = Physics Today| volume = 37| issue = 11| pages = 107–108| year = 1983| publisher = [[Simon and Schuster]]| location = New York| isbn = 978-0-671-49207-6| title-link = Alan Turing: The Enigma| bibcode = 1984PhT....37k.107H| doi = 10.1063/1.2915935}}, {{ISBN|0-671-49207-1}}. Cf. Chapter "The Spirit of Truth" for a history leading to, and a discussion of, his proof.
+* {{Cite journal|last=Kleene|first=Stephen C.|author-link=Stephen Kleene|title=General Recursive Functions of Natural Numbers|journal=Mathematische Annalen|volume=112|pages=727–742|url=http://gdz.sub.uni-goettingen.de/index.php?id=11&PPN=GDZPPN002278499&L=1|year=1936|doi=10.1007/BF01565439|issue=5|s2cid=120517999|access-date=September 30, 2013|archive-url=https://web.archive.org/web/20140903092121/http://gdz.sub.uni-goettingen.de/index.php?id=11&PPN=GDZPPN002278499&L=1|archive-date=September 3, 2014|url-status=dead}} Presented to the American Mathematical Society, September 1935. Reprinted in ''The Undecidable'', p.&nbsp;237ff. Kleene's definition of "general recursion" (known now as mu-recursion) was used by Church in his 1935 paper ''An Unsolvable Problem of Elementary Number Theory'' that proved the "decision problem" to be "undecidable" (i.e., a negative result).
+* {{Cite journal|last=Kleene|first=Stephen C.|author-link=Stephen Kleene |title= Recursive Predicates and Quantifiers|journal= Transactions of the American Mathematical Society|volume=53|pages=41–73|year=1943 |doi= 10.2307/1990131|issue=1|jstor=1990131|doi-access=free}} Reprinted in ''The Undecidable'', p.&nbsp;255ff. Kleene refined his definition of "general recursion" and proceeded in his chapter "12. Algorithmic theories" to posit "Thesis I" (p.&nbsp;274); he would later repeat this thesis (in Kleene 1952:300) and name it "Church's Thesis"(Kleene 1952:317) (i.e., the [[Church thesis]]).
+* {{cite book| last = Kleene| first = Stephen C.| author-link = Kleene| title = Introduction to Metamathematics| edition = Tenth|year= 1991| orig-year = 1952| publisher = North-Holland Publishing Company| isbn = 978-0-7204-2103-3 }}
+* {{cite book| last = Knuth| first = Donald| author-link = Donald Knuth| title = Fundamental Algorithms, Third Edition| year = 1997| publisher = Addison–Wesley| location = Reading, Massachusetts| isbn = 978-0-201-89683-1 }}
+* {{Cite book|last=Knuth|first=Donald|author-link=Donald Knuth|title=Volume 2/Seminumerical Algorithms, The Art of Computer Programming First Edition|publisher=Addison–Wesley|location=Reading, Massachusetts|year=1969}}
+* Kosovsky, N.K. ''Elements of Mathematical Logic and its Application to the theory of Subrecursive Algorithms'', LSU Publ., Leningrad, 1981
+* {{Cite journal|last=Kowalski|first=Robert|author-link=Robert Kowalski|title=Algorithm=Logic+Control|journal=[[Communications of the ACM]]|volume=22|issue=7|pages=424–436|year=1979|doi=10.1145/359131.359136|s2cid=2509896}}
+* [[A.A. Markov]] (1954) ''Theory of algorithms''. [Translated by Jacques J. Schorr-Kon and PST staff] Imprint Moscow, Academy of Sciences of the USSR, 1954 [i.e., Jerusalem, Israel Program for Scientific Translations, 1961; available from the Office of Technical Services, U.S. Dept. of Commerce, Washington] Description 444 p.&nbsp;28&nbsp;cm. Added t.p. in Russian Translation of Works of the Mathematical Institute, Academy of Sciences of the USSR, v.&nbsp;42. Original title: Teoriya algerifmov. [QA248.M2943 Dartmouth College library. U.S. Dept. of Commerce, Office of Technical Services, number OTS {{not a typo|60-51085}}.]
+* {{cite book| last = Minsky| first = Marvin| author-link = Marvin Minsky| title = Computation: Finite and Infinite Machines| url = https://archive.org/details/computationfinit0000mins| url-access = registration| edition = First| year = 1967| publisher = Prentice-Hall, Englewood Cliffs, NJ| isbn = 978-0-13-165449-5 }} Minsky expands his "...idea of an algorithm – an effective procedure..." in chapter 5.1 ''Computability, Effective Procedures and Algorithms. Infinite machines.''
+* {{Cite journal|last=Post|first=Emil|author-link=Emil Post|title=Finite Combinatory Processes, Formulation I |journal=The Journal of Symbolic Logic |volume=1 |year=1936 |pages=103–105 |doi=10.2307/2269031 |issue=3 |jstor=2269031}} Reprinted in ''The Undecidable'', pp.&nbsp;289ff. Post defines a simple algorithmic-like process of a man writing marks or erasing marks and going from box to box and eventually halting, as he follows a list of simple instructions. This is cited by Kleene as one source of his "Thesis I", the so-called [[Church–Turing thesis]].
+* {{Cite book|last=Rogers, Jr|first=Hartley|title=Theory of Recursive Functions and Effective Computability|publisher=The MIT Press|year=1987|isbn=978-0-262-68052-3}}
+* {{Cite journal|last=Rosser|first=J.B.|author-link=J. B. Rosser|title=An Informal Exposition of Proofs of Godel's Theorem and Church's Theorem|journal=Journal of Symbolic Logic|volume= 4 |issue=2|year=1939|doi=10.2307/2269059|pages=53–60|jstor=2269059}} Reprinted in ''The Undecidable'', p.&nbsp;223ff. Herein is Rosser's famous definition of "effective method": "...a method each step of which is precisely predetermined and which is certain to produce the answer in a finite number of steps... a machine which will then solve any problem of the set with no human intervention beyond inserting the question and (later) reading the answer" (p.&nbsp;225–226, ''The Undecidable'')
+* {{cite book |last=Santos-Lang |first=Christopher | year=2014 |editor1-first=Simon |editor1-last=van Rysewyk |editor2-first=Matthijs |editor2-last=Pontier |title=Machine Medical Ethics |volume=74 |publisher=Springer | location=Switzerland | pages=111–127 | chapter=Moral Ecology Approaches to Machine Ethics| chapter-url=http://grinfree.com/MoralEcology.pdf | doi=10.1007/978-3-319-08108-3_8|series=Intelligent Systems, Control and Automation: Science and Engineering |isbn=978-3-319-08107-6 }}
+* {{Cite book|last=Scott|first=Michael L.|title=Programming Language Pragmatics |edition=3rd |publisher=Morgan Kaufmann Publishers/Elsevier|year=2009|isbn=978-0-12-374514-9}}
+* {{cite book| last = Sipser| first = Michael| title = Introduction to the Theory of Computation| year = 2006| publisher = PWS Publishing Company| isbn = 978-0-534-94728-6| url = https://archive.org/details/introductiontoth00sips}}
+* {{cite book |last1=Sober |first1=Elliott |last2=Wilson |first2=David Sloan |year=1998 |title=Unto Others: The Evolution and Psychology of Unselfish Behavior |url=https://archive.org/details/untoothersevolut00sobe |url-access=registration |location=Cambridge |publisher=Harvard University Press|isbn=9780674930469 }}
+* {{Cite book|last=Stone|first=Harold S.|title=Introduction to Computer Organization and Data Structures|edition=1972|publisher=McGraw-Hill, New York|isbn=978-0-07-061726-1|year=1972}} Cf. in particular the first chapter titled: ''Algorithms, Turing Machines, and Programs''. His succinct informal definition: "...any sequence of instructions that can be obeyed by a robot, is called an ''algorithm''" (p.&nbsp;4).
+* {{cite book| last = Tausworthe| first = Robert C| title = Standardized Development of Computer Software Part 1 Methods| year = 1977| publisher = Prentice–Hall, Inc.| location = Englewood Cliffs NJ| isbn = 978-0-13-842195-3 }}
+* {{Cite journal|last=Turing|first=Alan M.|author-link=A. M. Turing|title=On Computable Numbers, With An Application to the Entscheidungsproblem|journal=[[Proceedings of the London Mathematical Society]]|series=Series 2|volume=42|pages= 230–265 |year=1936–37|doi=10.1112/plms/s2-42.1.230 |s2cid=73712 }}. Corrections, ibid, vol. 43(1937) pp.&nbsp;544–546. Reprinted in ''The Undecidable'', p.&nbsp;116ff. Turing's famous paper completed as a Master's dissertation while at King's College Cambridge UK.
+* {{Cite journal|last=Turing|first=Alan M.|author-link=A. M. Turing|title=Systems of Logic Based on Ordinals|journal=Proceedings of the London Mathematical Society|volume=45|pages=161–228|year=1939|doi=10.1112/plms/s2-45.1.161|hdl=21.11116/0000-0001-91CE-3|hdl-access=free}} Reprinted in ''The Undecidable'', pp.&nbsp;155ff. Turing's paper that defined "the oracle" was his PhD thesis while at Princeton.
+* [[United States Patent and Trademark Office]] (2006), [http://www.uspto.gov/web/offices/pac/mpep/documents/2100_2106_02.htm ''2106.02 **>Mathematical Algorithms: 2100 Patentability''], Manual of Patent Examining Procedure (MPEP). Latest revision August 2006
+{{refend|30em}}
+
+==Further reading==
+{{refbegin}}
+* {{cite book |last=Bellah |first=Robert Neelly |year=1985 |author-link=Robert N. Bellah |title=Habits of the Heart: Individualism and Commitment in American Life |location=Berkeley |isbn=978-0-520-25419-0 |publisher=University of California Press |url=https://books.google.com/books?id=XsUojihVZQcC }}
+* {{cite book |last=Berlinski |first=David |title=The Advent of the Algorithm: The 300-Year Journey from an Idea to the Computer |year=2001 |publisher=Harvest Books |isbn=978-0-15-601391-8 |url=https://archive.org/details/adventofalgorith0000berl }}
+* {{cite book |last=Chabert |first=Jean-Luc |title=A History of Algorithms: From the Pebble to the Microchip |year=1999 |publisher=Springer Verlag |isbn=978-3-540-63369-3}}
+* {{cite book |author1=Thomas H. Cormen |author2=Charles E. Leiserson |author3=Ronald L. Rivest |author4=Clifford Stein |title=Introduction To Algorithms |edition=3rd |year=2009 |publisher=MIT Press |isbn=978-0-262-03384-8}}
+* {{cite book |author=Harel, David |author2=Feldman, Yishai |title=Algorithmics: The Spirit of Computing |year=2004 |publisher=Addison-Wesley |isbn=978-0-321-11784-7}}
+* {{cite book |last1=Hertzke |first1=Allen D. |last2=McRorie |first2=Chris |year=1998 |editor1-last=Lawler |editor1-first=Peter Augustine |editor2-last=McConkey |editor2-first=Dale |chapter=The Concept of Moral Ecology |title=Community and Political Thought Today |location=Westport, CT |publisher=[[Praeger Publishers|Praeger]] }}
+* [[Donald Knuth|Knuth, Donald E.]] (2000). ''[http://www-cs-faculty.stanford.edu/~uno/aa.html Selected Papers on Analysis of Algorithms]''. Stanford, California: Center for the Study of Language and Information.
+* Knuth, Donald E. (2010). ''[http://www-cs-faculty.stanford.edu/~uno/da.html Selected Papers on Design of Algorithms]''. Stanford, California: Center for the Study of Language and Information.
+* {{Cite book |first1=Wendell |last1=Wallach |first2=Colin |last2=Allen |date=November 2008 |title=Moral Machines: Teaching Robots Right from Wrong |isbn=978-0-19-537404-9 |publisher=Oxford University Press |location=US }}
+* {{cite book |author=Bleakley, Chris |title=Poems that Solve Puzzles: The History and Science of Algorithms |year=2020 |publisher=Oxford University Press |isbn=978-0-19-885373-2 |url=https://books.google.com/books?id=3pr5DwAAQBAJ}}
+{{refend}}
+
+==External links==
+{{wiktionary}}
+{{wikibooks|Algorithms}}
+{{WVD}}
+{{Commons category|Algorithms}}
+* {{springer|title=Algorithm|id=p/a011780}}
+* {{curlie|Computers/Algorithms/|Algorithms}}
+* {{MathWorld | urlname=Algorithm | title=Algorithm}}
+* [https://www.nist.gov/dads/ Dictionary of Algorithms and Data Structures] – [[National Institute of Standards and Technology]]
+; Algorithm repositories
+* [http://www.cs.sunysb.edu/~algorith/ The Stony Brook Algorithm Repository] – [[State University of New York at Stony Brook]]
+* [http://calgo.acm.org/ Collected Algorithms of the ACM] – [[Association for Computing Machinery]]
+* [http://www-cs-staff.stanford.edu/~knuth/sgb.html The Stanford GraphBase] – [[Stanford University]]
+
+{{Industrial and applied mathematics}}
+{{Authority control}}
+
+[[Category:Algorithms| ]]
+[[Category:Articles with example pseudocode]]
+[[Category:Mathematical logic]]
+[[Category:Theoretical computer science]]
diff --git a/testcases/entity/aristotle.txt b/testcases/entity/aristotle.txt
new file mode 100644
index 00000000..f786a68e
--- /dev/null
+++ b/testcases/entity/aristotle.txt
@@ -0,0 +1,945 @@
+{{Short description|Classical Greek philosopher and polymath (384–322 BC)}}
+{{other uses}}
+{{good article}}
+{{pp-protected|small=yes}}
+{{Use Oxford spelling|date=March 2020}}
+{{Use dmy dates|date=March 2022}}
+{{Infobox philosopher
+ | name=Aristotle
+ | image=Aristotle Altemps Inv8575.jpg
+ | caption=Roman copy in marble of a Greek bronze bust of Aristotle by [[Lysippos]], c. 330 BC, with modern alabaster mantle
+ | birth_date=384 BC{{efn-ua|That these dates (the first half of the Olympiad year 384/383 BC, and in 322 shortly before the death of Demosthenes) are correct was shown by [[August Boeckh]] (''Kleine Schriften'' VI 195); for further discussion, see [[Felix Jacoby]] on ''[[FGrHist]]'' 244 F 38. Ingemar Düring, ''Aristotle in the Ancient Biographical Tradition'', Göteborg, 1957, {{p.|253}}}}
+ | birth_place=[[Stagira (ancient city)|Stagira]], [[Chalcidice]]<ref>{{Cite web|url=https://www.britannica.com/biography/Aristotle|title=Aristotle &#124; Biography, Works, Quotes, Philosophy, Ethics, & Facts|website=[[Britannica]]}}</ref>
+ | death_date={{nowrap|322 BC (aged 61–62)}}
+ | death_place=[[Euboea]], [[Macedonia (ancient kingdom)#Empire|Macedonian Empire]]
+ | education=[[Platonic Academy]]
+ | spouse=[[Pythias]]
+ | era=[[Ancient Greek philosophy]]
+ | region=[[Western philosophy]]
+ | school_tradition={{Flatlist}}
+* [[Peripatetic school]]
+* [[Aristotelianism]]
+* [[Classical republicanism]]
+{{Endflatlist}}
+ | notable_students = [[Alexander the Great]], [[Theophrastus]], [[Aristoxenus]]
+ | main_interests={{Flatlist}}
+* [[Biology]]
+* [[Zoology]]
+* [[Psychology]]{{sfn|Kantor|1963|page=116}}{{sfn|On the Soul}}
+* [[Physics]]
+* [[Metaphysics]]
+* [[Logic]]
+* [[Ethics]]
+* [[Rhetoric]]
+* [[Aesthetics]]
+* [[Music]]
+* [[Poetry]]
+* [[Economics]]
+* [[Politics]]
+* [[Government]]
+* [[Meteorology]]
+* [[Geology]]
+{{Endflatlist}}
+ | notable_ideas=[[Aristotelianism]]
+{{collapsible list
+| title = Speculative philosophy
+| [[Aristotelian logic]], [[syllogism]]
+| [[Aristotelian theology]]
+| [[Four causes]]
+| [[Genus–differentia definition|Genus and differentia]]
+| [[Hylomorphism]], [[substance theory|substance]], [[essence]], [[accident (philosophy)|accident]]
+| [[Hypokeimenon]]
+| [[Potentiality and actuality]]
+| [[Aristotle's theory of universals|Theory of universals]]
+| [[Unmoved mover]]
+}}
+{{collapsible list
+| title = Natural philosophy
+| [[Aristotelian biology]]
+| [[Aristotelian physics]]
+| [[Common sense]]
+| [[Eternity of the world]]
+| [[Five wits]]
+| ''[[Horror vacui (physics)|Horror vacui]]''
+| [[Classical elements#Aristotle|Theory of elements]], [[Aether (classical element)|aether]]
+| [[Rational animal]]
+}}
+{{collapsible list
+| title = Practical philosophy
+| [[Aristotelian ethics]]
+| [[Catharsis]]
+| [[Deliberative rhetoric|Deliberative]], [[epideictic]] and [[forensic rhetoric|forensic]] [[rhetoric]]
+| [[Enthymeme]] and [[Paradeigma]]
+| [[Family as a model for the state]]
+| [[Golden mean (philosophy)|Golden mean]]
+| [[Kyklos#Aristotle|Kyklos]]
+| [[Magnanimity]]
+| [[Mimesis]]
+| [[Natural slavery]]
+| [[Intellectual virtue]]s: [[sophia (wisdom)|sophia]], [[episteme]], [[nous]], [[phronesis]], [[techne]]
+| [[Three appeals]]: [[ethos]], [[logos]], [[pathos]]
+| [[Aristotle's views on women|Views on women]]
+}}
+ | influences={{Flatlist}}
+* [[Plato]]
+* [[Socrates]]
+* [[Heraclitus]]
+* [[Parmenides]]
+* [[Empedocles]]
+* [[Phaleas of Chalcedon|Phaleas]]
+* [[Hippodamus of Miletus|Hippodamus]]
+* [[Hippias]]
+{{Endflatlist}}
+ | influenced={{longitem|
+Virtually all subsequent [[Western philosophy|Western]] and [[Middle Eastern philosophy|Middle Eastern]] philosophy, especially [[Aristotelianism]] including [[Averroism]], [[Avicennism]], [[Neo-Aristotelianism (literature)|Literary Neo-Aristotelianism]], [[Maimonideanism]], [[Objectivism]], [[Peripatetics]], [[Scholasticism]] ([[Llullism]], [[Neo-scholasticism|Neo]], [[Scotism]], [[Second scholasticism|Second]], [[Thomism]], etc), [[School of Brentano]], additionally [[Middle Platonism]] and [[Neoplatonism]] as well as significant amounts of subsequent [[science]] especially [[protoscience]].
+
+See: [[List of writers influenced by Aristotle]], [[Commentaries on Aristotle]], [[Pseudo-Aristotle]]
+}}
+|notable_works=[[Corpus Aristotelicum]]
+}}
+
+'''Aristotle''' ({{IPAc-en|ˈ|ær|ᵻ|s|t|ɒ|t|əl}};{{sfn|Collins English Dictionary}} {{lang-grc-gre|Ἀριστοτέλης}} ''Aristotélēs'', {{IPA-grc|aristotélɛːs|pron}}; 384–322&nbsp;BC) was a Greek [[philosopher]] and [[polymath]] during the [[Classical Greece|Classical period]] in [[Ancient Greece]]. Taught by [[Plato]], he was the founder of the [[Peripatetic school]] of philosophy within the [[Lyceum (Classical)|Lyceum]] and the wider [[Aristotelianism|Aristotelian]] tradition. His writings cover many subjects including [[Physics (Aristotle)|physics]], [[biology]], [[zoology]], [[metaphysics]], [[logic]], [[ethics]], [[aesthetics]], [[Poetics (Aristotle)|poetry]], [[theatre]], [[music]], [[rhetoric]], [[psychology]], [[linguistics]], [[economics]], [[politics]], [[meteorology]], [[History of geology|geology]], and [[government]]. Aristotle provided a complex synthesis of the various philosophies existing prior to him. It was above all from his teachings that [[Western civilization|the West]] inherited its intellectual [[lexicon]], as well as problems and methods of inquiry. As a result, his philosophy has exerted a unique influence on almost every form of knowledge in the West and it continues to be a subject of contemporary philosophical discussion.
+
+Little is known about his life. Aristotle was born in the city of [[Stagira (ancient city)|Stagira]] in [[Northern Greece]]. His father, [[Nicomachus (father of Aristotle)|Nicomachus]], died when Aristotle was a child, and he was brought up by a guardian. At seventeen or eighteen years of age he joined [[Plato's Academy]] in [[Athens]] and remained there until the age of thirty-seven ({{circa|347 BC}}).{{sfn|Humphreys|2009}} Shortly after Plato died, Aristotle left Athens and, at the request of [[Philip II of Macedon]], tutored [[Alexander the Great]] beginning in 343 BC.{{sfn|Russell| 1972}} He established a library in the [[Lyceum (Classical)|Lyceum]] which helped him to produce many of his hundreds of books on [[papyrus]] [[scrolls]]. Though Aristotle wrote many elegant treatises and dialogues for publication, only around [[Corpus Aristotelicum|a third of his original output has survived]], none of it intended for publication.{{sfn|Barnes|1995|p=9}}
+
+Aristotle's views profoundly shaped [[medieval philosophy|medieval scholarship]]. The influence of [[Aristotelian physics|physical science]] extended from [[Late Antiquity]] and the [[Early Middle Ages]] into the [[Renaissance]], and were not replaced systematically until [[Age of Enlightenment|the Enlightenment]] and theories such as [[classical mechanics]] were developed. Some of Aristotle's zoological observations found in [[Aristotle's biology|his biology]], such as on the [[Hectocotylus|hectocotyl (reproductive) arm]] of the [[octopus]], were disbelieved until the 19th century. He also influenced [[Judeo-Islamic philosophies (800–1400)]] during the [[Middle Ages]], as well as [[Christian theology]], especially the [[Neoplatonism]] of the [[Early Church]] and the [[Scholasticism|scholastic]] tradition of the [[Catholic Church]]. Aristotle was revered among medieval Muslim scholars as "The First Teacher", and among medieval Christians like [[Thomas Aquinas]] as simply "The Philosopher", while the poet [[Dante Alighieri|Dante]] called him "the master of those who know". His works contain the earliest known formal study of logic, and were studied by medieval scholars such as [[Peter Abelard]] and [[John Buridan]].
+
+Aristotle's influence on logic continued well into the 19th century. In addition, his [[Aristotelian ethics|ethics]], though always influential, gained renewed interest with the modern advent of [[virtue ethics]]. Aristotle has been called "the father of logic", "the father of biology", "the father of political science", "the father of zoology", "the father of embryology", "the father of natural law", "the father of scientific method", "the father of rhetoric", "the father of psychology", "the father of realism", "the father of criticism", "the father of individualism", "the father of teleology", and "the father of meteorology".{{refn|name=LitList|1=
+* "the father of logic": Wentzel Van Huyssteen, Encyclopedia of Science and Religion: A-I, p. 27
+* "the father of biology": S. C. Datt, S. B. Srivastava, Science and society, p. 93.{{sfn|Leroi|2015|page=352}}
+* "the father of political science": N. Jayapalan, Aristotle, p. 12, Jonathan Wolff, Lectures on the History of Moral and Political Philosophy, p. 48.
+* the "father of zoology": Josef Rudolf Winkler, A Book of Beetles, p. 12
+* "the father of embryology": D.R. Khanna, Text Book Of Embryology, p. 2
+* "the father of natural law": {{cite journal|last=Shellens|first=Max Solomon|title=Aristotle on Natural Law|journal=Natural Law Forum|volume=4|issue=1|year=1959|pages=72–100|doi=10.1093/ajj/4.1.72 |url=https://scholarship.law.nd.edu/cgi/viewcontent.cgi?article=1039&context=nd_naturallaw_forum}}
+* "the father of scientific method": {{cite news |url=https://explorable.com/history-of-the-scientific-method/|title=History of the Scientific Method|newspaper=Explorable|first1=Martyn|last1=Shuttleworth.}}, Riccardo Pozzo (2004) [https://books.google.com/?id=vayp8jxcPr0C&pg=PA41 ''The impact of Aristotelianism on modern philosophy'']. CUA Press. p. 41. {{ISBN|0-8132-1347-9}}
+* "the father of rhetoric": {{cite news |url=https://www.history.com/topics/ancient-history/aristotle|title=Aristotle|work=[[History (American TV network)|History]]}}, Bizzell, P. and Bruce Herzberg. (2000). ''The Rhetorical Tradition: Readings from Classical Times to the Present.'' NY: Bedford/St. Martin's. p. 3.
+* "the father of psychology": Margot Esther Borden, Psychology in the Light of the East, p. 4
+* "the father of realism": Russell L. Hamm, Philosophy and Education: Alternatives in Theory and Practice, p. 58
+* "the father of criticism": Nagendra Prasad, Personal Bias in Literary Criticism: Dr. Johnson, Matthew Arnold, T.S. Eliot, p. 70. [[Henry Home, Lord Kames|Lord Henry Home Kames]], Elements of Criticism, p. 237.
+* "the father of meteorology":{{cite news |url=https://www.metoffice.gov.uk/about-us/what/what-is-meteorology|title=What is meteorology?|newspaper=Meteorological Office}}{{cite web|url=http://yale.edu/ynhti/curriculum/units/1994/5/94.05.01.x.html|title=94.05.01: Meteorology|access-date=16 June 2015|archive-url= https://web.archive.org/web/20160721205842/http://www.yale.edu/ynhti/curriculum/units/1994/5/94.05.01.x.html |archive-date=21 July 2016|url-status=dead}}
+* "the father of individualism":Allan Gotthelf, Gregory Salmieri, A Companion to Ayn Rand, p. 325.
+* "the father of teleology":Malcolm Owen Slavin, Daniel H. Kriegman, The Adaptive Design of the Human Psyche: Psychoanalysis, Evolutionary Biology, and the Therapeutic Process, p. 292.}}
+
+== Life ==
+[[File:20160518 092 mieza nympheum.jpg| thumb | left | School of Aristotle in [[Mieza, Macedonia|Mieza]], [[Macedonia (Greece)|Macedonia, Greece]]]]
+
+In general, the details of Aristotle's life are not well-established. The biographies written in ancient times are often speculative and historians only agree on a few salient points.{{efn-ua | See {{harvnb|Shields|2012|pp=3–16}}; {{harvnb|Düring|1957}} covers ancient biographies of Aristotle.}}
+
+Aristotle was born in 384&nbsp;BC in [[Stagira (ancient city)|Stagira]], [[Chalcidice]], about 55&nbsp;km (34 miles) east of modern-day [[Thessaloniki]].{{sfn|McLeisch|1999|p=5}}{{sfn|Aristoteles-Park in Stagira}} His father, [[Nicomachus (father of Aristotle)|Nicomachus]], was the personal physician to [[Amyntas III of Macedon|King Amyntas of Macedon]]. While he was young, Aristotle learned about biology and medical information, which was taught by his father.<ref>{{Cite book|last1=Borchers|first1=Timothy A. |title=Rhetorical theory : an introduction|date=2018|first2=Heather |last2=Hundley|isbn=978-1-4786-3580-2|edition=Second |location=Long Grove, Illinois|oclc=1031145493}}</ref> Both of Aristotle's parents died when he was about thirteen, and [[Proxenus of Atarneus]] became his guardian.{{sfn|Hall|2018|p=14}} Although little information about Aristotle's childhood has survived, he probably spent some time within the Macedonian palace, making his first connections with the [[Macedonia (ancient kingdom)#Kingship and the royal court|Macedonian monarchy]].{{sfn|Anagnostopoulos|2013|page=4}}
+
+At the age of seventeen or eighteen, Aristotle moved to Athens to continue his education at [[Platonic Academy|Plato's Academy]].{{sfn|Blits|1999|pp=58–63}} He probably experienced the [[Eleusinian Mysteries]] as he wrote when describing the sights one viewed at the Eleusinian Mysteries, "to experience is to learn" [παθείν μαθεĩν].{{sfn|Evans|2006}} Aristotle remained in Athens for nearly twenty years before leaving in 348/47&nbsp;BC. The traditional story about his departure records that he was disappointed with the Academy's direction after control passed to Plato's nephew [[Speusippus]], although it is possible that he feared the anti-Macedonian sentiments in Athens at that time and left before Plato died.{{sfn|Aristotle|1984|pp=Introduction}} Aristotle then accompanied [[Xenocrates]] to the court of his friend [[Hermias of Atarneus]] in [[Asia Minor]]. After the death of Hermias, Aristotle travelled with his pupil [[Theophrastus]] to the island of [[Lesbos]], where together they researched the [[botany]] and zoology of the island and its sheltered lagoon. While in Lesbos, Aristotle married [[Pythias]], either Hermias's adoptive daughter or niece. She bore him a daughter, whom they also named Pythias. In 343 BC, Aristotle was invited by [[Philip II of Macedon]] to become the tutor to his son [[Alexander the Great|Alexander]].{{sfn|Shields|2016}}{{sfn|Russell|1972}}
+
+[[File:Aristoteles Louvre.jpg| thumb | upright | [[Bust (sculpture)|Portrait bust]] of Aristotle; an [[Roman Empire|Imperial Roman]] (1st or 2nd century AD) copy of a lost [[bronze sculpture]] made by [[Lysippos]]]]
+
+Aristotle was appointed as the head of the royal academy of [[Macedon]]. During Aristotle's time in the Macedonian court, he gave lessons not only to Alexander but also to two other future kings: [[Ptolemy I Soter|Ptolemy]] and [[Cassander]].{{sfn|Green|1991|pp=58–59}} Aristotle encouraged Alexander toward eastern conquest, and Aristotle's own attitude towards [[Persia]] was unabashedly [[Ethnocentricism|ethnocentric]]. In one famous example, he counsels Alexander to be "a leader to the Greeks and a despot to the barbarians, to look after the former as after friends and relatives, and to deal with the latter as with beasts or plants".{{sfn|Green|1991|pp=58–59}} By 335&nbsp;BC, Aristotle had returned to Athens, establishing his own school there known as the [[Lyceum (Classical)|Lyceum]]. Aristotle conducted courses at the school for the next twelve years. While in Athens, his wife Pythias died and Aristotle became involved with [[Herpyllis]] of Stagira, who bore him a son whom he named after his father, [[Nicomachus (son of Aristotle)|Nicomachus]]. If the ''[[Suda]]'' {{En dash}} an uncritical compilation from the Middle Ages {{En dash}} is accurate, he may also have had an ''[[eromenos|erômenos]]'', [[Palaephatus|Palaephatus of Abydus]].{{sfn|Smith|2007|p=88}}
+
+This period in Athens, between 335 and 323 BC, is when Aristotle is believed to have composed many of his works.{{sfn|Russell|1972}} He wrote many dialogues, of which only fragments have survived. Those works that have survived are in [[treatise]] form and were not, for the most part, intended for widespread publication; they are generally thought to be lecture aids for his students. His most important treatises include ''[[Physics (Aristotle)|Physics]]'', ''[[Metaphysics (Aristotle)|Metaphysics]]'', ''[[Nicomachean Ethics]]'', ''[[Politics (Aristotle)|Politics]]'', ''[[On the Soul]]'' and ''[[Poetics (Aristotle)|Poetics]]''. Aristotle studied and made significant contributions to "logic, metaphysics, mathematics, physics, biology, botany, ethics, politics, agriculture, medicine, dance, and theatre."{{sfn|Humphreys|2009}}
+
+Near the end of his life, Alexander and Aristotle became estranged over Alexander's relationship with Persia and Persians. A widespread tradition in antiquity suspected Aristotle of playing a role in Alexander's death, but the only evidence of this is an [[Hagnothemis|unlikely claim]] made some six years after the death.{{sfn|Green|1991|p=460}} Following Alexander's death, anti-Macedonian sentiment in Athens was rekindled. In 322&nbsp;BC, Demophilus and [[Eurymedon the Hierophant]] reportedly denounced Aristotle for impiety,{{sfn|Filonik|2013|pp=72–73}} prompting him to flee to his mother's family estate in [[Chalcis|Chalcis, on Euboea]], at which occasion he was said to have stated: "I will not allow the Athenians to sin twice against philosophy"{{sfn|Jones|1980|p=216}}{{sfn|Gigon|2017|p=41}}{{sfn|Düring|1957|p=T44a-e}} – a reference to Athens's [[Trial of Socrates|trial and execution of Socrates]]. He died on Euboea of natural causes later that same year, having named his student [[Antipater]] as his chief [[executor]] and leaving a [[Will (law)|will]] in which he asked to be buried next to his wife.{{sfn|Haase|1992|p=3862}}
+
+== Speculative philosophy ==
+=== Logic ===
+{{Main|Term logic}}
+{{further | Non-Aristotelian logic}}
+
+With the ''[[Prior Analytics]]'', Aristotle is credited with the earliest study of formal logic,{{sfn| Degnan | 1994 | pp=81–89}} and his conception of it was the dominant form of Western logic until 19th-century advances in [[mathematical logic]].{{sfn| Corcoran | 2009 | pp=1–20}} [[Immanuel Kant|Kant]] stated in the ''[[Critique of Pure Reason]]'' that with Aristotle logic reached its completion.{{sfn| Kant | 1787 | pages=Preface}}
+
+==== ''Organon'' ====
+{{Main|Organon}}
+{| class="wikitable floatright"
+|+ One of Aristotle's [[Syllogism#Types|types of syllogism]]{{efn-ua|This [[Syllogism#Types|type of syllogism]], with all three terms in 'a', is known by the traditional (medieval) [[mnemonic]] [[Baralipton|B'''a'''rb'''a'''r'''a''']].{{sfn|Lagerlund|2016}}}}
+! In words !! In<br /> terms{{efn-ua|M is the Middle (here, Men), S is the Subject (Greeks), P is the Predicate (mortal).{{sfn|Lagerlund|2016}}}} !! In equations{{efn-ua|The first equation can be read as 'It is not true that there exists an x such that x is a man and that x is not mortal.'{{sfn|Predicate Logic}}}}
+|-
+|&nbsp;&nbsp;&nbsp;&nbsp;All men are mortal.<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;All Greeks are men.<br /><br />[[Therefore sign|∴]] All Greeks are mortal.||M a P<br /><br />S a M<br /><br />S a P||[[File:Modus Barbara Equations.svg|180px]]
+|}
+
+What is today called ''Aristotelian logic'' with its [[Syllogism#Types|types of syllogism]] (methods of logical argument),{{sfn| Lagerlund | 2016}} Aristotle himself would have labelled "analytics". The term "logic" he reserved to mean ''dialectics''. Most of Aristotle's work is probably not in its original form, because it was most likely edited by students and later lecturers. The logical works of Aristotle were compiled into a set of six books called the ''[[Organon]]'' around 40 BC by [[Andronicus of Rhodes]] or others among his followers.{{sfn| Pickover | 2009 | page=52}} The books are:
+# ''[[Categories (Aristotle)|Categories]]''
+# ''[[On Interpretation]]''
+# ''[[Prior Analytics]]''
+# ''[[Posterior Analytics]]''
+# ''[[Topics (Aristotle)|Topics]]''
+# ''[[On Sophistical Refutations]]''
+
+[[File:Sanzio 01 Plato Aristotle.jpg| thumb | upright | [[Plato]] (left) and Aristotle in [[Raphael]]'s 1509 fresco, ''[[The School of Athens]]''. Aristotle holds his ''[[Nicomachean Ethics]]'' and gestures to the earth, representing his view in immanent realism, whilst Plato gestures to the heavens, indicating his Theory of Forms, and holds his ''[[Timaeus (dialogue)|Timaeus]]''.{{sfn| School of Athens}}{{sfn|Stewart|2019}}]]
+The order of the books (or the teachings from which they are composed) is not certain, but this list was derived from analysis of Aristotle's writings. It goes from the basics, the analysis of simple terms in the ''Categories,'' the analysis of propositions and their elementary relations in ''On Interpretation'', to the study of more complex forms, namely, syllogisms (in the ''Analytics''){{sfn| Prior Analytics | pp= 24b18–20}}{{sfn| Bobzien | 2015}} and dialectics (in the ''Topics'' and ''Sophistical Refutations''). The first three treatises form the core of the logical theory ''stricto sensu'': the grammar of the language of logic and the correct rules of reasoning. The ''Rhetoric'' is not conventionally included, but it states that it relies on the ''Topics''.{{sfn| Smith | 2017}}
+
+=== Metaphysics ===
+{{Main|Metaphysics (Aristotle)}}
+The word "metaphysics" appears to have been coined by the first century AD editor who assembled various small selections of Aristotle's works to the treatise we know by the name ''Metaphysics''.{{sfn| Cohen | 2000}} Aristotle called it "first philosophy", and distinguished it from mathematics and natural science (physics) as the contemplative (''theoretikē'') philosophy which is "theological" and studies the divine. He wrote in his ''Metaphysics'' (1026a16):
+
+{{blockquote | if there were no other independent things besides the composite natural ones, the study of nature would be the primary kind of knowledge; but if there is some motionless independent thing, the knowledge of this precedes it and is first philosophy, and it is universal ''in just this way'', because it is first. And it belongs to this sort of philosophy to study being as being, both what it is and what belongs to it just by virtue of being.{{sfn| Aristotle | 1999 | page=111}}}}
+
+==== Substance ====
+{{see | Hylomorphism }}
+
+Aristotle examines the concepts of [[Substance theory|substance]] (''ousia'') and [[essence]] (''to ti ên einai'', "the what it was to be") in his ''Metaphysics'' (Book VII), and he concludes that a particular substance is a combination of both matter and form, a philosophical theory called [[hylomorphism]]. In Book VIII, he distinguishes the matter of the substance as the [[Material substratum|substratum]], or the stuff of which it is composed. For example, the matter of a house is the bricks, stones, timbers, etc., or whatever constitutes the ''potential'' house, while the form of the substance is the ''actual'' house, namely 'covering for bodies and chattels' or any other [[Genus-differentia definition|differentia]] that let us define something as a house. The formula that gives the components is the account of the matter, and the formula that gives the differentia is the account of the form.{{sfn| Metaphysics | p=VIII 1043a 10–30}}{{sfn| Cohen | 2000}}
+
+===== Immanent realism =====
+{{Main|Aristotle's theory of universals}}
+[[File:Platonic and Aristotelian Forms.svg| thumb | upright=1.5 | [[Plato]]'s [[Theory of forms|forms]] exist as [[universals]], like the ideal form of an apple. For Aristotle, both matter and form belong to the individual thing ([[hylomorphism]]).]]
+Like his teacher Plato, Aristotle's philosophy aims at the [[Problem of universals|universal]]. Aristotle's [[ontology]] places the universal (''katholou'') in [[particular]]s (''kath' hekaston''), things in the world, whereas for Plato the universal is a separately existing form which actual things imitate. For Aristotle, "form" is still what [[phenomena]] are based on, but is "instantiated" in a particular substance.{{sfn| Cohen | 2000}}
+
+Plato argued that all things have a [[Theory of forms|universal form]], which could be either a property or a relation to other things. When one looks at an apple, for example, one sees an apple, and one can also analyse a form of an apple. In this distinction, there is a particular apple and a universal form of an apple. Moreover, one can place an apple next to a book, so that one can speak of both the book and apple as being next to each other. Plato argued that there are some universal forms that are not a part of particular things. For example, it is possible that there is no particular good in existence, but "good" is still a proper universal form. Aristotle disagreed with Plato on this point, arguing that all universals are instantiated at some period of time, and that there are no universals that are unattached to existing things. In addition, Aristotle disagreed with Plato about the location of universals. Where Plato spoke of the forms as existing separately from the things that participate in them, Aristotle maintained that universals exist within each thing on which each universal is predicated. So, according to Aristotle, the form of apple exists within each apple, rather than in the world of the forms.{{sfn| Cohen | 2000}}{{sfn| Lloyd | 1968 | pages=43–47}}
+
+===== Potentiality and actuality =====
+{{see | Potentiality and actuality (Aristotle)}}
+
+With regard to the change (''[[Potentiality and actuality|kinesis]]'') and its causes now, as he defines in his ''[[Physics (Aristotle)|Physics]]'' and ''[[On Generation and Corruption]]'' 319b–320a, he distinguishes the coming to be from:
+
+# growth and diminution, which is change in quantity;
+# locomotion, which is change in space; and
+# alteration, which is change in quality.
+
+[[File:Flute-player dolphin Alcesti Group MAN.jpg| thumb | Aristotle argued that a capability like playing the flute could be acquired – [[Potentiality and actuality (Aristotle)|the potential made actual]] – by learning.]]
+
+The coming to be is a change where nothing persists of which the resultant is a property. In that particular change he introduces the concept of potentiality (''[[Dunamis|dynamis]]'') and actuality (''[[entelecheia]]'') in association with the matter and the form. Referring to potentiality, this is what a thing is capable of doing or being acted upon if the conditions are right and it is not prevented by something else. For example, the seed of a plant in the soil is potentially (''dynamei'') a plant, and if it is not prevented by something, it will become a plant. Potentially beings can either 'act' (''poiein'') or 'be acted upon' (''paschein''), which can be either innate or learned. For example, the eyes possess the potentiality of sight (innate – being acted upon), while the capability of playing the flute can be possessed by learning (exercise – acting). Actuality is the fulfilment of the end of the potentiality. Because the end (''telos'') is the principle of every change, and for the sake of the end exists potentiality, therefore actuality is the end. Referring then to the previous example, it can be said that an actuality is when a plant does one of the activities that plants do.{{sfn| Cohen | 2000}}
+
+{{blockquote | For that for the sake of which (''to hou heneka'') a thing is, is its principle, and the becoming is for the sake of the end; and the actuality is the end, and it is for the sake of this that the potentiality is acquired. For animals do not see in order that they may have sight, but they have sight that they may see.{{sfn| Metaphysics | p=IX 1050a 5–10}}}}
+
+In summary, the matter used to make a house has potentiality to be a house and both the activity of building and the form of the final house are actualities, which is also a [[final cause]] or end. Then Aristotle proceeds and concludes that the actuality is prior to potentiality in formula, in time and in substantiality. With this definition of the particular substance (i.e., matter and form), Aristotle tries to solve the problem of the unity of the beings, for example, "what is it that makes a man one"? Since, according to [[Plato]] there are two Ideas: animal and biped, how then is man a unity? However, according to Aristotle, the potential being (matter) and the actual one (form) are one and the same.{{sfn| Cohen | 2000}}{{sfn| Metaphysics | p=VIII 1045a–b}}
+
+=== Epistemology ===
+Aristotle's immanent realism means his [[epistemology]] is based on the study of things that exist or happen in the world, and rises to knowledge of the universal, whereas for Plato epistemology begins with knowledge of universal [[Theory of Forms|Forms]] (or ideas) and descends to knowledge of particular imitations of these.{{sfn|Smith|2017}} Aristotle uses [[Inductive reasoning|induction]] from examples alongside [[Deductive reasoning|deduction]], whereas Plato relies on deduction from ''[[A priori and a posteriori|a priori]]'' principles.{{sfn|Smith|2017}}
+
+== Natural philosophy ==
+Aristotle's "natural philosophy" spans a wide range of natural phenomena including those now covered by physics, biology and other natural sciences.{{sfn| Wildberg | 2016}} In Aristotle's terminology, "natural philosophy" is a branch of philosophy examining the phenomena of the natural world, and includes fields that would be regarded today as physics, biology and other natural sciences. Aristotle's work encompassed virtually all facets of intellectual inquiry. Aristotle makes philosophy in the broad sense coextensive with reasoning, which he also would describe as "science". However, his use of the term ''science'' carries a different meaning than that covered by the term "scientific method". For Aristotle, "all science (''dianoia'') is either practical, poetical or theoretical" (''Metaphysics'' 1025b25). His practical science includes ethics and politics; his poetical science means the study of fine arts including poetry; his theoretical science covers physics, mathematics and metaphysics.{{sfn|Wildberg|2016}}
+
+=== Physics ===
+[[File:Four Classical Elements in Burning Log.svg| thumb | The four [[classical element]]s (fire, air, water, earth) of [[Empedocles]] and Aristotle illustrated with a burning log. The log releases all four elements as it is destroyed.]]
+{{Main|Aristotelian physics}}
+
+==== Five elements ====
+{{Main|Classical element}}
+
+In his ''[[On Generation and Corruption]]'', Aristotle related each of the four elements proposed earlier by [[Empedocles]], [[Earth (classical element)|Earth]], [[Water (classical element)|Water]], [[Air (classical element)|Air]], and [[Fire (classical element)|Fire]], to two of the four sensible qualities, hot, cold, wet, and dry. In the Empedoclean scheme, all matter was made of the four elements, in differing proportions. Aristotle's scheme added the heavenly [[Aether (classical element)|Aether]], the divine substance of the [[Celestial spheres|heavenly spheres]], stars and planets.{{sfn| Lloyd | 1968 | pages=133–139, 166–169}}
+
+{| class="wikitable"
+|+ [[Classical element|Aristotle's elements]]{{sfn|Lloyd|1968|pages=133–139, 166–169}}
+! Element !!{{font color|red|Hot}}/{{font color|blue|Cold}} !!{{font color|green|Wet}}/{{font color|brown|Dry}} !! Motion !! Modern [[State of matter|state<br />of matter]]
+|-
+|'''[[Earth (classical element)|Earth]]'''||{{font color|blue|Cold}}||{{font color|brown|Dry}}||Down||[[Solid]]
+|-
+|'''[[Water (classical element)|Water]]'''||{{font color|blue|Cold}}||{{font color|green|Wet}}||Down||[[Liquid]]
+|-
+|'''[[Air (classical element)|Air]]'''||{{font color|red|Hot}}||{{font color|green|Wet}}||Up||[[Gas]]
+|-
+|'''[[Fire (classical element)|Fire]]'''||{{font color|red|Hot}}||{{font color|brown|Dry}}||Up||[[Plasma (physics)|Plasma]]
+|-
+|'''[[Aether (classical element)|Aether]]'''||(divine<br />substance)||—||Circular<br />(in heavens)||—
+|}
+
+==== Motion ====
+{{see | History of classical mechanics}}
+
+Aristotle describes two kinds of motion: "violent" or "unnatural motion", such as that of a thrown stone, in the ''Physics'' (254b10), and "natural motion", such as of a falling object, in ''On the Heavens'' (300a20). In violent motion, as soon as the agent stops causing it, the motion stops also: in other words, the natural state of an object is to be at rest,{{sfn| Allain | 2016}}{{efn-ua | Rhett Allain notes that [[Newton's First Law]] is "essentially a direct reply to Aristotle, that the natural state is ''not to change'' motion.{{sfn| Allain | 2016}}}} since Aristotle does not address [[friction]].{{sfn| Drabkin | 1938 | pp=60–84}} With this understanding, it can be observed that, as Aristotle stated, heavy objects (on the ground, say) require more force to make them move; and objects pushed with greater force move faster.{{sfn| Susskind | 2011}}{{efn-ua | Leonard Susskind comments that Aristotle had clearly never gone [[ice skating]] or he would have seen that it takes force to stop an object.{{sfn| Susskind | 2011}}}} This would imply the equation{{sfn| Susskind | 2011}}
+
+:: <math>F=mv</math>,
+
+incorrect in modern physics.{{sfn| Susskind | 2011}}
+
+Natural motion depends on the element concerned: the aether naturally moves in a circle around the heavens,{{efn-ua | For heavenly bodies like the Sun, Moon, and stars, the observed motions are "to a very good approximation" circular around the Earth's centre, (for example, the apparent rotation of the sky because of the rotation of the Earth, and the rotation of the moon around the Earth) as Aristotle stated.{{sfn| Rovelli | 2015 | pp=23–40}}}} while the 4 Empedoclean elements move vertically up (like fire, as is observed) or down (like earth) towards their natural resting places.{{sfn| Rovelli | 2015 | pp=23–40}}{{sfn| Drabkin | 1938 | pp=60–84}}{{efn-ua | Drabkin quotes numerous passages from ''Physics'' and ''On the Heavens'' (''De Caelo'') which state Aristotle's laws of motion.{{sfn| Drabkin | 1938 | pp=60–84}}}}
+
+[[File:Aristotle's laws of motion.svg| thumb | upright=1.5 | Aristotle's laws of motion. In ''[[Physics (Aristotle)|Physics]]'' he states that objects fall at a speed proportional to their weight and inversely proportional to the density of the fluid they are immersed in.{{sfn| Drabkin | 1938 | pp=60–84}} This is a correct approximation for objects in Earth's gravitational field moving in air or water.{{sfn| Rovelli | 2015 | pp=23–40}}]]
+
+In the ''Physics'' (215a25), Aristotle effectively states a quantitative law, that the speed, v, of a falling body is proportional (say, with constant c) to its weight, W, and inversely proportional to the density,{{efn-ua | Drabkin agrees that density is treated quantitatively in this passage, but without a sharp definition of density as weight per unit volume.{{sfn| Drabkin | 1938 | pp=60–84}}}} ρ, of the fluid in which it is falling:;{{sfn| Rovelli | 2015 | pp=23–40}}{{sfn| Drabkin | 1938 | pp=60–84}}
+
+:: <math>v=c\frac{W}{\rho}</math>
+
+Aristotle implies that in a [[vacuum]] the speed of fall would become infinite, and concludes from this apparent absurdity that a vacuum is not possible.{{sfn| Rovelli | 2015 | pp=23–40}}{{sfn| Drabkin | 1938 | pp=60–84}} Opinions have varied on whether Aristotle intended to state quantitative laws. Henri Carteron held the "extreme view"{{sfn| Drabkin | 1938 | pp=60–84}} that Aristotle's concept of force was basically qualitative,{{sfn| Carteron | 1923 | pages=1–32 and passim}} but other authors reject this.{{sfn| Drabkin | 1938 | pp=60–84}}
+
+[[Archimedes]] corrected Aristotle's theory that bodies move towards their natural resting places; metal boats can float if they [[Archimedes' principle|displace enough water]]; floating depends in Archimedes' scheme on the mass and volume of the object, not, as Aristotle thought, its elementary composition.{{sfn| Rovelli | 2015 | pp=23–40}}
+
+Aristotle's writings on motion remained influential until the [[Early Modern]] period. [[John Philoponus]] (in the [[Middle Ages]]) and [[Galileo Galilei|Galileo]] are said to have shown by experiment that Aristotle's claim that a heavier object falls faster than a lighter object is incorrect.{{sfn| Wildberg | 2016}} A contrary opinion is given by [[Carlo Rovelli]], who argues that Aristotle's physics of motion is correct within its domain of validity, that of objects in the [[Earth]]'s gravitational field immersed in a fluid such as air. In this system, heavy bodies in steady fall indeed travel faster than light ones (whether friction is ignored, or not{{sfn| Rovelli | 2015 | pp=23–40}}), and they do fall more slowly in a denser medium.{{sfn| Susskind | 2011}}{{efn-ua | Philoponus and Galileo correctly objected that for the transient phase (still increasing in speed) with heavy objects falling a short distance, the law does not apply: Galileo used balls on a short incline to show this. Rovelli notes that "Two heavy balls with the same shape and different weight do fall at different speeds from an aeroplane, confirming Aristotle's theory, not Galileo's."{{sfn| Rovelli | 2015 | pp=23–40}}}}
+
+Newton's "forced" motion corresponds to Aristotle's "violent" motion with its external agent, but Aristotle's assumption that the agent's effect stops immediately it stops acting (e.g., the ball leaves the thrower's hand) has awkward consequences: he has to suppose that surrounding fluid helps to push the ball along to make it continue to rise even though the hand is no longer acting on it, resulting in the Medieval [[theory of impetus]].{{sfn| Rovelli | 2015 | pp=23–40}}
+
+==== Four causes ====
+{{Main|Four causes}}
+[[File:Aristotle's Four Causes of a Table.svg| thumb | upright=1.5 | Aristotle argued by analogy with woodwork that a thing takes its form from [[four causes]]: in the case of a table, the wood used ([[material cause]]), its design ([[formal cause]]), the tools and techniques used ([[efficient cause]]), and its decorative or practical purpose ([[final cause]]).{{sfn| Leroi | 2015 | pages=88–90}}]]
+
+Aristotle suggested that the reason for anything coming about can be attributed to four different types of simultaneously active factors. His term ''aitia'' is traditionally translated as "cause", but it does not always refer to temporal sequence; it might be better translated as "explanation", but the traditional rendering will be employed here.{{sfn| Lloyd | 1996 | pages=96–100, 106–107}}{{sfn| Hankinson | 1998 | page=159}}
+* [[Material cause]] describes the material out of which something is composed. Thus the material cause of a table is wood. It is not about action. It does not mean that one domino knocks over another domino.{{sfn| Lloyd | 1996 | pages=96–100, 106–107}}
+* The [[formal cause]] is its form, i.e., the arrangement of that matter. It tells one what a thing is, that a thing is determined by the definition, form, pattern, essence, whole, synthesis or archetype. It embraces the account of causes in terms of fundamental principles or general laws, as the whole (i.e., macrostructure) is the cause of its parts, a relationship known as the whole-part causation. Plainly put, the formal cause is the idea in the mind of the sculptor that brings the sculpture into being. A simple example of the formal cause is the mental image or idea that allows an artist, architect, or engineer to create a drawing.{{sfn| Lloyd | 1996 | pages=96–100, 106–107}}
+* The [[efficient cause]] is "the primary source", or that from which the change under consideration proceeds. It identifies 'what makes of what is made and what causes change of what is changed' and so suggests all sorts of agents, non-living or living, acting as the sources of change or movement or rest. Representing the current understanding of causality as the relation of cause and effect, this covers the modern definitions of "cause" as either the agent or agency or particular events or states of affairs. In the case of two dominoes, when the first is knocked over it causes the second also to fall over.{{sfn| Lloyd | 1996 | pages=96–100, 106–107}} In the case of animals, this agency is a combination of [[developmental biology|how it develops from the egg]], and [[physiology|how its body functions]].{{sfn| Leroi | 2015 | pages=91–92, 369–373}}
+* The [[final cause]] (''telos'') is its purpose, the reason why a thing exists or is done, including both purposeful and instrumental actions and activities. The final cause is the purpose or function that something is supposed to serve. This covers modern ideas of motivating causes, such as volition.{{sfn| Lloyd | 1996 | pages=96–100, 106–107}} In the case of living things, it implies [[adaptation]] to a particular way of life.{{sfn| Leroi | 2015 | pages=91–92, 369–373}}
+
+==== Optics ====
+{{further | History of optics}}
+
+Aristotle describes experiments in [[optics]] using a [[camera obscura]] in ''[[Problems (Aristotle)|Problems]]'', book 15. The apparatus consisted of a dark chamber with a small [[aperture]] that let light in. With it, he saw that whatever shape he made the hole, the sun's image always remained circular. He also noted that increasing the distance between the aperture and the image surface magnified the image.{{sfn| Lahanas}}
+
+==== Chance and spontaneity ====
+{{further | Accident (philosophy)}}
+
+According to Aristotle, spontaneity and chance are causes of some things, distinguishable from other types of cause such as simple necessity. Chance as an incidental cause lies in the realm of [[Accident (philosophy)|accidental things]], "from what is spontaneous". There is also more a specific kind of chance, which Aristotle names "luck", that only applies to people's moral choices.{{sfn| Physics | p=2.6}}{{sfn| Miller | 1973 | pp=204–213}}
+
+=== Astronomy ===
+{{further | History of astronomy}}
+
+In [[astronomy]], Aristotle refuted [[Democritus]]'s claim that the [[Milky Way]] was made up of "those stars which are shaded by the earth from the sun's rays," pointing out correctly that if "the size of the sun is greater than that of the earth and the distance of the stars from the earth many times greater than that of the sun, then... the sun shines on all the stars and the earth screens none of them."{{sfn| Meteorology | p=1. 8}}
+
+=== Geology/Natural Sciences ===
+{{further | History of geology}}
+[[File:DenglerSW-Stromboli-20040928-1230x800.jpg| thumb | Aristotle noted that the ground level of the [[Aeolian islands]] changed before a [[volcanic eruption]].]]
+Aristotle was one of the first people to record any [[geology|geological]] observations. He stated that [[Uniformitarianism|geological change]] was too slow to be observed in one person's lifetime.{{sfn| Moore | 1956 | page=13}}{{sfn| Meteorology | p=Book 1, Part 14}}
+The geologist [[Charles Lyell]] noted that Aristotle described such change, including "lakes that had dried up" and "deserts that had become watered by rivers", giving as examples the growth of the [[Nile delta]] since the time of [[Homer]], and "the upheaving of one of the [[Aeolian islands]], previous to a [[volcanic eruption]]."'{{sfn| Lyell | 1832 | page=17}}
+Aristotle also made many observations about the hydrologic cycle and meteorology (including his major writings "Meteorologica"). For example, he made some of the earliest observations about desalination: he observed early – and correctly – that when seawater is heated, freshwater evaporates and that the oceans are then replenished by the cycle of rainfall and river runoff ("I have proved by experiment that salt water evaporated forms fresh and the vapor does not when it condenses condense into sea water again.")<ref>{{cite book |last=Aristotle|translator-last=Lee|translator-first=H.D.P.|title=Meteorologica, Chapter II |year=1952 |publisher=[[Harvard University Press]] |location=Cambridge, MA |page=156 |edition=Loeb Classical Library |url=http://archive.org/details/L397AristotleMeteorologica |access-date=22 January 2021}}</ref>
+
+=== Biology ===
+{{Main|Aristotle's biology}}
+[[File:Tremoctopus violaceus5.jpg| thumb | upright | Among many pioneering zoological observations, Aristotle described the reproductive [[hectocotylus|hectocotyl arm]] of the [[octopus]] (bottom left).]]
+
+==== Empirical research ====
+Aristotle was the first person to study biology systematically,{{sfn| Leroi | 2015 | page=7}} and biology forms a large part of his writings. He spent two years observing and describing the zoology of [[Lesbos]] and the surrounding seas, including in particular the Pyrrha lagoon in the centre of Lesbos.{{sfn| Leroi | 2015 | page=14}}{{sfn| Thompson | 1910 | page=Prefatory Note}} His data in ''[[History of Animals]]'', ''[[Generation of Animals]]'', ''[[Movement of Animals]]'', and ''[[Parts of Animals]]'' are assembled from his own observations,<ref>{{Cite web|url=https://www.independent.co.uk/arts-entertainment/books/reviews/darwins-ghosts-by-rebecca-stott-7808310.html|title=Darwin's Ghosts, By Rebecca Stott
+|website=independent.co.uk|date=2 June 2012
+|access-date=19 June 2012}}</ref> statements given by people with specialized knowledge such as beekeepers and fishermen, and less accurate accounts provided by travellers from overseas.{{sfn| Leroi | 2015 | pages=196, 248}} His apparent emphasis on animals rather than plants is a historical accident: his works on [[botany]] have been lost, but two books on plants by his pupil Theophrastus have survived.{{sfn| Day | 2013 | pp=5805–5816}}
+
+Aristotle reports on the sea-life visible from observation on Lesbos and the catches of fishermen. He describes the [[catfish]], [[electric ray]], and [[frogfish]] in detail, as well as [[cephalopod]]s such as the [[octopus]] and [[paper nautilus]]. His description of the [[hectocotylus|hectocotyl arm]] of cephalopods, used in sexual reproduction, was widely disbelieved until the 19th century.{{sfn| Leroi | 2015 | pages=66–74, 137}} He gives accurate descriptions of the four-chambered fore-stomachs of [[ruminant]]s,{{sfn| Leroi | 2015 | pages=118–119}} and of the [[Ovoviviparity|ovoviviparous]] embryological development of the [[hound shark]].{{sfn| Leroi | 2015 | page=73}}
+
+He notes that an animal's structure is well matched to function, so, among birds, the [[heron]], which lives in marshes with soft mud and lives by catching fish, has a long neck and long legs, and a sharp spear-like beak, whereas [[duck]]s that swim have short legs and webbed feet.{{sfn| Leroi | 2015 | pages=135–136}} [[Charles Darwin|Darwin]], too, noted these sorts of differences between similar kinds of animal, but unlike Aristotle used the data to come to the theory of [[evolution]].{{sfn| Leroi | 2015 | page=206}} Aristotle's writings can seem to modern readers close to implying evolution, but while Aristotle was aware that new mutations or [[Hybridisation (biology)|hybridizations]] could occur, he saw these as rare accidents. For Aristotle, accidents, like heat waves in winter, must be considered distinct from natural causes. He was thus critical of Empedocles's materialist theory of a "survival of the fittest" origin of living things and their organs, and ridiculed the idea that accidents could lead to orderly results.{{sfn| Sedley | 2007 | page=189}} To put his views into modern terms, he nowhere says that different species can have a [[common descent|common ancestor]], or that one kind can [[speciation|change into another]], or that kinds can become [[extinction|extinct]].{{sfn| Leroi | 2015 | page=273}}
+
+==== Scientific style ====
+[[File:Two of Aristotle's Growth Laws.svg| thumb | left | upright=1.4 | Aristotle inferred growth laws from his observations on animals, including that [[brood size]] decreases with body mass, whereas [[gestation]] period increases. He was correct in these predictions, at least for mammals: data are shown for mouse and elephant.]]
+
+Aristotle did not do experiments in the modern sense.{{sfn| Taylor | 1922 | page=42}} He used the ancient Greek term ''pepeiramenoi'' to mean observations, or at most investigative procedures like dissection.{{sfn| Leroi | 2015 | pages=361–365}} In ''Generation of Animals'', he finds a fertilized hen's egg of a suitable stage and opens it to see the embryo's heart beating inside.{{sfn| Leroi | 2011}}{{sfn| Leroi | 2015 | pages=197–200}}
+
+Instead, he practiced a different style of science: systematically gathering data, discovering patterns common to whole groups of animals, and inferring possible causal explanations from these.;{{sfn| Leroi | 2015 | pages=365–368}}{{sfn| Taylor | 1922 | page=49}} This style is common in modern biology when large amounts of data become available in a new field, such as [[genomics]]. It does not result in the same certainty as experimental science, but it sets out testable hypotheses and constructs a narrative explanation of what is observed. In this sense, [[Aristotle's biology]] is scientific.{{sfn| Leroi | 2015 | pages=365–368}}
+
+From the data he collected and documented, Aristotle inferred quite a number of [[biological rules|rules]] relating the life-history features of the live-bearing tetrapods (terrestrial placental mammals) that he studied. Among these correct predictions are the following. Brood size decreases with (adult) body mass, so that an elephant has fewer young (usually just one) per brood than a mouse. [[Life expectancy|Lifespan]] increases with [[gestation period]], and also with body mass, so that elephants live longer than mice, have a longer period of gestation, and are heavier. As a final example, [[fecundity]] decreases with lifespan, so long-lived kinds like elephants have fewer young in total than short-lived kinds like mice.{{sfn| Leroi | 2015 | page=408}}{{-}}
+
+==== Classification of living things ====
+{{further | Scala naturae}}
+[[File:Scyliorhinus retifer embryo.JPG| thumb | Aristotle recorded that the [[embryo]] of [[Mustelus canis|<!--a different species shown-->a dogfish]] was attached by a cord to a kind of placenta (the [[yolk sac]]), like a higher animal; this formed an exception to the linear scale from highest to lowest.{{sfn| Leroi | 2015 | pages=72–74}}]]
+
+Aristotle distinguished about 500 species of [[animal]]s,{{sfn| Bergstrom | Dugatkin | 2012 | page=35}}{{sfn| Rhodes | 1974 | page=7}} arranging these in the ''History of Animals'' in a graded scale of perfection, a nonreligious version of the ''[[scala naturae]]'', with man at the top. His system had eleven grades of animal, from highest potential to lowest, expressed in their form at birth: the highest gave [[viviparity|live birth]] to hot and wet creatures, the lowest laid cold, dry mineral-like eggs. Animals came above [[plant]]s, and these in turn were above minerals.{{sfn| Mayr | 1982 | pages=201–202}} see also:{{sfn| Lovejoy | 1976}} He grouped what the modern zoologist would call [[vertebrate]]s as the hotter "animals with blood", and below them the colder [[invertebrate]]s as "animals without blood". Those with blood were divided into the live-bearing ([[mammal]]s), and the egg-laying ([[bird]]s, [[reptile]]s, [[fish]]). Those without blood were insects, crustacea (non-shelled – cephalopods, and [[crustacea|shelled]]) and the hard-shelled [[mollusc]]s ([[bivalve]]s and [[gastropod]]s). He recognised that animals did not exactly fit into a linear scale, and noted various exceptions, such as that sharks had a [[placenta]] like the tetrapods. To a modern biologist, the explanation, not available to Aristotle,<!--Leroi | p= 113--> is [[convergent evolution]].{{sfn| Leroi | 2015 | pages=111–119}} Philosophers of science have generally concluded that Aristotle was not interested in taxonomy,<ref>{{cite book |last1=Lennox |first1=James G. |title=Aristotle's philosophy of biology : studies in the origins of life science |date=2001 |publisher=Cambridge University Press |location=Cambridge, UK |isbn=0-521-65976-0 |pages=346}}</ref><ref>{{cite journal |last1=Sandford |first1=Stella |title=From Aristotle to Contemporary Biological Classification: What Kind of Category is "Sex"? |journal=Redescriptions: Political Thought, Conceptual History and Feminist Theory |date=3 December 2019 |volume=22 |issue=1 |pages=4–17 |doi=10.33134/rds.314 |s2cid=210140121 |url=https://doi.org/10.33134/rds.314 |language=en |issn=2308-0914}}</ref> but zoologists who studied this question recently think otherwise.<ref>{{cite journal |last1=Voultsiadou |first1=Eleni |last2=Vafidis |first2=Dimitris |title=Marine invertebrate diversity in Aristotle's zoology |journal=Contributions to Zoology |date=1 January 2007 |volume=76 |issue=2 |pages=103–120 |doi=10.1163/18759866-07602004 |url=https://doi.org/10.1163/18759866-07602004 |language=en |issn=1875-9866}}</ref><ref>{{cite journal |last1=von Lieven |first1=Alexander Fürst |last2=Humar |first2=Marcel |title=A Cladistic Analysis of Aristotle's Animal Groups in the "Historia animalium" |journal=History and Philosophy of the Life Sciences |date=2008 |volume=30 |issue=2 |pages=227–262 |jstor=23334371 |pmid=19203017 |url=https://www.jstor.org/stable/23334371 |issn=0391-9714}}</ref><ref>{{cite journal |last1=Laurin |first1=Michel |last2=Humar |first2=Marcel |title=Phylogenetic signal in characters from Aristotle's History of Animals |journal=Comptes Rendus Palevol |date=2022 |volume=21 |issue=1 |pages=1–16 |doi=10.5852/cr-palevol2022v21a1 |s2cid=245863171 |url=https://doi.org/10.5852/cr-palevol2022v21a1 |language=fr}}</ref> He believed that purposive final causes guided all natural processes; this [[teleological]] view justified his observed data as an expression of formal design.{{sfn| Mason | 1979 | pp=43–44}}
+
+{| class="wikitable" style="font-size: 80%;"
+|+ Aristotle's ''[[Scala naturae]]'' (highest to lowest)
+! Group !! Examples<br />(given by Aristotle) !! Blood !! Legs !! Souls<br />(Rational,<br />Sensitive,<br />Vegetative) !! Qualities<br />({{font color|red|Hot}}–{{font color|blue|Cold}},<br />{{font color|green|Wet}}–{{font color|brown|Dry}})
+|-
+|Man||Man||with&nbsp;blood||2 legs||R, S, V||{{font color|red|Hot}}, {{font color|green|Wet}}
+|-
+|[[Mammal|Live-bearing tetrapods]]||Cat, [[hare]]||with&nbsp;blood||4 legs||S, V||{{font color|red|Hot}}, {{font color|green|Wet}}
+|-
+|[[Cetaceans]]||[[Dolphin]], [[whale]]||with&nbsp;blood||none||S, V||{{font color|red|Hot}}, {{font color|green|Wet}}
+|-
+|[[Birds]]||[[Bee-eater]], [[nightjar]]||with&nbsp;blood||2 legs||S, V||{{font color|red|Hot}}, {{font color|green|Wet}}, except {{font color|brown|Dry}} eggs
+|-
+|[[Reptile|Egg-laying tetrapods]]||[[Chameleon]], [[crocodile]]||with&nbsp;blood||4 legs||S, V||{{font color|blue|Cold}}, {{font color|green|Wet}} except scales, eggs
+|-
+|[[Snakes]]||Water snake, [[Ottoman viper]]||with&nbsp;blood||none||S, V||{{font color|blue|Cold}}, {{font color|green|Wet}} except scales, eggs
+|-
+|Egg-laying [[fish]]es||[[Sea bass]], [[Sparisoma cretense|parrotfish]]||with&nbsp;blood||none||S, V||{{font color|blue|Cold}}, {{font color|green|Wet}}, including eggs
+|-
+|(Among the egg-laying fishes):<br />placental [[selachian]]s||[[Shark]], [[Skate (fish)|skate]]||with&nbsp;blood||none||S, V||{{font color|blue|Cold}}, {{font color|green|Wet}}, but [[placenta]] like tetrapods
+|-
+|[[Crustaceans]]||[[Shrimp]], [[crab]]||without||many legs||S, V||{{font color|blue|Cold}}, {{font color|green|Wet}} except shell
+|-
+|[[Cephalopods]]||[[Squid]], [[octopus]]||without||tentacles||S, V||{{font color|blue|Cold}}, {{font color|green|Wet}}
+|-
+|[[Mollusc|Hard-shelled animals]]||[[Cockle (bivalve)|Cockle]], [[Charonia variegata|trumpet snail]]||without||none||S, V||{{font color|blue|Cold}}, {{font color|brown|Dry}} (mineral shell)
+|-
+|Larva-bearing insects||[[Ant]], [[cicada]]||without||6 legs||S, V||{{font color|blue|Cold}}, {{font color|brown|Dry}}
+|-
+|[[Spontaneous generation|Spontaneously generating]]||[[Sponges]], [[worm]]s||without||none||S, V||{{font color|blue|Cold}}, {{font color|green|Wet}} or {{font color|brown|Dry}}, from earth
+|-
+|[[Plants]]||[[Common fig|Fig]]||without||none||V||{{font color|blue|Cold}}, {{font color|brown|Dry}}
+|-
+|[[Mineral]]s||Iron||without||none||none||{{font color|blue|Cold}}, {{font color|brown|Dry}}
+|}
+
+=== Psychology ===
+==== Soul ====
+{{further | On the Soul}}
+[[File:Aristotelian Soul.png| thumb | upright=1.5 | Aristotle proposed a three-part [[Soul#Aristotle|structure for souls]] of plants, animals, and humans, making humans unique in having all three types of soul.]]
+
+Aristotle's [[psychology]], given in his treatise ''[[On the Soul]]'' (''peri psychēs''), posits three kinds of [[soul]] ("psyches"): the vegetative soul, the sensitive soul, and the rational soul. Humans have a rational soul. The human soul incorporates the powers of the other kinds: Like the vegetative soul it can grow and nourish itself; like the sensitive soul it can experience sensations and move locally. The unique part of the human, rational soul is its ability to receive forms of other things and to compare them using the ''[[Nous#Aristotle|nous]]'' (intellect) and ''logos'' (reason).{{sfn| Leroi | 2015 | pages=156–163}}
+
+For Aristotle, the soul is the [[Hylomorphism#Body–soul hylomorphism|form]] of a living being. Because all beings are composites of form and matter, the form of living beings is that which endows them with what is specific to living beings, e.g. the ability to initiate movement (or in the case of plants, growth and chemical transformations, which Aristotle considers types of movement).{{sfn| Shields | 2016}} In contrast to earlier philosophers, but in accordance with the Egyptians, he placed the rational soul in the heart, rather than the brain.{{sfn| Mason | 1979 | p=45}} Notable is Aristotle's division of sensation and thought, which generally differed from the concepts of previous philosophers, with the exception of [[Alcmaeon of Croton|Alcmaeon]].{{sfn| Guthrie | 2010 | p=348}}
+
+==== Memory ====
+According to Aristotle in ''On the Soul'', memory is the ability to hold a perceived experience in the mind and to distinguish between the internal "appearance" and an occurrence in the past.{{sfn| Bloch | 2007 | p=12}} In other words, a memory is a mental picture ([[wikt:phantasm|phantasm]]) that can be recovered. Aristotle believed an impression is left on a semi-fluid bodily organ that undergoes several changes in order to make a memory. A memory occurs when [[stimulus (psychology)|stimuli]] such as sights or sounds are so complex that the nervous system cannot receive all the impressions at once. These changes are the same as those involved in the operations of sensation, Aristotelian {{Avoid wrap|'[[common sense]]'}}, and thinking.{{sfn| Bloch | 2007 | p=61}}{{sfn| Carruthers | 2007 | p=16}}
+
+Aristotle uses the term 'memory' for the actual retaining of an experience in the impression that can develop from sensation, and for the intellectual anxiety that comes with the impression because it is formed at a particular time and processing specific contents. Memory is of the past, prediction is of the future, and sensation is of the present. Retrieval of impressions cannot be performed suddenly. A transitional channel is needed and located in past experiences, both for previous experience and present experience.{{sfn| Bloch | 2007 | p=25}}
+
+Because Aristotle believes people receive all kinds of sense perceptions and perceive them as impressions, people are continually weaving together new impressions of experiences. To search for these impressions, people search the memory itself.{{sfn| Warren | 1921 | p=30}} Within the memory, if one experience is offered instead of a specific memory, that person will reject this experience until they find what they are looking for. Recollection occurs when one retrieved experience naturally follows another. If the chain of "images" is needed, one memory will stimulate the next. When people recall experiences, they stimulate certain previous experiences until they reach the one that is needed.{{sfn| Warren | 1921 | p=25}} Recollection is thus the self-directed activity of retrieving the information stored in a memory impression.{{sfn| Carruthers | 2007 | p=19}} Only humans can remember impressions of intellectual activity, such as numbers and words. Animals that have perception of time can retrieve memories of their past observations. Remembering involves only perception of the things remembered and of the time passed.{{sfn| Warren | 1921 | p=296}}
+
+[[File:Aristotle Senses Perception Memory Dreams Action.svg| thumb | upright=2.25 | Senses, perception, memory, dreams, action in Aristotle's psychology. Impressions are stored in the [[sensorium]] (the heart), linked by his [[laws of association]] (similarity, contrast, and [[Contiguity (psychology)|contiguity]]).]]
+
+Aristotle believed the chain of thought, which ends in recollection of certain impressions, was connected systematically in relationships such as similarity, contrast, and [[Contiguity (psychology)|contiguity]], described in his [[laws of association]]. Aristotle believed that past experiences are hidden within the mind. A force operates to awaken the hidden material to bring up the actual experience. According to Aristotle, association is the power innate in a mental state, which operates upon the unexpressed remains of former experiences, allowing them to rise and be recalled.{{sfn| Warren | 1921 | p=259}}{{sfn | Sorabji | 2006 | p=54}}
+
+==== Dreams ====
+{{see | Dream#Other}}
+
+Aristotle describes sleep in ''On Sleep and Wakefulness''.{{sfn| Holowchak | 1996 | pp=405–423}} Sleep takes place as a result of overuse of the senses{{sfn| Shute | 1941 | pages=115–118}} or of digestion,{{sfn| Holowchak | 1996 | pp=405–23}} so it is vital to the body.{{sfn| Shute | 1941 | pages=115–118}} While a person is asleep, the critical activities, which include thinking, sensing, recalling and remembering, do not function as they do during wakefulness. Since a person cannot sense during sleep they cannot have desire, which is the result of sensation. However, the senses are able to work during sleep,{{sfn| Shute | 1941 | pages=115–18}} albeit differently,{{sfn| Holowchak | 1996 | pp=405–423}} unless they are weary.{{sfn| Shute | 1941 | pages=115–118}}
+
+Dreams do not involve actually sensing a stimulus. In dreams, sensation is still involved, but in an altered manner.{{sfn| Shute | 1941 | pages=115–118}} Aristotle explains that when a person stares at a moving stimulus such as the waves in a body of water, and then looks away, the next thing they look at appears to have a wavelike motion. When a person perceives a stimulus and the stimulus is no longer the focus of their attention, it leaves an impression.{{sfn| Holowchak | 1996 | pp=405–423}} When the body is awake and the senses are functioning properly, a person constantly encounters new stimuli to sense and so the impressions of previously perceived stimuli are ignored.{{sfn| Shute | 1941 | pages=115–118}} However, during sleep the impressions made throughout the day are noticed as there are no new distracting sensory experiences.{{sfn| Holowchak | 1996 | pp=405–423}} So, dreams result from these lasting impressions. Since impressions are all that are left and not the exact stimuli, dreams do not resemble the actual waking experience.{{sfn| Modrak | 2009 | pp=169–181}} During sleep, a person is in an altered state of mind. Aristotle compares a sleeping person to a person who is overtaken by strong feelings toward a stimulus. For example, a person who has a strong infatuation with someone may begin to think they see that person everywhere because they are so overtaken by their feelings. Since a person sleeping is in a suggestible state and unable to make judgements, they become easily deceived by what appears in their dreams, like the infatuated person.{{sfn| Holowchak | 1996 | pp=405–423}} This leads the person to believe the dream is real, even when the dreams are absurd in nature.{{sfn| Holowchak | 1996 | pp=405–423}} In ''De Anima'' iii 3, Aristotle ascribes the ability to create, to store, and to recall images in the absence of perception to the faculty of imagination, ''phantasia''.{{sfn| Shields | 2016}}
+
+One component of Aristotle's theory of dreams disagrees with previously held beliefs. He claimed that dreams are not foretelling and not sent by a divine being. Aristotle reasoned naturalistically that instances in which dreams do resemble future events are simply coincidences.{{sfn| Webb | 1990 | pages=174–184}} Aristotle claimed that a dream is first established by the fact that the person is asleep when they experience it. If a person had an image appear for a moment after waking up or if they see something in the dark it is not considered a dream because they were awake when it occurred. Secondly, any sensory experience that is perceived while a person is asleep does not qualify as part of a dream. For example, if, while a person is sleeping, a door shuts and in their dream they hear a door is shut, this sensory experience is not part of the dream. Lastly, the images of dreams must be a result of lasting impressions of waking sensory experiences.{{sfn| Modrak | 2009 | pp=169–181}}
+
+== Practical philosophy ==
+Aristotle's practical philosophy covers areas such as [[ethics]], [[politics]], [[economics]], and [[rhetoric]].{{sfn| Wildberg | 2016}}
+
+{| class="wikitable floatright" align=right style="font-size: 80%;"
+|+ Virtues and their accompanying vices{{sfn|Humphreys|2009}}
+! Too little !! Virtuous mean !! Too much
+|-
+|Humbleness||High-mindedness||Vainglory
+|-
+|Lack of purpose||Right ambition||Over-ambition
+|-
+|Spiritlessness||Good temper||Irascibility
+|-
+|Rudeness||Civility||Obsequiousness
+|-
+|Cowardice||Courage||Rashness
+|-
+|Insensibility||Self-control||Intemperance
+|-
+|Sarcasm||Sincerity||Boastfulness
+|-
+|Boorishness||Wit||Buffoonery
+|-
+|Shamelessness||Modesty||Shyness
+|-
+|Callousness||Just resentment||Spitefulness
+|-
+|Pettiness||Generosity||Vulgarity
+|-
+|Meanness||Liberality||Wastefulness
+|}
+
+=== Ethics ===
+{{Main|Aristotelian ethics}}
+
+Aristotle considered ethics to be a practical rather than theoretical study, i.e., one aimed at becoming good and doing good rather than knowing for its own sake. He wrote several treatises on ethics, including most notably, the ''[[Nicomachean Ethics]]''.{{sfn| Kraut | 2001}}
+
+Aristotle taught that virtue has to do with the proper function (''ergon'') of a thing. An eye is only a good eye in so much as it can see, because the proper function of an eye is sight. Aristotle reasoned that humans must have a function specific to humans, and that this function must be an activity of the ''[[De Anima|psuchē]]'' (''soul'') in accordance with reason (''[[logos]]''). Aristotle identified such an optimum activity (the virtuous mean, between the accompanying vices of excess or deficiency{{sfn|Humphreys|2009}}) of the soul as the aim of all human deliberate action, ''[[eudaimonia]]'', generally translated as "happiness" or sometimes "well-being". To have the potential of ever being happy in this way necessarily requires a good character (''ēthikē'' ''[[arete (moral virtue)|aretē]]''), often translated as moral or ethical virtue or excellence.{{sfn| Nicomachean Ethics | ps= &nbsp;Book I. See for example chapter 7.}}
+
+Aristotle taught that to achieve a virtuous and potentially happy character requires a first stage of having the fortune to be habituated not deliberately, but by teachers, and experience, leading to a later stage in which one consciously chooses to do the best things. When the best people come to live life this way their practical wisdom (''[[phronesis]]'') and their intellect (''[[nous]]'') can develop with each other towards the highest possible human virtue, the wisdom of an accomplished theoretical or speculative thinker, or in other words, a philosopher.{{sfn| Nicomachean Ethics | p= Book VI}}
+
+=== Politics ===
+{{Main|Politics (Aristotle)}}
+
+In addition to his works on ethics, which address the individual, Aristotle addressed the city in his work titled ''[[Politics (Aristotle)|Politics]]''. Aristotle considered the city to be a natural community. Moreover, he considered the city to be prior in importance to the family which in turn is prior to the individual, "for the whole must of necessity be prior to the part".{{sfn| Politics | pp=1253a19–124}} He famously stated that "man is by nature a political animal" and argued that humanity's defining factor among others in the animal kingdom is its rationality.{{sfn| Aristotle | 2009 | pages=320–321}} Aristotle conceived of politics as being like an organism rather than like a machine, and as a collection of parts none of which can exist without the others. Aristotle's conception of the city is organic, and he is considered one of the first to conceive of the city in this manner.{{sfn| Ebenstein | Ebenstein | 2002 | page=59}}
+
+[[File:Aristotle's constitutions.svg| thumb|upright=1.5 | Aristotle's classifications of political constitutions]]
+
+The common modern understanding of a political community as a modern state is quite different from Aristotle's understanding. Although he was aware of the existence and potential of larger empires, the natural community according to Aristotle was the city (''[[polis]]'') which functions as a political "community" or "partnership" (''koinōnia'')<!-- (1252a1) -->. The aim of the city is not just to avoid injustice or for economic stability<!-- (1280b29–31) -->, but rather to allow at least some citizens the possibility to live a good life, and to perform beautiful acts: "The political partnership must be regarded, therefore, as being for the sake of noble actions, not for the sake of living together<!-- (1281a1–3) -->." This is distinguished from modern approaches, beginning with [[social contract]] theory, according to which individuals leave the [[state of nature]] because of "fear of violent death" or its "inconveniences".{{efn-ua | For a different reading of social and economic processes in the ''Nicomachean Ethics'' and ''Politics'' see Polanyi, Karl (1957) "Aristotle Discovers the Economy" in ''Primitive, Archaic and Modern Economies: Essays of Karl Polanyi'' ed. G. Dalton, Boston 1971, 78–115.}}
+
+In ''[[Protrepticus (Aristotle)|Protrepticus]]'', the character 'Aristotle' states:{{sfn| Hutchinson | Johnson | 2015 | p=22}}
+
+{{blockquote | For we all agree that the most excellent man should rule, i.e., the supreme by nature, and that the law rules and alone is authoritative; but the law is a kind of intelligence, i.e. a discourse based on intelligence. And again, what standard do we have, what criterion of good things, that is more precise than the intelligent man? For all that this man will choose, if the choice is based on his knowledge, are good things and their contraries are bad. And since everybody chooses most of all what conforms to their own proper dispositions (a just man choosing to live justly, a man with bravery to live bravely, likewise a self-controlled man to live with self-control), it is clear that the intelligent man will choose most of all to be intelligent; for this is the function of that capacity. Hence it's evident that, according to the most authoritative judgment, intelligence is supreme among goods.{{sfn| Hutchinson | Johnson | 2015 | p=22}}}}
+
+As Plato's disciple Aristotle was rather critical concerning democracy and, following the outline of certain ideas from Plato's ''[[Statesman (dialogue)|Statesman]]'', he developed a coherent theory of integrating various forms of power into a so-called mixed state:
+{{blockquote| It is … constitutional to take … from oligarchy that offices are to be elected, and from democracy that this is not to be on a property-qualification. This then is the mode of the mixture; and the mark of a good mixture of democracy and oligarchy is when it is possible to speak of the same constitution as a democracy and as an oligarchy. |Aristotle. ''Politics'', Book 4, 1294b.10–18|source=}}
+To illustrate this approach, Aristotle proposed a first-of-its-kind mathematical model of voting, albeit textually described, where the democratic principle of "one voter–one vote" is combined with the oligarchic "merit-weighted voting"; for relevant quotes and their translation into mathematical formulas see.{{sfn| Tangian | 2020 | pages=35-38}}
+
+=== Economics ===
+{{Main|Politics (Aristotle)}}
+
+Aristotle made substantial contributions to [[economics|economic thought]], especially to thought in the Middle Ages.{{sfn| Robbins | 2000 | pages=20–24}} In ''[[Politics (Aristotle)|Politics]]'', Aristotle addresses the city, [[property]], and [[trade]]. His response to criticisms of [[private property]], in [[Lionel Robbins]]'s view, anticipated later proponents of private property among philosophers and economists, as it related to the overall [[utility]] of social arrangements.{{sfn| Robbins | 2000 | pages=20–24}} Aristotle believed that although communal arrangements may seem beneficial to society, and that although private property is often blamed for social strife, such evils in fact come from [[human nature]]. In ''Politics'', Aristotle offers one of the earliest accounts of the origin of [[money]].{{sfn| Robbins | 2000 | pages=20–24}} Money came into use because people became dependent on one another, importing what they needed and exporting the surplus. For the sake of convenience, people then agreed to deal in something that is intrinsically useful and easily applicable, such as iron or [[silver]].{{sfn| Aristotle | 1948 | pages=16–28}}
+
+Aristotle's discussions on [[retail]] and [[interest]] was a major influence on economic thought in the Middle Ages. He had a low opinion of retail, believing that contrary to using money to procure things one needs in managing the household, retail trade seeks to make a [[profit (economics)|profit]]. It thus uses goods as a means to an end, rather than as an end unto itself. He believed that retail trade was in this way unnatural. Similarly, Aristotle considered making a profit through interest unnatural, as it makes a gain out of the money itself, and not from its use.{{sfn| Aristotle | 1948 | pages=16–28}}
+
+Aristotle gave a summary of the function of money that was perhaps remarkably precocious for his time. He wrote that because it is impossible to determine the value of every good through a count of the number of other goods it is worth, the necessity arises of a single universal standard of measurement. Money thus allows for the association of different goods and makes them "commensurable".{{sfn| Aristotle | 1948 | pages=16–28}} He goes on to state that money is also useful for future exchange, making it a sort of security. That is, "if we do not want a thing now, we shall be able to get it when we do want it".{{sfn| Aristotle | 1948 | pages=16–28}}
+
+=== Rhetoric and poetics ===
+{{Main|Rhetoric (Aristotle) | Poetics (Aristotle)}}
+[[File:Bénigne Gagneraux, The Blind Oedipus Commending his Children to the Gods.jpg| thumb | upright=1.35 | ''The Blind Oedipus Commending his Children to the Gods'' (1784) by [[Bénigne Gagneraux]]. In his ''[[Poetics (Aristotle)|Poetics]]'', Aristotle uses the tragedy ''[[Oedipus Rex|Oedipus Tyrannus]]'' by [[Sophocles]] as an example of how the perfect tragedy should be structured, with a generally good protagonist who starts the play prosperous, but loses everything through some ''[[hamartia]]'' (fault).{{sfn| Kaufmann | 1968 | pages=56–60}}]]
+
+Aristotle's ''Rhetoric'' proposes that a speaker can use three basic kinds of appeals to persuade his audience: ''[[ethos]]'' (an appeal to the speaker's character), ''[[pathos]]'' (an appeal to the audience's emotion), and ''[[logos]]'' (an appeal to logical reasoning).{{sfn| Garver | 1994 | pages=109–110}} He also categorizes rhetoric into three genres: [[epideictic]] (ceremonial speeches dealing with praise or blame), [[Forensic rhetoric|forensic]] (judicial speeches over guilt or innocence), and [[Deliberative rhetoric|deliberative]] (speeches calling on an audience to make a decision on an issue).{{sfn| Rorty | 1996 | pages=3–7}} Aristotle also outlines two kinds of rhetorical [[Proof (truth)|proofs]]: ''[[enthymeme]]'' (proof by [[syllogism]]) and ''[[paradeigma]]'' (proof by example).{{sfn| Grimaldi | 1998 | p=71}}
+
+Aristotle writes in his ''Poetics'' that [[epic poetry]], tragedy, comedy, [[Dithyramb|dithyrambic poetry]], painting, sculpture, music, and dance are all fundamentally acts of ''[[mimesis]]'' ("imitation"), each varying in imitation by medium, object, and manner.{{sfn| Halliwell | 2002 | pp=152–159}}{{sfn| Poetics | p= I 1447a}} He applies the term ''mimesis'' both as a property of a work of art and also as the product of the artist's intention{{sfn| Halliwell | 2002 | pp=152–159}} and contends that the audience's realisation of the ''mimesis'' is vital to understanding the work itself.{{sfn| Halliwell | 2002 | pp=152–159}} Aristotle states that ''mimesis'' is a natural instinct of humanity that separates humans from animals{{sfn| Halliwell | 2002 | pp=152–159}}{{sfn| Poetics | p= IV}} and that all human artistry "follows the pattern of nature".{{sfn| Halliwell | 2002 | pp=152–159}} Because of this, Aristotle believed that each of the mimetic arts possesses what [[Stephen Halliwell (academic)|Stephen Halliwell]] calls "highly structured procedures for the achievement of their purposes."{{sfn| Halliwell | 2002 | pp=152–59}} For example, music imitates with the media of rhythm and harmony, whereas dance imitates with rhythm alone, and poetry with language. The forms also differ in their object of imitation. Comedy, for instance, is a dramatic imitation of men worse than average; whereas tragedy imitates men slightly better than average. Lastly, the forms differ in their manner of imitation – through narrative or character, through change or no change, and through drama or no drama.{{sfn| Poetics | p=III}}
+
+While it is believed that Aristotle's ''Poetics'' originally comprised two books – one on comedy and one on tragedy – only the portion that focuses on tragedy has survived. Aristotle taught that tragedy is composed of six elements: plot-structure, character, style, thought, spectacle, and lyric poetry.{{sfn| Poetics | p=VI}} The characters in a tragedy are merely a means of driving the story; and the plot, not the characters, is the chief focus of tragedy. Tragedy is the imitation of action arousing pity and fear, and is meant to effect the [[catharsis]] of those same emotions. Aristotle concludes ''Poetics'' with a discussion on which, if either, is superior: epic or tragic mimesis. He suggests that because tragedy possesses all the attributes of an epic, possibly possesses additional attributes such as spectacle and music, is more unified, and achieves the aim of its mimesis in shorter scope, it can be considered superior to epic.{{sfn| Poetics | p=XXVI}} Aristotle was a keen systematic collector of riddles, folklore, and proverbs; he and his school had a special interest in the riddles of the [[Pythia|Delphic Oracle]] and studied the fables of [[Aesop]].{{sfn| Aesop | 1998 | pages=Introduction, xi–xii}}
+
+=== Views on women ===
+{{Main|Aristotle's views on women}}
+{{further | Aristotle's biology#Inheritance}}
+
+Aristotle's analysis of procreation describes an active, ensouling masculine element bringing life to an inert, passive female element. The biological differences are a result of the fact that the female body is well-suited for reproduction, which changes her body temperature, which in turn makes her, in Aristotle's view, incapable of participating in political life.<ref>See Marguerite Deslauriers, "Sexual Difference in Aristotle's Politics and His Biology," ''Classical World'' 102 3 (2009): 215-231.</ref> On this ground, proponents of [[feminist metaphysics]] have accused Aristotle of [[misogyny]]{{sfn| Freeland | 1998}} and [[sexism]].{{sfn| Morsink | 1979 | pp=83–112}} However, Aristotle gave equal weight to women's happiness as he did to men's, and commented in his ''Rhetoric'' that the things that lead to happiness need to be in women as well as men.{{efn-ua | "Where, as among the Lacedaemonians, the state of women is bad, almost half of human life is spoilt."{{sfn| Rhetoric | p=Book I, Chapter 5}}}}
+
+== Influence ==
+{{see | List of writers influenced by Aristotle}}
+
+More than 2300 years after his death, Aristotle remains one of the most influential people who ever lived.{{sfn| Leroi | 2015 | p=8}}{{sfn| Aristotle's Influence | 2018}}<ref>{{cite news |url=https://www.nytimes.com/2014/03/16/magazine/whos-more-famous-than-jesus.html|title=Who's More Famous Than Jesus?|newspaper=[[The New York Times]] |date=14 March 2014 |first1=Dwight |last1=Garner.|archive-url=https://web.archive.org/web/20210401095825/https://www.nytimes.com/2014/03/16/magazine/whos-more-famous-than-jesus.html|archive-date=1 April 2021}}</ref> He contributed to almost every field of human knowledge then in existence, and he was the founder of many new fields. According to the philosopher [[Bryan Magee]], "it is doubtful whether any human being has ever known as much as he did".{{sfn| Magee | 2010 | page=34}} Among countless other achievements, Aristotle was the founder of [[formal logic]],{{sfn| Guthrie | 1990 | page=156}}<!--{{sfn| Case | p=518}}--> pioneered the study of [[zoology]], and left every future scientist and philosopher in his debt through his contributions to the scientific method.{{sfn| Aristotle (Greek philosopher)}}{{sfn| Durant | 2006 | page=92}}{{sfn| Kukkonen | 2010 | pages=70–77}} Taneli Kukkonen, writing in ''The Classical Tradition'', observes that his achievement in founding two sciences is unmatched, and his reach in influencing "every branch of intellectual enterprise" including Western ethical and political theory, theology, rhetoric and literary analysis is equally long. As a result, Kukkonen argues, any analysis of reality today "will almost certainly carry Aristotelian overtones ... evidence of an exceptionally forceful mind."{{sfn| Kukkonen | 2010 | pages=70–77}} [[Jonathan Barnes]] wrote that "an account of Aristotle's intellectual afterlife would be little less than a history of European thought".{{sfn| Barnes | 1982 | page=86}}
+
+=== On his successor, Theophrastus ===
+{{Main|Theophrastus | Historia Plantarum (Theophrastus)}}
+[[File:161Theophrastus 161 frontespizio.jpg| thumb | upright | [[Book frontispiece|Frontispiece]] to a 1644 version of [[Theophrastus]]'s ''[[Historia Plantarum (Theophrastus)|Historia Plantarum]]'', originally written around 300 BC]]
+
+Aristotle's pupil and successor, [[Theophrastus]], wrote the ''[[Historia Plantarum (Theophrastus)|History of Plants]]'', a pioneering work in botany. Some of his technical terms remain in use, such as [[carpel]] from ''carpos'', fruit, and [[pericarp]], from ''pericarpion'', seed chamber.{{sfn| Hooker | 1831 | page=219}}
+Theophrastus was much less concerned with formal causes than Aristotle was, instead pragmatically describing how plants functioned.{{sfn| Mayr | 1982 | pp= 90–91}}{{sfn| Mason | 1979 | p= 46}}
+
+=== On later Greek philosophers ===
+{{further | Peripatetic school}}
+
+The immediate influence of Aristotle's work was felt as the [[Lyceum]] grew into the [[Peripatetic school]]. Aristotle's students included [[Aristoxenus]], [[Dicaearchus]], [[Demetrius of Phalerum]], [[Eudemos of Rhodes]], [[Harpalus]], [[Hephaestion]], [[Mnason of Phocis]], [[Nicomachus (son of Aristotle)|Nicomachus]], and Theophrastus. Aristotle's influence over [[Alexander the Great]] is seen in the latter's bringing with him on his expedition a host of zoologists, botanists, and researchers. He had also learned a great deal about [[Persian people|Persian]] customs and traditions from his teacher. Although his respect for Aristotle was diminished as his travels made it clear that much of Aristotle's geography was clearly wrong, when the old philosopher released his works to the public, Alexander complained "Thou hast not done well to publish thy acroamatic doctrines; for in what shall I surpass other men if those doctrines wherein I have been trained are to be all men's common property?"{{sfn| Plutarch | 1919 | p= Part 1, 7:7}}
+
+=== On Hellenistic science ===
+{{further | Ancient Greek medicine}}
+
+After Theophrastus, the Lyceum failed to produce any original work. Though interest in Aristotle's ideas survived, they were generally taken unquestioningly.{{sfn| Annas | 2001 | page=252}} It is not until the age of [[Alexandria]] under the [[Ptolemaic Kingdom|Ptolemies]] that advances in biology can be again found.
+
+The first medical teacher at Alexandria, [[Herophilos|Herophilus of Chalcedon]], corrected Aristotle, placing intelligence in the brain, and connected the nervous system to motion and sensation. Herophilus also distinguished between [[vein]]s and [[artery|arteries]], noting that the latter [[pulse]] while the former do not.{{sfn| Mason | 1979 | p= 56}} Though a few ancient [[atomism|atomists]] such as [[Lucretius]] challenged the [[teleology|teleological]] viewpoint of Aristotelian ideas about life, [[teleology]] (and after the rise of Christianity, [[natural theology]]) would remain central to biological thought essentially until the 18th and 19th centuries. [[Ernst Mayr]] states that there was "nothing of any real consequence in biology after Lucretius and [[Galen]] until the Renaissance."{{sfn| Mayr | 1985 | pp=90–94}}
+
+=== On Byzantine scholars ===
+{{See also|Commentaries on Aristotle | Byzantine Aristotelianism}}
+
+Greek Christian scribes played a crucial role in the preservation of Aristotle by copying all the extant Greek language manuscripts of the corpus. The first Greek Christians to comment extensively on Aristotle were Philoponus, Elias, and David in the sixth century, and [[Stephen of Alexandria]] in the early seventh century.{{sfn| Sorabji | 1990 | pages=20, 28, 35–36}} [[John Philoponus]] stands out for having attempted a fundamental critique of Aristotle's views on the eternity of the world, movement, and other elements of Aristotelian thought.{{sfn| Sorabji | 1990 | pages=233–724}} Philoponus questioned Aristotle's teaching of physics, noting its flaws and introducing the [[theory of impetus]] to explain his observations.{{sfn|Lindberg|1992|p=162}}
+
+After a hiatus of several centuries, formal commentary by Eustratius and [[Michael of Ephesus]] reappeared in the late eleventh and early twelfth centuries, apparently sponsored by [[Anna Comnena]].{{sfn|Sorabji|1990|pp=20–21, 28–29, 393–406, 407–408}}
+
+=== On the medieval Islamic world ===
+{{further|Logic in Islamic philosophy|Transmission of the Greek Classics}}
+[[File:Arabic aristotle.jpg| thumb|upright | Islamic portrayal of Aristotle, c. 1220]]
+
+Aristotle was one of the most revered Western thinkers in early [[Islamic theology]]. Most of the still extant works of Aristotle,{{sfn|Kennedy-Day|1998}} as well as a number of the original Greek commentaries, were translated into Arabic and studied by Muslim philosophers, scientists and scholars. [[Averroes]], [[Avicenna]] and [[Alpharabius]], who wrote on Aristotle in great depth, also influenced [[Thomas Aquinas]] and other Western Christian scholastic philosophers. [[Alkindus]] greatly admired Aristotle's philosophy,{{sfn|Staley|1989}} and Averroes spoke of Aristotle as the "exemplar" for all future philosophers.{{sfn|Averroes|1953|p=III, 2, 43}} Medieval Muslim scholars regularly described Aristotle as the "First Teacher".{{sfn|Kennedy-Day|1998}} The title was later used by Western philosophers (as in the famous poem of [[Dante Alighieri|Dante]]) who were influenced by the tradition of [[Islamic philosophy]].{{sfn|Nasr|1996|pp=59–60}}
+
+=== On medieval Europe ===
+[[File:Aristotle and Phyllis.jpg| thumb | upright | left | Woodcut of [[The tale of Phyllis and Aristotle|Aristotle ridden by Phyllis]] by [[Hans Baldung]], 1515{{sfn|Phyllis and Aristotle}}]]
+{{further|Aristotelianism|Syllogism#Medieval}}
+
+With the loss of the study of ancient Greek in the early [[medieval]] Latin West, Aristotle was practically unknown there from c. AD 600 to c. 1100 except through the Latin translation of the ''Organon'' made by [[Boethius]]. In the twelfth and thirteenth centuries, interest in Aristotle revived and Latin Christians had translations made, both from Arabic translations, such as those by [[Gerard of Cremona]],{{sfn| Hasse | 2014}} and from the original Greek, such as those by [[James of Venice]] and [[William of Moerbeke]]. After the [[Scholasticism|Scholastic]] Thomas Aquinas wrote his ''[[Summa Theologica]]'', working from Moerbeke's translations and calling Aristotle "The Philosopher",{{sfn|Aquinas|2013}} the demand for Aristotle's writings grew, and the [[Greek language|Greek]] manuscripts returned to the West, stimulating a revival of Aristotelianism in Europe that continued into the [[Renaissance]].{{sfn| Kuhn | 2018}} These thinkers blended Aristotelian philosophy with Christianity, bringing the thought of Ancient Greece into the Middle Ages. Scholars such as Boethius, [[Peter Abelard]], and [[John Buridan]] worked on Aristotelian logic.{{sfn| Lagerlund}}
+
+The medieval English poet [[Geoffrey Chaucer|Chaucer]] describes his student as being happy by having
+
+{{blockquote | <poem>at his beddes heed
+Twenty bookes, clad in blak or reed,
+Of aristotle and his philosophie,{{sfn| Allen|Fisher|2011|p=17}}</poem>}}
+
+A [[The tale of Phyllis and Aristotle|cautionary medieval tale]] held that Aristotle advised his pupil Alexander to avoid the king's seductive mistress, Phyllis, but was himself captivated by her, and allowed her to ride him. Phyllis had secretly told Alexander what to expect, and he witnessed Phyllis proving that a woman's charms could overcome even the greatest philosopher's male intellect. Artists such as [[Hans Baldung]] produced a series of illustrations of the popular theme.{{sfn| Aristotle Phyllis}}{{sfn|Phyllis and Aristotle}}
+
+The Italian poet Dante says of Aristotle in ''[[The Divine Comedy]]'':
+{| class="wikitable" style="font-size: 85%;"
+|+
+! [[Dante Alighieri|Dante]]<br />''L'Inferno'', Canto IV. 131–135 !! Translation<br />''Hell''
+|-
+|<poem>vidi 'l maestro di color che sanno
+seder tra filosofica famiglia.
+Tutti lo miran, tutti onor li fanno:
+quivi vid'ïo Socrate e Platone
+che 'nnanzi a li altri più presso li stanno;</poem>||<poem>I saw the Master there of those who know,
+Amid the philosophic family,
+By all admired, and by all reverenced;
+There Plato too I saw, and Socrates,
+Who stood beside him closer than the rest.
+</poem>
+|}
+
+Besides Dante's fellow poets, the classical figure that most influenced the [[Divine Comedy|''Comedy'']] is Aristotle. Dante built up the philosophy of the ''Comedy'' with the works of Aristotle as a foundation, just as the scholastics used Aristotle as the basis for their thinking. Dante knew Aristotle directly from Latin translations of his works and indirectly quotations in the works of [[Albert Magnus]].<ref>Lafferty, Roger. "[https://www.jstor.org/stable/pdf/40165857.pdf?refreqid=excelsior%3A55f6bfc22f02768d5dcdc92005228933 The Philosophy of Dante]", pg. 4</ref> Dante even acknowledges Aristotle's influence explicitly in the poem, specifically when Virgil justifies the Inferno's structure by citing the ''[[Nicomachean Ethics]]''.<ref>''Inferno'', Canto&nbsp;XI, lines 70-115, Mandelbaum translation.</ref>
+
+=== On medieval Judaism ===
+[[Maimonides|Moses Maimonides]] (considered to be the foremost intellectual figure of medieval Judaism)<ref>{{cite encyclopedia|title=Moses Maimonides|encyclopedia=Britannica|url=https://www.britannica.com/biography/Moses-Maimonides}}</ref> adopted Aristotelianism from the Islamic scholars and based his ''[[Guide for the Perplexed]]'' on it and that became the basis of Jewish [[scholastic philosophy]]. Maimonides also considered Aristotle to be the greatest philosopher that ever lived, and styled him as the "chief of the philosophers".<ref>Levi ben Gershom, The Wars of the Lord: Book one, Immortality of the soul, p. 35.</ref><ref>Leon Simon, Aspects Of The Hebrew Genius: A Volume Of Essays On Jewish Literature And Thought (1910), p. 127.</ref><ref>Herbert A. Davidson, Herbert A. |q (Herbert Alan) Davidson, Professor of Hebrew Emeritus Herbert Davidson, Moses Maimonides: The Man and His Works, p. 98.</ref> Also, in his letter to [[Samuel ibn Tibbon]], Maimonides observes that there is no need for Samuel to study the writings of philosophers who preceded Aristotle because the works of the latter are "sufficient by themselves and [superior] to all that were written before them. His intellect, Aristotle's is the extreme limit of human intellect, apart from him upon whom the divine emanation has flowed forth to such an extent that they reach the level of prophecy, there being no level higher".<ref>Menachem Kellner, Maimonides on Judaism and the Jewish People, p. 77.</ref>
+
+=== On Early Modern scientists ===
+[[File:William Harvey ( 1578-1657) Venenbild.jpg| thumb | [[William Harvey]]'s ''[[Exercitatio Anatomica de Motu Cordis et Sanguinis in Animalibus|De Motu Cordis]]'', 1628, showed that the [[circulation of the blood|blood circulated]], contrary to classical era thinking.]]
+
+In the [[Early Modern]] period, scientists such as [[William Harvey]] in England and [[Galileo Galilei]] in Italy reacted against the theories of Aristotle and other classical era thinkers like [[Galen]], establishing new theories based to some degree on observation and experiment. Harvey demonstrated the [[circulation of the blood]], establishing that the heart functioned as a pump rather than being the seat of the soul and the controller of the body's heat, as Aristotle thought.{{sfn| Aird | 2011 | pp=118–29}} Galileo used more doubtful arguments to displace Aristotle's physics, proposing that bodies all fall at the same speed whatever their weight.{{sfn| Machamer | 2017}}
+
+=== On 18th/19th-century thinkers ===
+The 19th-century German philosopher [[Friedrich Nietzsche]] has been said to have taken nearly all of his political philosophy from Aristotle.{{sfn| Durant | 2006 | p=86}} Aristotle rigidly separated action from production, and argued for the deserved subservience of some people ("natural slaves"),{{sfn|Deslauriers|Destrée|2013|pp=102, 106–107}} and the natural superiority (virtue, ''arete'') of others. It was [[Martin Heidegger]], not Nietzsche, who elaborated a new interpretation of Aristotle, intended to warrant his deconstruction of scholastic and philosophical tradition.{{sfn| Sikka | 1997 | page=265}}
+
+The English mathematician [[George Boole]] fully accepted Aristotle's logic, but decided "to go under, over, and beyond" it with his system of [[Boolean algebra|algebraic logic]] in his 1854 book ''[[The Laws of Thought]]''. This gives logic a mathematical foundation with equations, enables it to solve equations as well as check [[Validity (logic)|validity]], and allows it to handle a wider class of problems by expanding propositions of any number of terms, not just two.{{sfn| Boole | 2003}}
+
+[[Charles Darwin]] regarded Aristotle as the most important contributor to the subject of biology. In an 1882 letter he wrote that "Linnaeus and Cuvier have been my two gods, though in very different ways, but they were mere schoolboys to old Aristotle".<ref name="Wilkins 2009">{{cite book |last=Wilkins |first=John |title=Species: a history of the idea |publisher=University of California Press | publication-place=Berkeley |year=2009 |isbn=978-0-520-27139-5 |oclc=314379168 |page=15}}</ref><ref name="Pasipoularides 2010">{{cite book |last=Pasipoularides |first=Ares |title=The heart's vortex: intracardiac blood flow phenomena |publisher=People's Medical Publishing House |publication-place=Shelton, Connecticut |year=2010 |isbn=978-1-60795-033-2 |oclc=680621287 |page=118}}</ref> Also, in later editions of the book "[[On the Origin of Species]]', Darwin traced evolutionary ideas as far back as Aristotle;<ref>{{harvnb|Darwin|1872|p=[http://darwin-online.org.uk/content/frameset?viewtype=text&itemID=F391&pageseq=18 xiii]}}</ref> the text he cites is a summary by Aristotle of the ideas of the earlier Greek philosopher [[Empedocles]].<ref>{{Citation|author=Aristotle|title=Physics|url=http://classics.mit.edu/Aristotle/physics.2.ii.html|access-date=23 April 2009|publisher=translated by Hardie, R. P. and Gayle, R. K. and hosted by MIT's Internet Classics Archive}}</ref>
+
+[[James Joyce]]'s favoured philosopher was Aristotle, whom he considered to be "the greatest thinker of all times".<ref>O'Rourke, F. (2009). Philosophy. In J. McCourt (Ed.), James Joyce in Context (Literature in Context, pp. 320-331). Cambridge: Cambridge University Press. {{DOI|10.1017/CBO9780511576072.029}}</ref> [[Samuel Taylor Coleridge]] said: Everybody is born either a Platonist or an Aristotelian.<ref>William Robert Wians, Aristotle's Philosophical Development: Problems and Prospects, p. 1.</ref> [[Ayn Rand]] acknowledged Aristotle as her greatest influence{{sfn|Burns|2009|p=2}} and remarked that in the [[history of philosophy]] she could only recommend "three A's"—Aristotle, Aquinas, and Ayn Rand.{{sfn|Sciabarra|1995|p=12}} She also regarded Aristotle as the greatest of all philosophers.<ref>James P. Sterba, From Rationality to Equality, p. 94.</ref>
+[[Karl Marx]] considered Aristotle to be the "greatest thinker of antiquity", and called him a "giant thinker", a "genius", and "the great scholar".<ref>F. Novotny, The Posthumous Life of Plato, p. 573</ref><ref>Matt Vidal, Tony Smith, Tomás Rotta, Paul Prew, The Oxford Handbook of Karl Marx, p. 215.</ref><ref>Judith A. Swanson, C. David Corbin, Aristotle's 'Politics': A Reader's Guide, p. 146.</ref>
+
+=== Modern rejection and rehabilitation ===
+[[File:Alexander and Aristotle.jpg| thumb|upright=1.35 | "That most enduring of romantic images, Aristotle tutoring the future conqueror Alexander".{{sfn|Kukkonen|2010|pages=70–77}} Illustration by {{interlanguage link|Charles Laplante|fr}}, 1866]]
+
+During the 20th century, Aristotle's work was widely criticized. The philosopher [[Bertrand Russell]]
+argued that "almost every serious intellectual advance has had to begin with an attack on some Aristotelian doctrine". Russell called Aristotle's ethics "repulsive", and labelled his logic "as definitely antiquated as Ptolemaic astronomy". Russell stated that these errors made it difficult to do historical justice to Aristotle, until one remembered what an advance he made upon all of his predecessors.{{sfn|Russell|1972}}
+
+The Dutch historian of science [[Eduard Jan Dijksterhuis]] wrote that Aristotle and his predecessors showed the difficulty of science by "proceed[ing] so readily to frame a theory of such a general character" on limited evidence from their senses.{{sfn|Dijksterhuis|1969|p=72}} In 1985, the biologist [[Peter Medawar]] could still state in "pure seventeenth century"{{sfn|Leroi|2015|p=353}} tones that Aristotle had assembled "a strange and generally speaking rather tiresome farrago of hearsay, imperfect observation, wishful thinking and credulity amounting to downright gullibility".{{sfn|Leroi|2015|p=353}}{{sfn|Medawar|Medawar|1984|p=28}}
+
+By the start of the 21st century, however, Aristotle was taken more seriously: Kukkonen noted that "In the best 20th-century scholarship Aristotle comes alive as a thinker wrestling with the full weight of the Greek philosophical tradition."{{sfn|Kukkonen|2010|pp=70–77}} [[Alasdair MacIntyre]] has attempted to reform what he calls the Aristotelian tradition in a way that is anti-elitist and capable of disputing the claims of both liberals and Nietzscheans.{{sfn|Knight|2007|pp=''passim''}} Kukkonen observed, too, that "that most enduring of romantic images, Aristotle tutoring the future conqueror Alexander" remained current, as in the 2004 film ''[[Alexander (2004 film)|Alexander]]'', while the "firm rules" of Aristotle's theory of drama have ensured a role for the ''Poetics'' in [[Cinema of the United States|Hollywood]].{{sfn|Kukkonen|2010|pp=70–77}}
+
+Biologists continue to be interested in Aristotle's thinking. [[Armand Marie Leroi]] has reconstructed Aristotle's biology,{{sfn|Leroi|2015}} while [[Tinbergen's four questions|Niko Tinbergen's four questions]], based on Aristotle's four causes, are used to analyse [[animal behaviour]]; they examine [[function (biology)|function]], [[phylogeny]], [[mechanism (biology)|mechanism]], and [[ontogeny]].{{sfn|MacDougall-Shackleton|2011|pp=2076–2085}}{{sfn|Hladký|Havlíček|2013}}
+
+== Surviving works ==
+
+=== Corpus Aristotelicum ===
+{{main|Corpus Aristotelicum}}
+
+[[File:Aristotelis De Moribus ad Nicomachum.jpg| thumb | upright | First page of a 1566 edition of the ''[[Nicomachean Ethics]]'' in Greek and Latin]]
+
+The works of Aristotle that have survived from antiquity through medieval manuscript transmission are collected in the Corpus Aristotelicum. These texts, as opposed to Aristotle's lost works, are technical philosophical treatises from within Aristotle's school. Reference to them is made according to the organization of [[Immanuel Bekker]]'s Royal Prussian Academy edition (''Aristotelis Opera edidit Academia Regia Borussica'', Berlin, 1831–1870), which in turn is based on ancient classifications of these works.{{sfn|Aristotelis Opera}}
+
+=== Loss and preservation ===
+{{see|Recovery of Aristotle}}
+
+Aristotle wrote his works on papyrus scrolls, the common writing medium of that era.{{efn-ua|"When the Roman dictator Sulla invaded Athens in 86 BC, he brought back to Rome a fantastic prize – Aristotle's library. Books then were papyrus rolls, from 10 to 20 feet long, and since Aristotle's death in 322 BC, worms and damp had done their worst. The rolls needed repairing, and the texts clarifying and copying on to new papyrus (imported from Egypt – Moses' bulrushes). The man in Rome who put Aristotle's library in order was a Greek scholar, Tyrannio."{{sfn|When libraries were|2001}}}} His writings are divisible into two groups: the "[[exoteric]]", intended for the public, and the "[[esoteric]]", for use within the [[Lyceum (Classical)|Lyceum]] school.{{sfn|Barnes|1995|p=12}}{{efn-ua|1=Aristotle: ''Nicomachean Ethics'' 1102a26–27. Aristotle himself never uses the term "esoteric" or "acroamatic". For other passages where Aristotle speaks of ''exōterikoi logoi'', see [[W.D. Ross]], ''Aristotle's Metaphysics'' (1953), vol. 2 pp= 408–410. Ross defends an interpretation according to which the phrase, at least in Aristotle's own works, usually refers generally to "discussions not peculiar to the [[Peripatetic school]]", rather than to specific works of Aristotle's own.}}{{sfn|House|1956|page=35}} Aristotle's "lost" works stray considerably in characterization from the surviving Aristotelian corpus. Whereas the lost works appear to have been originally written with a view to subsequent publication, the surviving works mostly resemble lecture notes not intended for publication.{{sfn|Irwin|Fine|1996|pp= xi–xii}}{{sfn|Barnes|1995|p=12}} [[Cicero]]'s description of Aristotle's literary style as "a river of gold" must have applied to the published works, not the surviving notes.{{efn-ua|"''veniet flumen orationis aureum fundens Aristoteles''", (Google translation: "Aristotle will come pouring forth a golden stream of eloquence").{{sfn|Cicero|1874}}}} A major question in the history of Aristotle's works is how the exoteric writings were all lost, and how the ones now possessed came to be found.{{sfn|Barnes|Griffin|1999|pages=1–69}} The consensus is that Andronicus of Rhodes collected the esoteric works of Aristotle's school which existed in the form of smaller, separate works, distinguished them from those of Theophrastus and other Peripatetics, edited them, and finally compiled them into the more cohesive, larger works as they are known today.{{sfn|Anagnostopoulos|2013|page=16}}{{sfn|Barnes|1995|pp=10–15}}{{-}}
+
+== Legacy ==
+=== Depictions ===
+;Paintings
+
+Aristotle has been depicted by major artists including [[Lucas Cranach the Elder]],{{sfn| Lucas Cranach the Elder}} [[Justus van Gent]], [[Raphael]], [[Paolo Veronese]], [[Jusepe de Ribera]],{{sfn| Lee | Robinson | 2005}} [[Rembrandt]],{{sfn| Aristotle with Bust | 2002}} and [[Francesco Hayez]] over the centuries. Among the best-known depictions is Raphael's [[fresco]] ''[[The School of Athens]]'', in the [[Apostolic Palace|Vatican's Apostolic Palace]], where the figures of Plato and Aristotle are central to the image, at the architectural [[vanishing point]], reflecting their importance.{{sfn| Phelan | 2002}} Rembrandt's ''[[Aristotle with a Bust of Homer]]'', too, is a celebrated work, showing the knowing philosopher and the blind Homer from an earlier age: as the art critic [[Jonathan Jones (journalist)|Jonathan Jones]] writes, "this painting will remain one of the greatest and most mysterious in the world, ensnaring us in its musty, glowing, pitch-black, terrible knowledge of time."{{sfn| Held | 1969}}{{sfn| Jones | 2002}}
+
+<gallery mode="packed" heights="170px">
+File:Aristotle in Nuremberg Chronicle.jpg| ''[[Nuremberg Chronicle]]'' [[anachronism|anachronistically]] shows Aristotle in a medieval scholar's clothing. Ink and watercolour on paper, 1493
+File:Gent, Justus van - Aristotle - c. 1476.jpg| ''Aristotle'' by [[Justus van Gent]]. Oil on panel, c. 1476
+File:Lucas Cranach d.Ä. - Phyllis und Aristotle (1530).jpg| ''Phyllis and Aristotle'' by [[Lucas Cranach the Elder]]. Oil on panel, 1530
+File:Biblioteka Marciana, Aristotel.jpg| ''Aristotle'' by [[Paolo Veronese]], Biblioteka Marciana. Oil on canvas, 1560s
+File:Turchi-AristoteIMG 1713.JPG| ''Aristotle and [[Campaspe]]'',{{efn-ua | Compare the medieval tale of Phyllis and Alexander above.}} [[Alessandro Turchi]] (attrib.) Oil on canvas, 1713
+File:Aristotle by Jusepe de Ribera.jpg| ''[[Aristotle (Ribera painting)|Aristotle]]'' by [[Jusepe de Ribera]]. Oil on canvas, 1637
+File:Rembrandt - Aristotle with a Bust of Homer - WGA19232.jpg| ''Aristotle with a Bust of [[Homer]]'' by [[Rembrandt]]. Oil on canvas, 1653
+File:Johann Jakob Dorner d Ä (attr) Aristoteles.jpg| ''Aristotle'' by [[Johann Jakob Dorner the Elder]]. Oil on canvas, by 1813
+File:Francesco Hayez 001.jpg| ''Aristotle'' by [[Francesco Hayez]]. Oil on canvas, 1811
+</gallery>
+
+;Sculptures
+
+<gallery mode="packed" heights="170px">
+File:Aristoteles Louvre.jpg|Roman copy of 1st or 2nd century from original bronze by [[Lysippos]]. [[Louvre Museum]]
+File:DSC00218 - Aristotele - Copia romana del 117-138 dC. - Foto di G. Dall'Orto.jpg|Roman copy of 117-138 AD of Greek original. Palermo Regional Archeology Museum
+File:Formella 21, platone e aristotele o la filosofia, luca della robbia, 1437-1439.JPG|Relief of Aristotle and Plato by [[Luca della Robbia]], [[Florence Cathedral]], 1437–1439
+File:Llyfrgell Sant Deiniol and Gladstone's Library Hawarden Penarlâg 05.JPG|Stone statue in niche, [[Gladstone's Library]], [[Hawarden]], Wales, 1899
+File:Uni Freiburg - Philosophen 4.jpg|Bronze statue, [[University of Freiburg]], Germany, 1915
+</gallery>
+
+=== Eponyms ===
+The [[Aristotle Mountains]] in [[Antarctica]] are named after Aristotle. He was the first person known to conjecture, in his book ''[[Meteorology (Aristotle)|Meteorology]]'', the existence of a landmass in the southern high-latitude region and called it ''Antarctica''.{{sfn| Aristotle Mountains}} [[Aristoteles (crater)|Aristoteles]] is a crater on the [[Moon]] bearing the classical form of Aristotle's name.{{sfn| Aristoteles}}
+
+== See also ==
+* [[Aristotelian Society]]
+*[[Aristotle's biology|Aristotle's Biology]]
+* [[Conimbricenses]]
+* [[Perfectionism (philosophy)|Perfectionism]]
+
+== References ==
+=== Notes ===
+{{notelist-ua | 30em}}
+
+=== Citations ===
+{{Reflist | colwidth=25em}}
+
+=== Sources ===
+{{refbegin|30em}}
+* {{cite book |author=Aesop |author-link=Aesop |title=The Complete Fables By Aesop |date=1998 |translator-last=Temple |translator-first=Olivia |translator-last2=Temple |translator-first2=Robert |url=https://books.google.com/books?id=ZB-rVxPvtPEC&pg=PR3 |publisher=Penguin Classics |isbn=978-0-14-044649-4 }}
+* {{cite journal |last=Aird |first=W. C. |title=Discovery of the cardiovascular system: from Galen to William Harvey |year=2011 |pages=118–129 |journal=Journal of Thrombosis and Haemostasis |volume=9 |doi=10.1111/j.1538-7836.2011.04312.x |pmid=21781247 |s2cid=12092592}}
+* {{cite magazine |last1=Allain |first1=Rhett |title=I'm So Totally Over Newton's Laws of Motion |magazine=Wired |date=21 March 2016 |url=https://www.wired.com/2016/03/im-totally-newtons-laws-motion/ |access-date=11 May 2018 }}
+* {{cite book |last1=Allen |first1=Mark |last2=Fisher |first2=John H. |title=The Complete Poetry and Prose of Geoffrey Chaucer |url=https://books.google.com/books?id=eMSUXumf6psC&pg=PA17 |date=2011 |publisher=Cengage Learning |isbn=978-0-15-506041-8 }}
+* {{cite book |last=Anagnostopoulos |first=Georgios |title=A Companion to Aristotle |year=2013 |publisher=Wiley-Blackwell |isbn=978-1-118-59243-4}}
+* {{cite book |last=Annas |first=Julia |title=Classical Greek Philosophy |date=2001 |publisher=Oxford University Press |isbn=978-0-19-285357-8}}
+* {{cite book |last=Aquinas |first=Thomas |author-link=Thomas Aquinas |title=Summa Theologica |url=https://books.google.com/books?id=YiJCBAAAQBAJ |year=2013 |publisher=e-artnow |isbn=978-80-7484-292-4 }}
+* {{cite web |editor-first=Immanuel |editor-last=Bekker |orig-year=1831 |url=http://archive.org/details/bub_gb_jMz9zVYu9Q0C |title=Aristotelis Opera edidit Academia Regia Borussica Aristoteles graece |last=Aristoteles |date=31 January 2019 |publisher=apud Georgium Reimerum |access-date=31 January 2019 |via=Internet Archive |ref=CITEREFAristotelis Opera }}
+* {{cite web |title=Aristoteles |url=https://planetarynames.wr.usgs.gov/nomenclature/SearchResults;jsessionid=BE8F9834B709207DDD5D36EFA5506C7F |website=Gazetteer of Planetary Nomenclature. United States Geological Survey |access-date=19 March 2018 |ref=CITEREFAristoteles }}
+* {{cite web |title=Aristoteles-Park in Stagira |url=http://www.dimosaristoteli.gr/en/sights/aristotle-park |publisher=Dimos Aristoteli |access-date=20 March 2018 |ref=CITEREFAristoteles-Park in Stagira }}
+* {{cite IEP |last=Humphreys |first=Justin |title=Aristotle (384–322 B.C.E.) |date=2009 | url-id=aristotl |issn=2161-0002 }}
+* {{cite web |title=Aristotle (Greek philosopher) |publisher=Britannica Online Encyclopedia |url=https://www.britannica.com/EBchecked/topic/34560/Aristotle |website=Britannica.com |access-date=26 April 2009 |archive-url=https://web.archive.org/web/20090422103155/https://www.britannica.com/EBchecked/topic/34560/Aristotle |archive-date=22 April 2009 |url-status=live |ref=CITEREFAristotle (Greek philosopher) }}
+* {{cite web |url=http://classics.mit.edu/Aristotle/metaphysics.html |publisher=The Internet Classics Archive |title=Metaphysics |last=Aristotle |website=classics.mit.edu |access-date=30 January 2019 |ref=CITEREFMetaphysics }}
+* {{cite web |url=http://classics.mit.edu/Aristotle/meteorology.html |publisher=The Internet Classics Archive |title=Meteorology |last=Aristotle |website=classics.mit.edu |access-date=30 January 2019 |ref=CITEREFMeteorology }}
+* {{cite web |url=http://classics.mit.edu/Aristotle/nicomachaen.html |publisher=The Internet Classics Archive |title=Nicomachean Ethics |author=Aristotle |website=classics.mit.edu |ref=CITEREFNicomachean Ethics }}
+* {{cite web |url=http://classics.mit.edu/Aristotle/soul.html |publisher=The Internet Classics Archive |title=On the Soul |last=Aristotle |website=classics.mit.edu |access-date=30 January 2019 |ref=CITEREFOn the Soul }}
+* {{cite web |url=http://classics.mit.edu/Aristotle/physics.html |publisher=The Internet Classics Archive |title=Physics |author=Aristotle |website=classics.mit.edu |access-date=31 January 2019 |ref=CITEREFPhysics }}
+* {{cite web |url=http://classics.mit.edu/Aristotle/poetics.html |publisher=The Internet Classics Archive |title=Poetics |last=Aristotle |website=classics.mit.edu |access-date=30 January 2019 |ref=CITEREFPoetics }}
+* {{cite web |url=http://classics.mit.edu/Aristotle/politics.html |publisher=The Internet Classics Archive |title=Politics |last=Aristotle |website=classics.mit.edu |access-date=30 January 2019 |ref=CITEREFPolitics }}
+* {{cite web |url=http://classics.mit.edu/Aristotle/prior.html |publisher=The Internet Classics Archive |title=Prior Analytics |last=Aristotle |website=classics.mit.edu |ref=CITEREFPrior Analytics }}
+* {{cite web |author=Aristotle |title=Rhetoric |translator-first=W. Rhys |translator-last=Roberts |url=http://rhetoric.eserver.org/aristotle/rhet1-5.html |archive-date=13 February 2015 |ref=CITEREFRhetoric |archive-url=https://web.archive.org/web/20150213075039/http://rhetoric.eserver.org/aristotle/rhet1-5.html }}
+* {{cite web |title=Aristotle Mountains |url=https://data.aad.gov.au/aadc/gaz/scar/display_name.cfm?gaz_id=137410 |work=[[Scientific Committee on Antarctic Research|SCAR]] [[Composite Antarctic Gazetteer]] |publisher=[[Programma Nazionale di Ricerche in Antartide]] |agency=[[Department of the Environment and Energy]], [[Australian Antarctic Division]], [[Australian Government]] |access-date=1 March 2018 |ref=CITEREFAristotle Mountains }}
+* {{cite book |author=Aristotle |title=Politics-Ethics, In Early Economic Thought: Selections from Economic Literature Prior to Adam Smith |date=1948 |editor=Monroe, Arthur E. |publisher=Harvard University Press}}
+* {{cite book |author=Aristotle |title=The Politics |url=https://archive.org/details/politics0000aris |url-access=registration |date=1984 |editor=Lord, Carnes |publisher=University of Chicago Press |isbn=978-0-226-92184-6 }}
+* {{cite book |author=Aristotle |title=Politics |date=2009 |others=Translated by Ernest Barker and revised with introduction and notes by R.F. Stalley |publisher=Oxford University Press |isbn=978-0-19-953873-7 |edition=1st |orig-year=1995}}
+* {{cite book |author=Aristotle | translator-last1=Sachs | translator-first1=Joe |title=Aristotle's ''Metaphysics'' |year=1999 |publisher=Green Lion Press}}
+* {{cite web |title=Aristotle and Phyllis |url=http://www.artic.edu/aic/collections/artwork/20121 |publisher=Art Institute Chicago |access-date=22 March 2018 |ref=CITEREFAristotle Phyllis }}
+* {{cite web |url=https://www.collinsdictionary.com/dictionary/english/aristotle |title=Aristotle definition and meaning |publisher=Collins English Dictionary |website=www.collinsdictionary.com |ref=CITEREFCollins English Dictionary }}
+* {{cite news |title=Aristotle with a Bust of Homer, Rembrandt (1653) |date=27 July 2002 |url=https://www.theguardian.com/culture/2002/jul/27/art.homer |newspaper=[[The Guardian]] |access-date=23 March 2018 |ref=CITEREFAristotle with Bust2002 }}
+* {{cite book |last=Averroes |title=Commentarium Magnum in Aristotelis De Anima Libros|editor-last=Crawford|editor-first=F. Stuart |publisher=Mediaeval Academy of America |oclc=611422373 |date=1953}}
+* {{cite book |last1=Barnes |first1=Jonathan |title=Aristotle: A Very Short Introduction |date=1982 |author-link=Jonathan Barnes |publisher=Oxford University Press |isbn=978-0-19-285408-7}}
+* {{cite book |last=Barnes |first=Jonathan |chapter=Life and Work |title=The Cambridge Companion to Aristotle |date=1995 |author-link=Jonathan Barnes |publisher=Cambridge University Press |isbn=978-0-521-42294-9 |chapter-url=https://books.google.com/books?id=WBqQOqM5dfsC }}
+* {{cite book |last1=Barnes |first1=Jonathan |author-link=Jonathan Barnes |last2=Griffin |first2=Miriam Tamara |title=Philosophia Togata: Plato and Aristotle at Rome. II |url=https://books.google.com/books?id=r18BAAAACAAJ |year=1999 |publisher=Clarendon Press |isbn=978-0-19-815222-4 }}
+* {{cite book |last1=Bergstrom |first1=Carl T. |last2=Dugatkin |first2=Lee Alan |title=Evolution |date=2012 |url=https://books.google.com/books?id=SeaEZwEACAAJ |publisher=Norton |isbn=978-0-393-92592-0 }}
+* {{cite journal |last=Blits |first=Kathleen C. |title=Aristotle: Form, function, and comparative anatomy |date=15 April 1999 |pages=58–63 |journal=The Anatomical Record |volume=257 |issue=2 |doi=10.1002/(SICI)1097-0185(19990415)257:2<58::AID-AR6>3.0.CO;2-I |pmid=10321433|doi-access=free }}
+* {{cite book |last=Bloch |first=David |title=Aristotle on Memory and Recollection |date=2007 |url=https://books.google.com/books?id=QwTHng_5RqAC&q=Aristotle+on+Memory+and+Recollection&pg=PR9 |isbn=978-90-04-16046-0 }}
+* {{cite book |chapter-url=https://plato.stanford.edu/archives/win2016/entries/logic-ancient/ |title=The Stanford Encyclopedia of Philosophy |first=Susanne |last=Bobzien |chapter=Ancient Logic |editor-first=Edward N. |editor-last=Zalta |date=2015 |publisher=Metaphysics Research Lab, Stanford University |via=Stanford Encyclopedia of Philosophy }}
+* {{cite book |last=Boole |first=George |author-link=George Boole |title=The Laws of Thought |url=https://books.google.com/books?id=nUEQAQAAIAAJ |year=2003 |orig-year=1854 |publisher=Prometheus Books |isbn=978-1-59102-089-9 }}
+* {{cite web |last=Campbell |first=Michael |title=Behind the Name: Meaning, Origin and History of the Name "Aristotle" |url=http://www.behindthename.com/name/aristotle |website=Behind the Name |access-date=6 April 2012 }}
+* {{cite book |last=Carruthers |first=Mary |title=The Book of Memory: A Study of Memory in Medieval Culture |date=2007 |url=https://books.google.com/books?id=dntrAnqfIasC&q=The+book+of+memory:+the+study+of+memory+in+medieval+times&pg=PR8 |isbn=978-0-521-42973-3 }}
+* {{cite book |last1=Carteron |first1=Henri |title=Notion de Force dans le Systeme d'Aristote |date=1923 |publisher=J. Vrin |language=fr}}
+* {{cite book |last=Cicero |first=Marcus Tullius |author-link=Cicero |chapter=Book II, chapter XXXVIII, §&nbsp;119 |title=The Academica of Cicero 106–43 BC |date=1874 | editor-first=James S. | editor-last=Reid |publisher=Macmillan}}
+* {{cite web |last1=Cohen |first1=S. Marc |title=Aristotle's Metaphysics |date=8 October 2000 |url=https://plato.stanford.edu/archives/win2016/entries/aristotle-metaphysics/ |website=Stanford Encyclopedia of Philosophy |edition=Winter 2016 |access-date=14 November 2018}}<!--edition based on access-date-->
+* {{cite journal |last=Corcoran |first=John |title=Aristotle's Demonstrative Logic |date=2009 |pages=1–20 |journal=History and Philosophy of Logic |volume=30|doi=10.1080/01445340802228362 |citeseerx=10.1.1.650.463|s2cid=8514675 }}
+* {{cite journal |last1=Day |first1=J. |title=Botany meets archaeology: people and plants in the past |year=2013 |pages=5805–5816 |journal=Journal of Experimental Botany |volume=64 |issue=18 |doi=10.1093/jxb/ert068 |pmid=23669575|doi-access=free }}
+* {{cite journal |last=Degnan |first=Michael |title=Recent Work in Aristotle's Logic |date=1994 |pages=81–89 |journal=Philosophical Books |volume=35 |issue=2 (April 1994)|doi=10.1111/j.1468-0149.1994.tb02858.x}}
+* {{cite book |last1=Deslauriers |first1=Marguerite |last2=Destrée |first2=Pierre |url=https://books.google.com/books?id=haCyAAAAQBAJ&pg=PA162 |title=The Cambridge Companion to Aristotle's Politics |date=2013 |publisher=Cambridge University Press |isbn=978-1-107-00468-9 }}
+* {{cite book |last1=Dijksterhuis |first1=Eduard Jan |title=The Mechanization of the World Picture |date=1969 |translator=C. Dikshoorn |publisher=Princeton University Press}}
+* {{cite journal |last1=Drabkin |first1=Israel E. |title=Notes on the Laws of Motion in Aristotle |date=1938 |pages=60–84 |journal=The American Journal of Philology |volume=59 |issue=1 |jstor=90584|doi=10.2307/290584}}
+* {{cite book |last=Durant |first=Will |title=The Story of Philosophy |date=2006 |author-link=Will Durant |orig-year=1926 |publisher=Simon & Schuster |isbn=978-0-671-73916-4 | title-link=The Story of Philosophy}}
+* {{cite book |last=Düring |first=Ingemar |title=Aristotle in the Ancient Biographical Tradition. By Ingemar Düring |url=https://books.google.com/books?id=MnKAQwAACAAJ |year=1957 |publisher=Almqvist & Wiksell in Komm. }}
+* {{cite book |last1=Ebenstein |first1=Alan |first2=William |last2=Ebenstein |title=Introduction to Political Thinkers |date=2002 | author-link=Alan O. Ebenstein |publisher=Wadsworth Group}}
+* {{cite journal |last=Evans |first=Nancy |s2cid=143750010 |date=2006 |title=Diotima and Demeter as Mystagogues in Plato's Symposium |journal=Hypatia |volume=21 |issue=2 |pages=1–27 |doi=10.1111/j.1527-2001.2006.tb01091.x |issn=1527-2001}}
+* {{cite journal |last=Filonik |first=Jakub |title=Athenian impiety trials: a reappraisal |date=2013 |pages=72–73 |journal=Dike |volume=16 |issue=16 |doi=10.13130/1128-8221/4290 | doi-access=free}}
+* {{cite book |last=Freeland |first=Cynthia A. |title=Feminist Interpretations of Aristotle |date=1998 |publisher=Penn State University Press |isbn=978-0-271-01730-3}}
+* {{cite book |last1=Garver |first1=Eugene |title=Aristotle's Rhetoric: An Art of Character |date=1994 |publisher=University of Chicago Press |isbn=978-0-226-28425-5 |url=https://books.google.com/books?id=J2ldWwIQhHwC&q=Aristotle+ethos+pathos+logos }}
+* {{cite book |last=Gigon |first=Olof |title=Vita Aristotelis Marciana |url=https://books.google.com/books?id=a3ldDwAAQBAJ |date=2017 |orig-year=1965 |publisher=Walter de Gruyter |isbn=978-3-11-082017-1 }}
+* {{cite book |last=Green |first=Peter |title=Alexander of Macedon |url=https://archive.org/details/alexanderofmaced0000gree |url-access=registration |date=1991 |publisher=University of California Press |isbn=978-0-520-27586-7 }}
+* {{cite book |last=Grimaldi |first=William M. A. |chapter=Studies in the Philosophy of Aristotle's ''Rhetoric'' |title=Landmark Essays on Aristotelian Rhetoric |date=1998 |page=71 |series=Landmark Essays |volume=14 |editor1-last=Enos |editor1-first=Richard Leo |editor2-last=Agnew |editor2-first=Lois Peters |publisher=Lawrence Erlbaum Associates |isbn=978-1-880393-32-1 |chapter-url=https://books.google.com/books?id=sMihW5GdDzoC&q=Aristotle+paradeigma+and+enthymeme&pg=PA71 }}
+* {{cite book |last=Guthrie |first=W. |title=A History of Greek Philosophy Vol. 1 |date=2010 |publisher=Cambridge University Press |isbn=978-0-521-29420-1}}
+* {{cite book |last=Guthrie |first=W. |title=A history of Greek philosophy Vol. 6: Aristotle: An Encounter |date=1990 |url=https://books.google.com/books?id=8EG0yV0cGoEC |publisher=Cambridge University Press |isbn=978-0-521-38760-6 }}
+* {{cite book |last=Haase |first=Wolfgang |title=Philosophie, Wissenschaften, Technik. Philosophie (Doxographica &#91;Forts. &#93;) |year=1992 |url=https://books.google.com/books?id=ifqGuiHo6eQC&pg=PA3862 |publisher=Walter de Gruyter |isbn=978-3-11-013699-9 }}
+* {{cite book |last1=Hall |first1=Edith |title=Aristotle's Way: How Ancient Wisdom Can Change Your Life |date=2018 |publisher=[[The Bodley Head]] |isbn=978-1-84792-407-0}}
+* {{cite book |last1=Halliwell |first1=Stephen |chapter=Inside and Outside the Work of Art |title=The Aesthetics of Mimesis: Ancient Texts and Modern Problems |date=2002 |pages=152–59 |author-link=Stephen Halliwell (academic) |publisher=Princeton University Press |isbn=978-0-691-09258-4 |chapter-url=https://books.google.com/books?id=R8wctGFg12MC&q=Aristotle+mimesis }}
+* {{cite book |last=Hankinson |first=R.J. |title=Cause and Explanation in Ancient Greek Thought |date=1998 |publisher=Oxford University Press |isbn=978-0-19-823745-7 |doi=10.1093/0199246564.001.0001}}
+* {{cite SEP |last=Hasse |first=Dag Nikolaus |title=Influence of Arabic and Islamic Philosophy on the Latin West |date=2014 | url-id=arabic-islamic-influence}}
+* {{cite book |last=Held |first=Julius |title=Rembrandt's Aristotle and Other Rembrandt Studies |url=https://archive.org/details/rembrandtsaristo0000held |url-access=registration |year=1969 |author-link=Julius S. Held |publisher=Princeton University Press |isbn=978-0-691-03862-9 }}
+* {{cite journal |last1=Hladký |first1=V. |last2=Havlíček |first2=J |year=2013 |url=http://ishe.org/wp-content/uploads/2015/04/HEB_2013_28_4_3-11.pdf |title=Was Tinbergen an Aristotelian? Comparison of Tinbergen's Four Whys and Aristotle's Four Causes |journal=Human Ethology Bulletin |volume=28 |issue=4 |pages=3–11 }}
+* {{cite journal |last1=Holowchak |first1=Mark |title=Aristotle on Dreaming: What Goes on in Sleep when the 'Big Fire' goes out |date=1996 |pages=405–423 |journal=Ancient Philosophy |volume=16 |issue=2 |url=http://www.pdcnet.org/ancientphil/Ancient-Philosophy |doi=10.5840/ancientphil199616244 }}
+* {{cite book |last=Hooker |first=Sir William Jackson |author-link=William Jackson Hooker |title=The British Flora: Comprising the Phaenogamous, Or Flowering Plants, and the Ferns |year=1831 |url=https://books.google.com/books?id=v-IYAAAAYAAJ&pg=PA219 |publisher=Longman |oclc=17317293 }}
+* {{cite book |last=House |first=Humphry |title=Aristotle's Poetics |date=1956 |url=https://archive.org/details/aristotlespoetic032945mbp |publisher=Rupert Hart-Davis }}
+* {{cite web |last1=Hutchinson |first1=D. S. |last2=Johnson |first2=Monte Ransome |title=Exhortation to Philosophy |date=2015 |page=22 |url=http://www.protrepticus.info/protr2017x20.pdf |website=Protrepticus }}
+* {{cite book |title=Aristotle: Introductory Readings |editor-first1=Terence |editor-last1=Irwin |editor-first2=Gail |editor-last2=Fine |url=https://books.google.com/books?id=Tx8zjmHZ2NMC |year=1996 |publisher=Hackett Pub. |isbn=978-0-87220-339-6 }}
+* {{cite news |last=Jones |first=Jonathan |title=Aristotle with a Bust of Homer, Rembrandt (1653) |date=27 July 2002 |url=https://www.theguardian.com/culture/2002/jul/27/art.homer |access-date=23 March 2018 |work=[[The Guardian]] }}
+* {{cite book |last=Jones |first=W. T. |title=The Classical Mind: A History of Western Philosophy |date=1980 |publisher=Harcourt Brace Jovanovich |isbn=978-0-15-538312-8}}
+* {{cite book |last=Kant |first=Immanuel |author-link=Immanuel Kant |title=Critique of Pure Reason |date=1787 |edition=Second |oclc=2323615}}
+* {{cite book |last=Kantor |first=J. R. |title=The Scientific Evolution of Psychology, Volume I |year=1963 |publisher=Principia Press |isbn=978-0-911188-25-7}}
+* {{cite book |last=Kaufmann |first=Walter Arnold |title=Tragedy and Philosophy |date=1968 |publisher=Princeton University Press |isbn=978-0-691-02005-1 |url=https://books.google.com/books?id=NTk9-180NbsC&q=Aristotle+Oedipus+the+King }}
+* {{cite book |last1=Kennedy-Day |first1=Kiki |chapter=Aristotelianism in Islamic philosophy |title=Routledge Encyclopedia of Philosophy |date=1998 |publisher=Taylor and Francis |doi=10.4324/9780415249126-H002-1 |isbn=978-0-415-25069-6}}
+* {{cite book |last=Knight |first=Kelvin |title=Aristotelian Philosophy: Ethics & Politics from Aristotle to MacIntyre |date=2007 |publisher=Polity Press |isbn=978-0-7456-1977-4}}
+* {{cite encyclopedia |last1=Kraut |first1=Richard |title=Aristotle's Ethics |date=1 May 2001 |url=https://plato.stanford.edu/entries/aristotle-ethics/ |encyclopedia=Stanford Encyclopedia of Philosophy |access-date=19 March 2018 }}
+* {{cite SEP |last=Kuhn |first=Heinrich |title=Aristotelianism in the Renaissance |date=2018 | url-id=aristotelianism-renaissance}}
+* {{cite book |last=Kukkonen |first=Taneli |title=The classical tradition |year=2010 | editor-last=Grafton | editor-first=Anthony | display-editors=etal |publisher=Belknap Press of Harvard University Press |isbn=978-0-674-03572-0}}
+* {{cite SEP |last=Lagerlund |first=Henrik |title=Medieval Theories of the Syllogism |date=2016 | url-id=medieval-syllogism}}
+* {{cite SEP |last=Lagerlund |first=Henrik |title=Medieval Theories of the Syllogism | url-id=medieval-syllogism}}
+* {{cite web |last=Lahanas |first=Michael |title=Optics and ancient Greeks |url=http://www.mlahanas.de/Greeks/Optics.htm |website=Mlahanas.de |access-date=26 April 2009 |archive-url=https://web.archive.org/web/20090411051535/http://www.mlahanas.de/Greeks/Optics.htm |archive-date=11 April 2009 |url-status=dead }}
+* {{cite book |last1=Lee |first1=Ellen Wardwell |last2=Robinson |first2=Anne |title=Indianapolis Museum of Art: Highlights of the Collection |year=2005 |publisher=[[Indianapolis Museum of Art]] |isbn=978-0-936260-77-8}}
+* {{cite web |last1=Leroi |first1=Armand Marie (Presenter) |author-link=Armand Marie Leroi |title=Aristotle's Lagoon: Embryo Inside a Chicken's Egg |date=3 May 2011 |url=http://www.bbc.co.uk/programmes/p00gqlyy |publisher=BBC |access-date=17 November 2016 }}
+* {{cite book |last=Leroi |first=Armand Marie |title=The Lagoon: How Aristotle Invented Science |date=2015 |author-link=Armand Marie Leroi |title-link=Aristotle's Lagoon |publisher=Bloomsbury |isbn=978-1-4088-3622-4}}
+* {{cite book |last=Lindberg |first=David |title=The Beginnings of Western Science |url=https://archive.org/details/beginningsofwest00lind |url-access=registration |date=1992 |publisher=University of Chicago Press |isbn=978-0-226-48205-7 }}
+* {{cite book |last=Lloyd |first=G. E. R. |title=The critic of Plato |date=1968 |author-link=G. E. R. Lloyd |work=Aristotle: The Growth and Structure of His Thought |publisher=Cambridge University Press |isbn=978-0-521-09456-6}}
+* {{cite book |last=Lloyd |first=G. E. R. |title=Causes and correlations |date=1996 | author-link=G. E. R. Lloyd |work=Adversaries and Authorities: Investigations into ancient Greek and Chinese science |publisher=Cambridge University Press |isbn=978-0-521-55695-8}}
+* {{cite book |last=Lovejoy |first=Arthur O. |title=The Great Chain of Being: A Study of the History of an Idea |date=31 January 1976 |author-link=Arthur O. Lovejoy |publisher=Harvard University Press |isbn=978-0-674-36153-9}}
+* {{cite web | title=Lucas Cranach the Elder{{!}} Phyllis and Aristotle | url=http://www.sothebys.com/en/auctions/ecatalogue/2008/important-old-master-paintings-including-european-works-of-art-n08404/lot.78.html | publisher=[[Sotheby's]] | access-date=23 March 2018 | date=2008 | ref=CITEREFLucas Cranach the Elder }}
+* {{cite book |last=Lyell |first=Charles |title=Principles of Geology |date=1832 |author-link=Charles Lyell |url=https://archive.org/details/principlesgeolo01unkngoog |oclc=609586345 |publisher=J. Murray, 1832 }}
+* {{cite journal |last=MacDougall-Shackleton |first=Scott A. |title=The levels of analysis revisited |date=27 July 2011 |pages=2076–2085 |journal=Philosophical Transactions of the Royal Society B: Biological Sciences |volume=366 |issue=1574 |doi=10.1098/rstb.2010.0363 |pmc=3130367 |pmid=21690126}}
+* {{cite SEP |last=Machamer |first=Peter |title=Galileo Galilei |date=2017 | url-id=galileo}}
+* {{cite book |last=Magee |first=Bryan |title=The Story of Philosophy |date=2010 |author-link=Bryan Magee |publisher=Dorling Kindersley |isbn=978-0-241-24126-4}}
+* {{cite book |last=Mason |first=Stephen F. |title=A History of the Sciences |date=1979 |url=https://books.google.com/books?id=PLlMAAAAMAAJ |publisher=Collier Books |isbn=978-0-02-093400-4 |oclc=924760574 }}
+* {{cite book |last=Mayr |first=Ernst |author-link=Ernst Mayr |title=The Growth of Biological Thought |url=https://archive.org/details/growthofbiologic00mayr |url-access=registration |date=1982 |publisher=Belknap Press |isbn=978-0-674-36446-2 }}
+* {{cite book |last=Mayr |first=Ernst |author-link=Ernst Mayr |title=The Growth of Biological Thought |date=1985 |publisher=Harvard University Press |isbn=978-0-674-36446-2}}
+* {{cite book |last=McLeisch |first=Kenneth Cole |title=Aristotle: The Great Philosophers |date=1999 |publisher=Routledge |isbn=978-0-415-92392-7 |url=https://archive.org/details/aristotle00mcle }}
+* {{cite book |title=Aristotle to Zoos: a philosophical dictionary of biology |year=1984 |last1=Medawar |first1=Peter B. |author-link=Peter Medawar |last2=Medawar |first2=J. S. |publisher=Oxford University Press |isbn=978-0-19-283043-2}}
+* {{cite journal |last=Miller |first=Willard M. |title=Aristotle on Necessity, Chance, and Spontaneity |year=1973 |pages=204–213 |journal=New Scholasticism |volume=47 |issue=2 |doi=10.5840/newscholas197347237}}
+* {{cite journal |last1=Modrak |first1=Deborah |title=Dreams and Method in Aristotle |date=2009 |pages=169–181 |journal=Skepsis: A Journal for Philosophy and Interdisciplinary Research |volume=20}}
+* {{cite book |last=Moore |first=Ruth |title=The Earth We Live On |url=https://archive.org/details/earthweliveonsto00moor |url-access=registration |year=1956 |publisher=Alfred A. Knopf |oclc=1024467091 }}
+* {{cite journal |last=Morsink |first=Johannes |title=Was Aristotle's Biology Sexist? |date=Spring 1979 |pages=83–112 |jstor=4330727 |journal=Journal of the History of Biology |volume=12 |issue=1 |doi=10.1007/bf00128136 |pmid=11615776 |s2cid=6090923}}
+* {{cite book |last=Nasr |first=Seyyed Hossein |title=The Islamic Intellectual Tradition in Persia |date=1996 |publisher=Curzon Press |isbn=978-0-7007-0314-2}}
+* {{cite web |last1=Phelan |first1=Joseph |title=The Philosopher as Hero: Raphael's The School of Athens |date=September 2002 |url=http://www.artcyclopedia.com/feature-2002-09.html |publisher=ArtCyclopedia |access-date=23 March 2018 }}
+* {{cite web |url=https://www.louvre.fr/en/oeuvre-notices/phyllis-and-aristotle |title=Phyllis and Aristotle |date=1 February 2019 |via=Musee du Louvre |ref=CITEREFPhyllis and Aristotle }}
+* {{cite book |last=Pickover |first=Clifford A. |title=The Math Book: From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics |year=2009 |url=https://books.google.com/books?id=JrslMKTgSZwC&pg=PA52 |publisher=Sterling |isbn=978-1-4027-5796-9 }}
+* {{cite web |url=https://penelope.uchicago.edu/Thayer/e/roman/texts/plutarch/lives/alexander*/3.html |title=Plutarch – Life of Alexander (Part 1 of 7) |date=1919 |publisher=Loeb Classical Library |website=penelope.uchicago.edu |access-date=31 January 2019 |ref=CITEREFPlutarch1919 }}
+* {{cite web |title=Predicate Logic |url=https://www.cs.utexas.edu/~schrum2/cs301k/lec/topic04-predicateLogic.pdf |publisher=University of Texas |access-date=29 March 2018 |archive-url=https://web.archive.org/web/20180329221535/https://www.cs.utexas.edu/~schrum2/cs301k/lec/topic04-predicateLogic.pdf |archive-date=29 March 2018 |url-status=live |ref=CITEREFPredicate Logic }}
+* {{cite book |last=Rhodes |first=Frank Harold Trevor |title=Evolution |date=1974 |url=https://books.google.com/books?id=EWGt0bff8agC |publisher=Golden Press |isbn=978-0-307-64360-5 }}
+* {{cite book |last=Robbins |first=Lionel |title=A History of Economic Thought: The LSE Lectures |date=2000 |editor1=Medema, Steven G. |editor2=Samuels, Warren J. |publisher=Princeton University Press}}
+* {{cite book |last1=Rorty |first1=Amélie Oksenberg |chapter=Structuring Rhetoric |date=1996 |title=Essays on Aristotle's ''Rhetoric'' |editor-last=Rorty |editor-first=Amélie Oksenberg |publisher=University of California Press |isbn=978-0-520-20227-6 |chapter-url=https://books.google.com/books?id=vd7fEb1wOmYC&q=Aristotle+deliberative+forensic+and+epideictic&pg=PA6 |url-access=registration |url=https://archive.org/details/essaysonaristotl0000unse }}
+* {{cite journal |last1=Rovelli |first1=Carlo |author-link=Carlo Rovelli |title=Aristotle's Physics: A Physicist's Look |year=2015 |pages=23–40 |journal=Journal of the American Philosophical Association |volume=1 |issue=1 |doi=10.1017/apa.2014.11 |arxiv=1312.4057 |s2cid=44193681}}
+* {{cite book |last=Russell |first=Bertrand |title=A history of western philosophy |url=https://books.google.com/books?id=RZc3AAAAIAAJ |year=1972 |publisher=Simon and Schuster |isbn=978-0-671-31400-2 }}
+* {{cite book |last=Sedley |first=David |title=Creationism and Its Critics in Antiquity |year=2007 |url=https://books.google.com/books?id=SgRuJEfzUG8C |publisher=University of California Press |isbn=978-0-520-25364-3 }}
+* {{cite book |last=Shields |first=Christopher |title=The Oxford Handbook of Aristotle |url=https://books.google.com/books?id=vTVsrl0mnH4C |date=2012 |publisher=OUP USA |isbn=978-0-19-518748-9 }}
+* {{cite SEP |last=Shields |first=Christopher |title=Aristotle's Psychology |date=2016 |url=https://plato.stanford.edu/archives/win2016/entries/aristotle/ |publisher=Metaphysics Research Lab, Stanford University | editor-last=Zalta | editor-first=Edward N. |edition=Winter 2016}}
+* {{cite book |last1=Shute |first1=Clarence |title=The Psychology of Aristotle: An Analysis of the Living Being |date=1941 |publisher=Columbia University Press |oclc=936606202}}
+* {{cite book |last=Sikka |first=Sonya |title=Forms of Transcendence: Heidegger and Medieval Mystical Theology |year=1997 |url=https://books.google.com/books?id=UNYIDrA0zrYC&pg=PA265 |publisher=SUNY Press |isbn=978-0-7914-3345-4 }}
+* {{cite SEP |last=Smith |first=Robin |title=Aristotle's Logic |date=2017 | url-id=aristotle-logic}}
+* {{cite book |url=http://archive.org/details/dictionarygreek09smitgoog |title=Dictionary of Greek and Roman Biography and Mythology |last=Smith |first=William George |orig-year=1869 |year=2007 |publisher=J. Walton |access-date=30 January 2019 |via=Internet Archive }}
+* {{cite book |last1=Sorabji |first1=R. |title=Aristotle on Memory |date=2006 |publisher=University of Chicago Press |location=Chicago |page=54 |edition=2nd |quote=And this is exactly why we hunt for the successor, starting in our thoughts from the present or from something else, and from something similar, or opposite, or neighbouring. By this means recollection occurs...}}
+* {{cite book |last=Sorabji |first=Richard |title=Aristotle Transformed |date=1990 |author-link=Richard Sorabji |publisher=Duckworth |isbn=978-0-7156-2254-4}}
+* {{cite journal |last1=Staley |first1=Kevin |title=Al-Kindi on Creation: Aristotle's Challenge to Islam |journal=Journal of the History of Ideas |date=1989 |volume=50 |issue=3 |pages=355–370 |jstor=2709566|doi=10.2307/2709566}}
+* {{cite web |last1=Susskind |first1=Leonard |title=Classical Mechanics, Lectures 2, 3 |date=3 October 2011 |author-link1=Leonard Susskind |url=http://theoreticalminimum.com/courses/classical-mechanics/2011/fall/lecture-2 |website=The Theoretical Minimum |access-date=11 May 2018 }}
+* {{cite book |last=Taylor |first=Henry Osborn |chapter=Chapter 3: Aristotle's Biology |title=Greek Biology and Medicine |date=1922 |author-link=Henry Osborn Taylor |archive-date=27 March 2006 |chapter-url=http://www.ancientlibrary.com/medicine/0051.html |archive-url=https://web.archive.org/web/20060327222953/http://www.ancientlibrary.com/medicine/0051.html |url-status=dead |access-date=3 January 2017 }}
+* {{cite web |title=The School of Athens by Raphael |url=http://www.visual-arts-cork.com/famous-paintings/school-of-athens.htm |publisher=Visual Arts Cork |access-date=22 March 2018 |ref=CITEREFSchool of Athens }}
+* {{cite web |last=Stewart |first=Jessica |title=The Story Behind Raphael's Masterpiece 'The School of Athens' |url=https://mymodernmet.com/school-of-athens-raphael/ |quote=Plato's gesture toward the sky is thought to indicate his Theory of Forms. ... Conversely, Aristotle's hand is a visual representation of his belief that knowledge comes from experience. Empiricism, as it is known, theorizes that humans must have concrete evidence to support their ideas |website=My Modern Met |year=2019 |access-date=29 March 2019 }}
+* {{cite book |last= Tangian |first=Andranik |date=2020
+|title=Analytical theory of democracy. Vols. 1 and 2|series=Studies in Choice and Welfare |publisher=Springer |location=Cham, Switzerland
+|isbn=978-3-030-39690-9 |doi=10.1007/978-3-030-39691-6 |s2cid=216190330 }}
+* {{cite book |last=Thompson |first=D'Arcy |author-link=D'Arcy Wentworth Thompson |title=Historia animalium |date=1910 |work=The works of Aristotle translated into English |editor1=Ross, W. D. |editor2=Smith, J. A. |publisher=Clarendon Press |url=https://ebooks.adelaide.edu.au/a/aristotle/history/index.html |oclc=39273217 |access-date=19 March 2018 |archive-date=9 August 2019 |archive-url=https://web.archive.org/web/20190809140240/https://ebooks.adelaide.edu.au/a/aristotle/history/index.html |url-status=dead }}
+* {{cite book |last=Warren |first=Howard C. |title=A History of the Association of Psychology |date=1921 |isbn=978-0-598-91975-5 |author-link=Howard C. Warren |url=https://books.google.com/books?id=D4IXAAAAYAAJ&q=The+history+of+the+association+of+psychology&pg=PA3 |oclc=21010604 <!--dlc--> }}
+* {{cite book |last1=Webb |first1=Wilse |title=Dreamtime and dreamwork: Decoding the language of the night |date=1990 |publisher=Jeremy P. Tarcher |isbn=978-0-87477-594-5 |url=https://archive.org/details/dreamtimedreamwo00kriprich }}
+* {{cite news |title=When libraries were on a roll |date=19 May 2001 |url=https://www.telegraph.co.uk/culture/4723624/When-libraries-were-on-a-roll.html |archive-url=https://ghostarchive.org/archive/20220110/https://www.telegraph.co.uk/culture/4723624/When-libraries-were-on-a-roll.html |archive-date=10 January 2022 |url-access=subscription |url-status=live |work=The Telegraph |access-date=29 June 2017 |ref=CITEREFWhen libraries were2001}}{{cbignore}}
+* {{cite SEP |last=Wildberg | first Christian |title=John Philoponus |date=2016 | url-id=philoponus}}
+* {{cite SEP |title=Aristotle's Influence |date=2018 | url-id=aristotle-influence |edition=Spring 2018 |ref=CITEREFAristotle's Influence2018}}
+*{{citation
+ |last = Darwin
+ |first = Charles
+ |year = 1872
+ |title = The Origin of Species by Means of Natural Selection, or the Preservation of Favoured Races in the Struggle for Life
+ |edition = 6th
+ |location = London
+ |publisher = John Murray
+ |url = http://darwin-online.org.uk/content/frameset?itemID=F391&viewtype=text&pageseq=1
+ |access-date = 9 January 2009
+}}
+* {{cite book|title=Goddess of the Market: Ayn Rand and the American Right|last=Burns|first=Jennifer|location=New York|publisher=Oxford University Press|year=2009|isbn=978-0-19-532487-7|title-link=Goddess of the Market: Ayn Rand and the American Right}}
+* {{cite book|title=Ayn Rand: The Russian Radical|last=Sciabarra|first=Chris Matthew|author-link=Chris Matthew Sciabarra|location=University Park, Pennsylvania|publisher=Pennsylvania State University Press|year=1995|isbn=978-0-271-01440-1|title-link=Ayn Rand: The Russian Radical}}
+{{refend}}
+
+== Further reading ==
+The secondary literature on Aristotle is vast. The following is only a small selection.
+
+{{refbegin|30em}}
+* [[J. L. Ackrill|Ackrill, J. L.]] (1997). ''Essays on Plato and Aristotle'', Oxford University Press.
+* {{cite book |last=Ackrill |first=J.L. |title=Aristotle the Philosopher |publisher=Oxford University Press |date=1981 |ref=none}}
+* {{Cite book |last=Adler |first=Mortimer J. |author-link=Mortimer Adler |title=Aristotle for Everybody |publisher=Macmillan |date=1978 | title-link=Aristotle for Everybody |ref=none}}
+* {{cite book |last=Ammonius | editor1-last=Cohen | editor1-first=S. Marc | editor2-last=Matthews | editor2-first=Gareth B |title=On Aristotle's Categories |publisher=Cornell University Press |date=1991 |isbn=978-0-8014-2688-9 |ref=none}}
+* {{cite book |last=Aristotle |title=The Works of Aristotle Translated into English Under the Editorship of W.D. Ross, 12 vols |publisher=[[Clarendon Press]] |date=1908–1952 |ref=none}} These translations are available in several places online; see External links.
+* Bakalis, Nikolaos. (2005). ''Handbook of Greek Philosophy: From Thales to the Stoics Analysis and Fragments'', Trafford Publishing, {{ISBN |978-1-4120-4843-9}}.
+* {{cite book |last=Bocheński |first=I. M. |title=Ancient Formal Logic |publisher=North-Holland |date=1951 |ref=none}}
+* Bolotin, David (1998). ''An Approach to Aristotle's Physics: With Particular Attention to the Role of His Manner of Writing.'' Albany: SUNY Press. A contribution to our understanding of how to read Aristotle's scientific works.
+* [[Myles Burnyeat|Burnyeat, Myles F.]] ''et al.'' (1979). ''Notes on Book Zeta of Aristotle's Metaphysics''. Oxford: Sub-faculty of Philosophy.
+* {{cite book | editor1-last=Cantor | editor1-first=Norman F. | editor2-first=Peter L. | editor2-last=Klein |title=Ancient Thought: Plato and Aristotle |volume=1 |series=Monuments of Western Thought |publisher=Blaisdell |date=1969 |ref=none}}
+* {{cite journal |last1=Chappell |first1=V. |year=1973 |title=Aristotle's Conception of Matter |journal=Journal of Philosophy |volume=70 |issue=19 |pages=679–696 |doi=10.2307/2025076 |jstor=2025076 |ref=none}}
+* Code, Alan (1995). Potentiality in Aristotle's Science and Metaphysics, Pacific Philosophical Quarterly 76.
+* {{cite web |last1=Cohen |first1=S. Marc |last2=Reeve |first2=C. D. C. |title=Aristotle's Metaphysics |date=21 November 2020 |url=https://plato.stanford.edu/archives/win2020/entries/aristotle-metaphysics/ |website=Stanford Encyclopedia of Philosophy |edition=Winter 2020 |ref=none}}
+* {{cite book |last=Ferguson |first=John |title=Aristotle |url=https://archive.org/details/aristotle0000ferg |url-access=registration |publisher=Twayne Publishers |date=1972 |isbn=978-0-8057-2064-8 |ref=none}}
+* De Groot, Jean (2014). ''Aristotle's Empiricism: Experience and Mechanics in the 4th century BC'', Parmenides Publishing, {{ISBN |978-1-930972-83-4}}.
+* Frede, Michael (1987). ''Essays in Ancient Philosophy''. Minneapolis: University of Minnesota Press.
+* {{cite book |last=Fuller |first=B.A.G. |author-link=Benjamin_Apthorp_Gould_Fuller |series=History of Greek Philosophy |volume=3 |title=Aristotle |publisher=Cape |date=1923 |ref=none}}
+* [[Eugene Gendlin|Gendlin, Eugene T.]] (2012). ''[http://www.focusing.org/aristotle/ Line by Line Commentary on Aristotle's De Anima] {{Webarchive|url=https://web.archive.org/web/20170327012857/http://www.focusing.org/aristotle/ |date=27 March 2017 |ref=none}}'', Volume 1: Books I & II; Volume 2: Book III. The Focusing Institute.
+* Gill, Mary Louise (1989). ''Aristotle on Substance: The Paradox of Unity''. Princeton University Press.
+* {{cite book |last=Guthrie |first=W.K.C. |title=A History of Greek Philosophy |volume=6 |publisher=[[Cambridge University Press]] |date=1981 |ref=none}}
+* {{cite book |last=Halper |first=Edward C. |year=2009 |title=One and Many in Aristotle's Metaphysics, Volume 1: Books Alpha – Delta |publisher=Parmenides Publishing |isbn=978-1-930972-21-6 |ref=none}}
+* {{cite book |last=Halper |first=Edward C. |year=2005 |title=One and Many in Aristotle's Metaphysics, Volume 2: The Central Books |publisher=Parmenides Publishing |isbn=978-1-930972-05-6 |ref=none}}
+* {{cite book |author-link=Terence Irwin |last=Irwin |first=Terence H. |year=1988 |title=Aristotle's First Principles |place=Oxford |publisher=Clarendon Press |isbn=0-19-824290-5 |ref=none |url=http://www.cyjack.com/cognition/Aristotle%27s%20first%20principles.pdf}}
+* {{cite book |last=Jaeger |first=Werner |title=Aristotle: Fundamentals of the History of His Development | editor-first=Richard | editor-last=Robinson |edition=2nd |publisher=Clarendon Press |date=1948 |ref=none}}
+* [[Alberto Jori|Jori, Alberto]] (2003). ''Aristotele'', Bruno Mondadori (Prize 2003 of the "[[International Academy of the History of Science]]"), {{ISBN |978-88-424-9737-0}}.
+* {{cite book | editor-last=Kiernan | editor-first=Thomas P. |title=Aristotle Dictionary |publisher=Philosophical Library |date=1962 |ref=none}}
+* Knight, Kelvin (2007). ''Aristotelian Philosophy: Ethics and Politics from Aristotle to MacIntyre'', Polity Press.
+* Lewis, Frank A. (1991). ''Substance and Predication in Aristotle''. Cambridge University Press.
+* Lord, Carnes (1984). ''Introduction to ''The Politics'', by Aristotle''. Chicago University Press.
+* Loux, Michael J. (1991). Primary Ousia: An Essay on Aristotle's Metaphysics Ζ and Η. Ithaca, NY: Cornell University Press.
+* Maso, Stefano (Ed.), Natali, Carlo (Ed.), Seel, Gerhard (Ed.) (2012) ''Reading Aristotle: Physics'' VII. 3: ''What is Alteration?'' ''Proceedings of the International ESAP-HYELE Conference'', Parmenides Publishing. {{ISBN |978-1-930972-73-5}}.
+* {{cite book |last=McKeon |first=Richard |title=Introduction to Aristotle |edition=2nd |publisher=University of Chicago Press |date=1973 |ref=none}}
+* {{cite encyclopedia |last=Miller|first=Frank|author-link=|editor-first=Ronald |editor-last=Hamowy |editor-link=Ronald Hamowy |encyclopedia=The Encyclopedia of Libertarianism |url= https://books.google.com/books?id=yxNgXs3TkJYC |year=2008 |publisher= [[SAGE Publications|Sage]]; [[Cato Institute]] |location= Thousand Oaks, CA |doi= 10.4135/9781412965811.n12 |isbn= 978-1412965804 |oclc=750831024| lccn = 2008009151 |pages=18–19 |chapter=Aristotle (382–322 B.C.) |chapter-url=https://sk.sagepub.com/reference/libertarianism/n12.xml}}
+* {{cite journal |last=Owen |first=G. E. L. |year=1965c |title=The Platonism of Aristotle |journal=Proceedings of the British Academy |volume=50 |pages=125–150 |ref=none}} [Reprinted in J. Barnes, M. Schofield, and R.R.K. Sorabji, eds.(1975). ''Articles on Aristotle'' Vol 1. Science. London: Duckworth 14–34.]
+* {{cite book |doi=10.1017/CBO9780511498282 |title=Aristotle and the Philosophy of Friendship |year=2002 |last1=Pangle |first1=Lorraine Smith |isbn=978-0-511-49828-2 |ref=none}}
+* {{cite book |last=Plato |author-link=Plato |title=The Worlds of Plato and Aristotle | editor1-first=Harold Joseph | editor1-last=Allen | editor2-first=James B | editor2-last=Wilbur |publisher=Prometheus Books |date=1979 |ref=none}}
+* Reeve, C. D. C. (2000). ''Substantial Knowledge: Aristotle's Metaphysics''. Hackett.
+* {{cite book |last=Rose |first=Lynn E. |title=Aristotle's Syllogistic |publisher=Charles C Thomas |date=1968 |ref=none}}
+* {{cite book |last=Ross |first=Sir David |author-link=W. D. Ross |title=Aristotle |publisher=Routledge |edition=6th |date=1995 |ref=none}}
+* Scaltsas, T. (1994). ''Substances and Universals in Aristotle's Metaphysics''. Cornell University Press.
+* Strauss, Leo (1964). "On Aristotle's ''Politics''", in ''The City and Man'', Rand McNally.
+* {{cite book |last=Swanson |first=Judith |title=The Public and the Private in Aristotle's Political Philosophy |url=https://archive.org/details/publicprivateina00swan |url-access=registration |publisher=Cornell University Press |date=1992 |isbn=978-0-8014-2319-2 |ref=none}}
+* {{Cite book |last=Veatch |first=Henry B. |author-link=Henry Babcock Veatch |title=Aristotle: A Contemporary Appreciation |publisher=Indiana University Press |date=1974 |ref=none}}
+* {{cite book |last=Woods |first=M. J. |year=1991b |chapter=Universals and Particular Forms in Aristotle's Metaphysics |series=[[Oxford Studies in Ancient Philosophy]] |title=Aristotle and the Later Tradition |volume=Suppl |pages=41–56 |ref=none}}
+{{refend}}
+
+== External links ==
+{{Sister project links | b=no | n=no | s=Author:Aristotle}}
+{{Wikisourcelang | el | Αριστοτέλης | Ἀριστοτέλης}}
+{{Library resources box | by=yes | onlinebooks=yes | others=yes | about=yes | label=Aristotle
+ | viaf= | lccn= | lcheading= | wikititle= }}
+* {{PhilPapers|category|aristotle}}
+* {{InPho | thinker | 2553}}
+* At the [[Internet Encyclopedia of Philosophy]]:
+*: {{hlist | [https://www.iep.utm.edu/aristotl/ Aristotle (general article)] | [https://www.iep.utm.edu/aris-bio/ Biology] | [https://www.iep.utm.edu/aris-eth/ Ethics] | [https://www.iep.utm.edu/aris-log/ Logic] | [https://www.iep.utm.edu/aris-met/ Metaphysics] | [https://www.iep.utm.edu/aris-mot/ Motion and its Place in Nature] | [https://www.iep.utm.edu/aris-poe/ Poetics] | [https://www.iep.utm.edu/aris-pol/ Politics]}}
+* At the [http://classics.mit.edu/Browse/index.html Internet Classics Archive]
+* From the [[Stanford Encyclopedia of Philosophy]]:
+*: {{hlist | [https://plato.stanford.edu/entries/aristotle Aristotle (general article)] | [https://plato.stanford.edu/entries/aristotelianism-renaissance/ Aristotle in the Renaissance] | [https://plato.stanford.edu/entries/aristotle-biology/ Biology] | [https://plato.stanford.edu/entries/aristotle-causality/ Causality] | [https://plato.stanford.edu/entries/aristotle-commentators/ Commentators on Aristotle] | [https://plato.stanford.edu/entries/aristotle-ethics/ Ethics] | [https://plato.stanford.edu/entries/aristotle-logic/ Logic] | [https://plato.stanford.edu/entries/aristotle-mathematics/ Mathematics] | [https://plato.stanford.edu/entries/aristotle-metaphysics/ Metaphysics] | [https://plato.stanford.edu/entries/aristotle-natphil/ Natural philosophy] | [https://plato.stanford.edu/entries/aristotle-noncontradiction/ Non-contradiction] | [https://plato.stanford.edu/entries/aristotle-politics/ Political theory] | [https://plato.stanford.edu/entries/aristotle-psychology/ Psychology] | [https://plato.stanford.edu/entries/aristotle-rhetoric/ Rhetoric]}}
+* {{cite CE1913 | first=William | last=Turner | wstitle=Aristotle | volume=1 | short=x |ref=none}}
+* {{cite LotEP |chapter=Aristotle |ref=none}}
+
+;Collections of works
+* {{StandardEbooks|Standard Ebooks URL=https://standardebooks.org/ebooks/aristotle}}
+* At [http://classics.mit.edu/Browse/index-Aristotle.html Massachusetts Institute of Technology]
+* {{Gutenberg author | id=2747}}
+* {{Internet Archive author}}
+* {{Librivox author | id=602}}
+* {{OL author | OL22105A}}
+* {{in lang|en|el}} [https://www.perseus.tufts.edu/cgi-bin/perscoll?.submit=Change&collection=Any&type=text&lang=Any&lookup=Aristotle Perseus Project] at [[Tufts University]]
+* At the [https://ebooks.adelaide.edu.au/a/aristotle/ University of Adelaide] {{Webarchive|url=https://web.archive.org/web/20170215160252/https://ebooks.adelaide.edu.au/a/aristotle/ |date=15 February 2017 }}
+* {{in lang|el|fr}} [http://remacle.org/bloodwolf/philosophes/Aristote/table.htm P. Remacle]
+* The 11-volume 1837 Bekker edition of ''Aristotle's Works'' in Greek ([http://isnature.org/Files/Aristotle/ PDF]{{dot}}[https://web.archive.org/web/20050816192647/http://grid.ceth.rutgers.edu/ancient/greek/aristotle_greek/ DJVU])
+
+{{Aristotelianism}}
+{{Navboxes|list=
+{{Peripatetics}}
+{{Metaphysics}}
+{{Ethics}}
+{{Natural history}}
+{{History of biology}}
+{{Philosophy of science}}
+{{Philosophy of language}}
+{{Jurisprudence}}
+{{Social and political philosophy}}
+{{Litcrit}}
+{{Ancient Greece topics}}
+}}
+{{Portal bar|Physics|Biology|Earth science|Psychology|Philosophy|Politics|Economics|Literature|Biography|Ancient Greece|History of science}}
+{{Authority control}}
+
+[[Category:Aristotle| ]]
+[[Category:Aristotelianism|*]]
+[[Category:384 BC births]]
+[[Category:322 BC deaths]]
+[[Category:4th-century BC mathematicians]]
+[[Category:4th-century BC philosophers]]
+[[Category:4th-century BC writers]]
+[[Category:Academic philosophers]]
+[[Category:Acting theorists]]
+[[Category:Ancient Greek biologists]]
+[[Category:Ancient Greek economists]]
+[[Category:Ancient Greek epistemologists]]
+[[Category:Ancient Greek ethicists]]
+[[Category:Ancient Greek logicians]]
+[[Category:Ancient Greek mathematicians]]
+[[Category:Ancient Greek metaphilosophers]]
+[[Category:Ancient Greek metaphysicians]]
+[[Category:Ancient Greek philosophers]]
+[[Category:Ancient Greek philosophers of language]]
+[[Category:Ancient Greek philosophers of mind]]
+[[Category:Ancient Greek physicists]]
+[[Category:Ancient Greek political philosophers]]
+[[Category:Ancient Greek philosophers of art]]
+[[Category:Ancient literary critics]]
+[[Category:Ancient Stagirites]]
+[[Category:Aphorists]]
+[[Category:Aristotelian philosophers]]
+[[Category:Attic Greek writers]]
+[[Category:Ancient Greek cosmologists]]
+[[Category:Critical thinking]]
+[[Category:Cultural critics]]
+[[Category:Founders of philosophical traditions]]
+[[Category:Greek male writers]]
+[[Category:Greek geologists]]
+[[Category:Greek meteorologists]]
+[[Category:Greek social commentators]]
+[[Category:Humor researchers]]
+[[Category:Irony theorists]]
+[[Category:Metic philosophers in Classical Athens]]
+[[Category:Moral philosophers]]
+[[Category:Natural philosophers]]
+[[Category:Ontologists]]
+[[Category:Peripatetic philosophers]]
+[[Category:Philosophers and tutors of Alexander the Great]]
+[[Category:Philosophers of ancient Chalcidice]]
+[[Category:Philosophers of culture]]
+[[Category:Philosophers of education]]
+[[Category:Philosophers of ethics and morality]]
+[[Category:Philosophers of history]]
+[[Category:Philosophers of law]]
+[[Category:Philosophers of literature]]
+[[Category:Philosophers of logic]]
+[[Category:Philosophers of love]]
+[[Category:Philosophers of psychology]]
+[[Category:Philosophers of science]]
+[[Category:Philosophers of time]]
+[[Category:Philosophers of sexuality]]
+[[Category:Philosophers of technology]]
+[[Category:Philosophical logic]]
+[[Category:Philosophical theists]]
+[[Category:Philosophy academics]]
+[[Category:Philosophy writers]]
+[[Category:Rhetoric theorists]]
+[[Category:Social critics]]
+[[Category:Social philosophers]]
+[[Category:Students of Plato]]
+[[Category:Trope theorists]]
+[[Category:Virtue ethicists]]
+[[Category:Virtue ethics]]
+[[Category:Western culture]]
+[[Category:Western philosophy]]
+[[Category:Zoologists]]
diff --git a/testcases/entity/disambiguation.txt b/testcases/entity/disambiguation.txt
new file mode 100644
index 00000000..bbdab1c1
--- /dev/null
+++ b/testcases/entity/disambiguation.txt
@@ -0,0 +1,652 @@
+{{Short description|Sequence of instructions to perform a task}}
+{{Redirect|Algorithms|the subfield of computer science|Analysis of algorithms}}
+{{Other uses}}
+
+{{More citations needed|date=July 2022}}
+{{Use mdy dates|date=September 2017}}
+
+[[Image:Euclid flowchart.svg|thumb|right| [[Flowchart]] of an algorithm ([[Euclid's algorithm]]) for calculating the greatest common divisor (g.c.d.) of two numbers ''a'' and ''b'' in locations named A and B. The algorithm proceeds by successive subtractions in two loops: IF the test B ≥ A yields "yes" or "true" (more accurately, the ''number'' ''b'' in location B is greater than or equal to the ''number'' ''a'' in location A) THEN, the algorithm specifies B ← B − A (meaning the number ''b'' − ''a'' replaces the old ''b''). Similarly, IF A > B, THEN A ← A − B. The process terminates when (the contents of) B is 0, yielding the g.c.d. in A. (Algorithm derived from Scott 2009:13; symbols and drawing style from Tausworthe 1977).]]
+
+[[File:Diagram for the computation of Bernoulli numbers.jpg|thumb|[[Ada Lovelace]]'s diagram from "note G", the first published computer algorithm]]
+
+In [[mathematics]] and [[computer science]], an '''algorithm''' ({{IPAc-en|audio=en-us-algorithm.ogg|ˈ|æ|l|ɡ|ə|r|ɪ|ð|əm}}) is a finite sequence of [[rigorous]] instructions, typically used to solve a class of specific [[Computational problem|problem]]s or to perform a [[computation]].<ref>{{Cite web|url=https://www.merriam-webster.com/dictionary/algorithm|title=Definition of ALGORITHM|work=Merriam-Webster Online Dictionary |language=en |access-date=2019-11-14 |archive-url=https://web.archive.org/web/20200214074446/https://www.merriam-webster.com/dictionary/algorithm |archive-date=February 14, 2020|url-status=live}}</ref> Algorithms are used as specifications for performing [[calculation]]s and [[data processing]]. By making use of [[artificial intelligence]], algorithms can perform automated deductions (referred to as [[automated reasoning]]) and use mathematical and logical tests to divert the code execution through various routes (referred to as [[automated decision-making]]). Using human characteristics as descriptors of machines in metaphorical ways was already practiced by [[Alan Turing]] with terms such as "memory", "search" and "stimulus".<ref>Blair, Ann, Duguid, Paul, Goeing, Anja-Silvia and Grafton, Anthony. Information: A Historical Companion, Princeton: Princeton University Press, 2021. p. 247</ref>
+
+In contrast, a [[Heuristic (computer science)|heuristic]] is an approach to problem solving that may not be fully specified or may not guarantee correct or optimal results, especially in problem domains where there is no well-defined correct or optimal result.<ref>David A. Grossman, Ophir Frieder, ''Information Retrieval: Algorithms and Heuristics'', 2nd edition, 2004, {{isbn|1402030045}}</ref>
+
+As an [[effective method]], an algorithm can be expressed within a finite amount of space and time,<ref>"Any classical mathematical algorithm, for example, can be described in a finite number of English words" (Rogers 1987:2).</ref> and in a well-defined formal language<ref>Well defined with respect to the agent that executes the algorithm: "There is a computing agent, usually human, which can react to the instructions and carry out the computations" (Rogers 1987:2).</ref> for calculating a [[Function (mathematics)|function]].<ref>"an algorithm is a procedure for computing a ''function'' (with respect to some chosen notation for integers) ... this limitation (to numerical functions) results in no loss of generality", (Rogers 1987:1).</ref> Starting from an initial state and initial input (perhaps [[Empty string|empty]]),<ref>"An algorithm has [[zero]] or more inputs, i.e., [[Quantity|quantities]] which are given to it initially before the algorithm begins" (Knuth 1973:5).</ref> the instructions describe a [[computation]] that, when [[Execution (computing)|executed]], proceeds through a finite<ref>"A procedure which has all the characteristics of an algorithm except that it possibly lacks finiteness may be called a 'computational method{{'"}} (Knuth 1973:5).</ref> number of well-defined successive states, eventually producing "output"<ref>"An algorithm has one or more outputs, i.e. quantities which have a specified relation to the inputs" (Knuth 1973:5).</ref> and terminating at a final ending state. The transition from one state to the next is not necessarily [[deterministic]]; some algorithms, known as [[randomized algorithms]], incorporate random input.<ref>Whether or not a process with random interior processes (not including the input) is an algorithm is debatable. Rogers opines that: "a computation is carried out in a discrete stepwise fashion, without the use of continuous methods or analogue devices ... carried forward deterministically, without resort to random methods or devices, e.g., dice" (Rogers 1987:2).</ref>
+
+== History ==
+The concept of algorithm has existed since antiquity. [[Arithmetic]] algorithms, such as a [[division algorithm]], were used by ancient [[Babylonian mathematics|Babylonian mathematicians]] c. 2500 BC and [[Egyptian mathematics|Egyptian mathematicians]] c. 1550 BC.<ref name="Springer Science & Business Media" /> [[Greek mathematics|Greek mathematicians]] later used algorithms in 240 BC in the [[sieve of Eratosthenes]] for finding prime numbers, and the [[Euclidean algorithm]] for finding the [[greatest common divisor]] of two numbers.<ref name="Cooke2005">{{cite book|last=Cooke|first=Roger L.|title=The History of Mathematics: A Brief Course|date=2005|publisher=John Wiley & Sons|isbn=978-1-118-46029-0}}</ref> [[Arabic mathematics|Arabic mathematicians]] such as [[al-Kindi]] in the 9th century used [[cryptographic]] algorithms for [[code-breaking]], based on [[frequency analysis]].<ref name="Dooley" />
+
+The word ''algorithm'' is derived from the name of the 9th-century Persian mathematician [[Muhammad ibn Musa al-Khwarizmi|Muḥammad ibn Mūsā al-Khwārizmī]], whose [[Nisba (suffix)|nisba]] (identifying him as from [[Khwarazm]]) was Latinized ''as Algoritmi ([[Arabization|Arabized]] [[Persian language|Persian]] الخوارزمی c. 780–850).''<ref>{{cite web|title=Al-Khwarizmi biography|url=http://www-history.mcs.st-andrews.ac.uk/Biographies/Al-Khwarizmi.html|url-status=live|archive-url=https://web.archive.org/web/20190802091553/http://www-history.mcs.st-andrews.ac.uk/Biographies/Al-Khwarizmi.html|archive-date=August 2, 2019|access-date=May 3, 2017|website=www-history.mcs.st-andrews.ac.uk}}</ref><ref>{{cite web|title=Etymology of algorithm|url=http://chambers.co.uk/search/?query=algorithm&title=21st|url-status=live|archive-url=https://web.archive.org/web/20190331204600/https://chambers.co.uk/search/?query=algorithm&title=21st|archive-date=March 31, 2019|access-date=December 13, 2016|website=Chambers Dictionary}}</ref>
+[[Muhammad ibn Musa al-Khwarizmi|Muḥammad ibn Mūsā al-Khwārizmī]] was a mathematician, [[astronomer]], [[geographer]], and scholar in the [[House of Wisdom]] in [[Baghdad]], whose name means 'the native of [[Khwarazm]]', a region that was part of [[Greater Iran]] and is now in [[Uzbekistan]].<ref name="Hogendijk">{{cite journal|first=Jan P. |last=Hogendijk |title=al-Khwarzimi |journal=Pythagoras |volume=38 |issue=2 |year=1998 |pages=4–5 |url=http://www.kennislink.nl/web/show?id=116543 |url-status=dead |archive-url=https://web.archive.org/web/20090412193516/http://www.kennislink.nl/web/show?id=116543 |archive-date=April 12, 2009 }}</ref><ref name="Oaks">{{cite web|first=Jeffrey A.|last=Oaks|url=http://facstaff.uindy.edu/~oaks/MHMC.htm|title=Was al-Khwarizmi an applied algebraist?|publisher=[[University of Indianapolis]]|access-date=May 30, 2008|archive-url=https://web.archive.org/web/20110718094835/http://facstaff.uindy.edu/~oaks/MHMC.htm|archive-date=July 18, 2011|url-status=dead|df=mdy-all}}</ref> About 825, al-Khwarizmi wrote an [[Arabic language]] treatise on the [[Hindu–Arabic numeral system]], which was translated into [[Latin]] during the 12th century. The manuscript starts with the phrase ''Dixit Algorizmi'' ('Thus spake Al-Khwarizmi'), where "Algorizmi" was the translator's [[Latinisation of names|Latinization]] of Al-Khwarizmi's name.<ref>{{cite book| last = Brezina| first = Corona| title = Al-Khwarizmi: The Inventor Of Algebra| url = https://books.google.com/books?id=955jPgAACAAJ| year = 2006| publisher = The Rosen Publishing Group| isbn = 978-1-4042-0513-0 }}</ref> Al-Khwarizmi was the most widely read mathematician in Europe in the late Middle Ages, primarily through another of his books, the [[Al-Jabr|Algebra]].<ref>[http://www-history.mcs.st-and.ac.uk/Extras/Boyer_Foremost_Text.html Foremost mathematical texts in history] {{Webarchive|url=https://web.archive.org/web/20110609224820/http://www-history.mcs.st-and.ac.uk/Extras/Boyer_Foremost_Text.html |date=June 9, 2011 }}, according to [[Carl B. Boyer]].</ref> In late medieval Latin, ''algorismus'', English '[[algorism]]', the corruption of his name, simply meant the "decimal number system".<ref>{{Citation|title=algorismic|url=https://www.thefreedictionary.com/algorismic|work=The Free Dictionary|access-date=2019-11-14|archive-url=https://web.archive.org/web/20191221200124/https://www.thefreedictionary.com/algorismic|archive-date=December 21, 2019|url-status=live}}</ref> In the 15th century, under the influence of the Greek word ἀριθμός (''arithmos''), 'number' (''cf.'' 'arithmetic'), the Latin word was altered to ''algorithmus'', and the corresponding English term 'algorithm' is first attested in the 17th century; the modern sense was introduced in the 19th century.<ref>''[[Oxford English Dictionary]]'', Third Edition, 2012 [http://www.oed.com/view/Entry/4959 ''s.v.'']</ref>
+
+[[Indian mathematics]] was predominantly algorithmic.
+Algorithms that are representative of the Indian mathematical tradition range from the ancient ''[[Sulbasutras|Śulbasūtrās]]'' to the medieval texts of the [[Kerala school of astronomy and mathematics|Kerala School]].<ref>{{cite book |last1=Sriram |first1=M. S. |editor1-last=Emch |editor1-first=Gerard G. |editor2-last=Sridharan |editor2-first=R. |editor3-last=Srinivas |editor3-first=M. D. |title=Contributions to the History of Indian Mathematics |date=2005 |publisher=Springer |isbn=978-93-86279-25-5 |page=153 |chapter-url=https://books.google.com/books?id=qfJdDwAAQBAJ&pg=PA153 |language=en |chapter=Algorithms in Indian Mathematics}}</ref>
+
+In English, the word ''algorithm'' was first used in about 1230 and then by [[Geoffrey Chaucer|Chaucer]] in 1391. English adopted the French term, but it was not until the late 19th century that "algorithm" took on the meaning that it has in modern English.<ref>{{Cite journal|last=Mehri|first=Bahman|date=2017|title=From Al-Khwarizmi to Algorithm|journal=Olympiads in Informatics|volume=11|issue=2|pages=71–74|doi=10.15388/ioi.2017.special.11}}</ref>
+
+Another early use of the word is from 1240, in a manual titled ''Carmen de Algorismo'' composed by [[Alexander of Villedieu|Alexandre de Villedieu]]. It begins with:
+
+{{blockquote|''Haec algorismus ars praesens dicitur, in qua / Talibus Indorum fruimur bis quinque figuris.''}}
+which translates to:
+{{blockquote|Algorism is the art by which at present we use those Indian figures, which number two times five.}}
+
+The poem is a few hundred lines long and summarizes the art of calculating with the new styled Indian dice (''Tali Indorum''), or Hindu numerals.<ref>{{Cite web|url=http://members.peak.org/~jeremy/calculators/alKwarizmi.html|title=Abu Jafar Muhammad ibn Musa al-Khwarizmi|website=members.peak.org|access-date=2019-11-14|archive-url=https://web.archive.org/web/20190821232118/http://members.peak.org/~jeremy/calculators/alKwarizmi.html|archive-date=August 21, 2019|url-status=live}}</ref>
+
+A partial formalization of the modern concept of algorithm began with attempts to solve the ''[[Entscheidungsproblem]] '' (decision problem) posed by [[David Hilbert]] in 1928. Later formalizations were framed as attempts to define "[[effective calculability]]"<ref>Kleene 1943 in Davis 1965:274</ref> or "effective method".<ref>Rosser 1939 in Davis 1965:225</ref> Those formalizations included the [[Kurt Gödel|Gödel]]–[[Jacques Herbrand|Herbrand]]–[[Stephen Cole Kleene|Kleene]] [[Recursion (computer science)|recursive functions]] of 1930, 1934 and 1935, [[Alonzo Church]]'s [[lambda calculus]] of 1936, [[Emil Post]]'s [[Formulation 1]] of 1936, and [[Alan Turing]]'s [[Turing machines]] of 1936–37 and 1939.
+
+==Informal definition==
+{{for|a detailed presentation of the various points of view on the definition of "algorithm"|Algorithm characterizations}}
+An informal definition could be "a set of rules that precisely defines a sequence of operations",<ref>Stone 1973:4</ref>{{qn | reason = Stone (1972) suggests on page 4: "...any sequence of instructions that can be obeyed by a robot, is called an algorithm"|date=July 2020}} which would include all computer programs (including programs that do not perform numeric calculations), and (for example) any prescribed [[bureaucratic]] procedure<ref>
+{{cite book
+ | last1 = Simanowski
+ | first1 = Roberto
+ | author-link1 = Roberto Simanowski
+ | translator1-last = Chase
+ | translator1-first = Jefferson
+ | title = The Death Algorithm and Other Digital Dilemmas
+ | url = https://books.google.com/books?id=RJV5DwAAQBAJ
+ | series = Untimely Meditations
+ | volume = 14
+ | location = Cambridge, Massachusetts
+ | publisher = MIT Press
+ | date = 2018
+ | page = 147
+ | isbn = 9780262536370
+ | access-date = 27 May 2019
+ | quote = [...] the next level of abstraction of central bureaucracy: globally operating algorithms.
+ | archive-url = https://web.archive.org/web/20191222120705/https://books.google.com/books?id=RJV5DwAAQBAJ
+ | archive-date = December 22, 2019
+ | url-status = live
+ }}
+</ref>
+or [[Cookbook|cook-book]] [[recipe]].<ref>
+{{cite book
+ | last1 = Dietrich
+ | first1 = Eric
+ | year = 1999
+ | chapter = Algorithm
+ | editor1-last = Wilson
+ | editor1-first = Robert Andrew
+ | editor2-last = Keil
+ | editor2-first = Frank C.
+ | title = The MIT Encyclopedia of the Cognitive Sciences
+ | url = https://books.google.com/books?id=-wt1aZrGXLYC
+ | series = MIT Cognet library
+ | location = Cambridge, Massachusetts
+ | publisher = MIT Press
+ | publication-date = 2001
+ | page = 11
+ | isbn = 9780262731447
+ | access-date = 22 July 2020
+ | quote = An algorithm is a recipe, method, or technique for doing something.
+}}
+</ref>
+
+In general, a program is only an algorithm if it stops eventually<ref>Stone simply requires that "it must terminate in a finite number of steps" (Stone 1973:7–8).</ref>—even though [[infinite loop#Intentional looping|infinite loop]]s may sometimes prove desirable.
+
+A prototypical example of an algorithm is the [[Euclidean algorithm]], which is used to determine the maximum common divisor of two integers; an example (there are others) is described by the [[flowchart]] above and as an example in a later section.
+
+{{Harvtxt|Boolos|Jeffrey|1974, 1999|ref=CITEREFBoolosJeffrey1999}} offer an informal meaning of the word "algorithm" in the following quotation:
+
+{{blockquote|No human being can write fast enough, or long enough, or small enough† ( †"smaller and smaller without limit ... you'd be trying to write on molecules, on atoms, on electrons") to list all members of an enumerably infinite set by writing out their names, one after another, in some notation. But humans can do something equally useful, in the case of certain enumerably infinite sets: They can give ''explicit instructions for determining the '''n'''th member of the set'', for arbitrary finite ''n''. Such instructions are to be given quite explicitly, in a form in which ''they could be followed by a computing machine'', or by a ''human who is capable of carrying out only very elementary operations on symbols.''<ref>Boolos and Jeffrey 1974,1999:19</ref>}}
+
+An [[recursively enumerable set|"enumerably infinite set"]] is one whose elements can be put into one-to-one correspondence with the integers. Thus Boolos and Jeffrey are saying that an algorithm implies instructions for a process that "creates" output integers from an ''arbitrary'' "input" integer or integers that, in theory, can be arbitrarily large. For example, an algorithm can be an algebraic equation such as ''y = m + n'' (i.e., two arbitrary "input variables" ''m'' and ''n'' that produce an output ''y''), but various authors' attempts to define the notion indicate that the word implies much more than this, something on the order of (for the addition example):
+:Precise instructions (in a language understood by "the computer")<ref>cf Stone 1972:5</ref> for a fast, efficient, "good"<ref>Knuth 1973:7 states: "In practice we not only want algorithms, we want ''good'' algorithms ... one criterion of goodness is the length of time taken to perform the algorithm ... other criteria are the adaptability of the algorithm to computers, its simplicity, and elegance, etc."</ref> process that specifies the "moves" of "the computer" (machine or human, equipped with the necessary internally contained information and capabilities)<ref>cf Stone 1973:6</ref> to find, decode, and then process arbitrary input integers/symbols ''m'' and ''n'', symbols ''+'' and ''='' ... and "effectively"<ref>
+Stone 1973:7–8 states that there must be, "...a procedure that a robot [i.e., computer] can follow in order to determine precisely how to obey the instruction". Stone adds finiteness of the process, and definiteness (having no ambiguity in the instructions) to this definition.
+</ref> produce, in a "reasonable" time,<ref>Knuth, loc. cit</ref> output-integer ''y'' at a specified place and in a specified format.
+
+The concept of ''algorithm'' is also used to define the notion of [[decidability (logic)|decidability]]—a notion that is central for explaining how [[formal system]]s come into being starting from a small set of [[axiom]]s and rules. In [[logic]], the time that an algorithm requires to complete cannot be measured, as it is not apparently related to the customary physical dimension. From such uncertainties, that characterize ongoing work, stems the unavailability of a definition of ''algorithm'' that suits both concrete (in some sense) and abstract usage of the term.
+
+Most algorithms are intended to be [[Implementation|implement]]ed as [[computer programs]]. However, algorithms are also implemented by other means, such as in a [[biological neural network]] (for example, the [[human brain]] implementing [[arithmetic]] or an insect looking for food), in an [[electrical circuit]], or in a mechanical device.
+
+==Formalization==
+<!-- [[Computer program]] links here. -->
+Algorithms are essential to the way computers process data. Many computer programs contain algorithms that detail the specific instructions a computer should perform—in a specific order—to carry out a specified task, such as calculating employees' paychecks or printing students' report cards. Thus, an algorithm can be considered to be any sequence of operations that can be simulated by a [[Turing reduction|Turing-complete]] system. Authors who assert this thesis include Minsky (1967), Savage (1987) and Gurevich (2000):
+{{blockquote| Minsky: "But we will also maintain, with Turing ... that any procedure which could "naturally" be called effective, can, in fact, be realized by a (simple) machine. Although this may seem extreme, the arguments ... in its favor are hard to refute".<ref name="Minsky 1967:105">{{harvnb|Minsky|1967|page=105}}</ref>
+
+ Gurevich: "… Turing's informal argument in favor of his thesis justifies a stronger thesis: every algorithm can be simulated by a Turing machine … according to Savage [1987], an algorithm is a computational process defined by a Turing machine".<ref>Gurevich 2000:1, 3</ref>}}Turing machines can define computational processes that do not terminate. The informal definitions of algorithms generally require that the algorithm always terminates. This requirement renders the task of deciding whether a formal procedure is an algorithm impossible in the general case—due to a major theorem of [[computability theory]] known as the [[halting problem]].
+
+Typically, when an algorithm is associated with processing information, data can be read from an input source, written to an output device and stored for further processing. Stored data are regarded as part of the internal state of the entity performing the algorithm. In practice, the state is stored in one or more [[data structure]]s.
+
+For some of these computational processes, the algorithm must be rigorously defined: specified in the way it applies in all possible circumstances that could arise. This means that any conditional steps must be systematically dealt with, case-by-case; the criteria for each case must be clear (and computable).
+
+Because an algorithm is a precise list of precise steps, the order of computation is always crucial to the functioning of the algorithm. Instructions are usually assumed to be listed explicitly, and are described as starting "from the top" and going "down to the bottom"—an idea that is described more formally by ''[[control flow|flow of control]]''.
+
+So far, the discussion on the formalization of an algorithm has assumed the premises of [[imperative programming]]. This is the most common conception—one which attempts to describe a task in discrete, "mechanical" means. Unique to this conception of formalized algorithms is the [[assignment operation]], which sets the value of a variable. It derives from the intuition of "[[memory]]" as a scratchpad. An example of such an assignment can be found below.
+
+For some alternate conceptions of what constitutes an algorithm, see [[functional programming]] and [[logic programming]].
+
+==Expressing algorithms==
+Algorithms can be expressed in many kinds of notation, including [[natural language]]s, [[pseudocode]], [[flowchart]]s, [[DRAKON|drakon-charts]], [[programming language]]s or [[control table]]s (processed by [[Interpreter (computing)|interpreters]]). Natural language expressions of algorithms tend to be verbose and ambiguous, and are rarely used for complex or technical algorithms. Pseudocode, flowcharts, [[DRAKON|drakon-charts]] and control tables are structured ways to express algorithms that avoid many of the ambiguities common in the statements based on natural language. Programming languages are primarily intended for expressing algorithms in a form that can be executed by a computer, but are also often used as a way to define or document algorithms.
+
+There is a wide variety of representations possible and one can express a given [[Turing machine]] program as a sequence of machine tables (see [[finite-state machine]], [[state transition table]] and [[control table]] for more), as flowcharts and [[DRAKON|drakon-charts]] (see [[state diagram]] for more), or as a form of rudimentary [[machine code]] or [[assembly code]] called "sets of quadruples" (see [[Turing machine]] for more).
+
+Representations of algorithms can be classed into three accepted levels of Turing machine description, as follows:<ref>Sipser 2006:157</ref>
+; 1 High-level description
+: "...prose to describe an algorithm, ignoring the implementation details. At this level, we do not need to mention how the machine manages its tape or head."
+; 2 Implementation description
+: "...prose used to define the way the Turing machine uses its head and the way that it stores data on its tape. At this level, we do not give details of states or transition function."
+; 3 Formal description
+: Most detailed, "lowest level", gives the Turing machine's "state table".
+
+For an example of the simple algorithm "Add m+n" described in all three levels, see [[#Examples|Examples]].
+
+==Design==
+{{See also|Algorithm#By design paradigm}}
+
+Algorithm design refers to a method or a mathematical process for problem-solving and engineering algorithms. The design of algorithms is part of many solution theories of [[operation research]], such as [[dynamic programming]] and [[divide-and-conquer algorithm|divide-and-conquer]]. Techniques for designing and implementing algorithm designs are also called algorithm design patterns,<ref>{{citation|url=http://ww3.algorithmdesign.net/ch00-front.html|title=Algorithm Design: Foundations, Analysis, and Internet Examples|last1=Goodrich|first1=Michael T.|author1-link=Michael T. Goodrich|last2=Tamassia|first2=Roberto|author2-link=Roberto Tamassia|publisher=John Wiley & Sons, Inc.|year=2002|isbn=978-0-471-38365-9|access-date=June 14, 2018|archive-url=https://web.archive.org/web/20150428201622/http://ww3.algorithmdesign.net/ch00-front.html|archive-date=April 28, 2015|url-status=live}}</ref> with examples including the template method pattern and the decorator pattern.
+
+One of the most important aspects of algorithm design is resource (run-time, memory usage) efficiency; the [[big O notation]] is used to describe e.g. an algorithm's run-time growth as the size of its input increases.
+
+Typical steps in the development of algorithms:
+# Problem definition
+# Development of a model
+# Specification of the algorithm
+# Designing an algorithm
+# Checking the [[correctness (computer science)|correctness]] of the algorithm
+# Analysis of algorithm
+# Implementation of algorithm
+# Program testing
+# Documentation preparation{{clarify|reason=These steps are typically used in every day *software* development. In contrast, coming up with a new *algorithm* requires some ingenuity, and often lead(s) to a research article in a computer science journal; it can hardly be broken down into receipt-like steps.|date=December 2020}}
+
+==Computer algorithms==
+[[Image:TTL npn nand.svg|right|thumb|[[Logical NAND]] algorithm implemented electronically in [[7400 series|7400]] chip]]
+[[File:Euclid's algorithm structured blocks 1.png|thumb|Flowchart examples of the canonical [[Structured program theorem|Böhm-Jacopini structures]]: the SEQUENCE (rectangles descending the page), the WHILE-DO and the IF-THEN-ELSE. The three structures are made of the primitive conditional GOTO ({{code|1=IF test THEN GOTO step xxx}}, shown as diamond), the unconditional GOTO (rectangle), various assignment operators (rectangle), and HALT (rectangle). Nesting of these structures inside assignment-blocks result in complex diagrams (cf. Tausworthe 1977:100, 114).]]
+
+''"Elegant" (compact) programs, "good" (fast) programs '': The notion of "simplicity and elegance" appears informally in [[Donald Knuth|Knuth]] and precisely in [[Gregory Chaitin|Chaitin]]:
+:Knuth: " ... we want ''good'' algorithms in some loosely defined aesthetic sense. One criterion ... is the length of time taken to perform the algorithm .... Other criteria are adaptability of the algorithm to computers, its simplicity and elegance, etc."<ref>Knuth 1973:7</ref>
+
+:Chaitin: " ... a program is 'elegant,' by which I mean that it's the smallest possible program for producing the output that it does"<ref>Chaitin 2005:32</ref>
+
+Chaitin prefaces his definition with: "I'll show you can't prove that a program is 'elegant{{'"}}—such a proof would solve the [[Halting problem]] (ibid).
+
+''Algorithm versus function computable by an algorithm'': For a given function multiple algorithms may exist. This is true, even without expanding the available instruction set available to the programmer. Rogers observes that "It is ... important to distinguish between the notion of ''algorithm'', i.e. procedure and the notion of ''function computable by algorithm'', i.e. mapping yielded by procedure. The same function may have several different algorithms".<ref>Rogers 1987:1–2</ref>
+
+Unfortunately, there may be a tradeoff between goodness (speed) and elegance (compactness)—an elegant program may take more steps to complete a computation than one less elegant. An example that uses Euclid's algorithm appears below.
+
+''Computers (and computors), models of computation'': A computer (or human "computor"<ref>In his essay "Calculations by Man and Machine: Conceptual Analysis" Seig 2002:390 credits this distinction to Robin Gandy, cf Wilfred Seig, et al., 2002 ''Reflections on the foundations of mathematics: Essays in honor of Solomon Feferman'', Association for Symbolic Logic, A.K. Peters Ltd, Natick, MA.</ref>) is a restricted type of machine, a "discrete deterministic mechanical device"<ref>cf Gandy 1980:126, Robin Gandy ''Church's Thesis and Principles for Mechanisms'' appearing on pp. 123–148 in [[Jon Barwise|J. Barwise]] et al. 1980 ''The Kleene Symposium'', North-Holland Publishing Company.</ref> that blindly follows its instructions.<ref>A "robot": "A computer is a robot that performs any task that can be described as a sequence of instructions." cf Stone 1972:3</ref> Melzak's and Lambek's primitive models<ref>Lambek's "abacus" is a "countably infinite number of locations (holes, wires etc.) together with an unlimited supply of counters (pebbles, beads, etc.). The locations are distinguishable, the counters are not". The holes have unlimited capacity, and standing by is an agent who understands and is able to carry out the list of instructions" (Lambek 1961:295). Lambek references Melzak who defines his Q-machine as "an indefinitely large number of locations ... an indefinitely large supply of counters distributed among these locations, a program, and an operator whose sole purpose is to carry out the program" (Melzak 1961:283). B-B-J (loc. cit.) add the stipulation that the holes are "capable of holding any number of stones" (p. 46). Both Melzak and Lambek appear in ''The [[Canadian Mathematical Bulletin]]'', vol. 4, no. 3, September 1961.</ref> reduced this notion to four elements: (i) discrete, distinguishable ''locations'', (ii) discrete, indistinguishable ''counters''<ref>If no confusion results, the word "counters" can be dropped, and a location can be said to contain a single "number".</ref> (iii) an agent, and (iv) a list of instructions that are ''effective'' relative to the capability of the agent.<ref>"We say that an instruction is ''effective'' if there is a procedure that the robot can follow in order to determine precisely how to obey the instruction." (Stone 1972:6)</ref>
+
+Minsky describes a more congenial variation of Lambek's "abacus" model in his "Very Simple Bases for [[Computability]]".<ref>cf Minsky 1967: Chapter 11 "Computer models" and Chapter 14 "Very Simple Bases for Computability" pp. 255–281, in particular,</ref> [[Minsky machine|Minsky's machine]] proceeds sequentially through its five (or six, depending on how one counts) instructions unless either a conditional IF-THEN GOTO or an unconditional GOTO changes program flow out of sequence. Besides HALT, Minsky's machine includes three ''assignment'' (replacement, substitution)<ref>cf Knuth 1973:3.</ref> operations: ZERO (e.g. the contents of location replaced by 0: L ← 0), SUCCESSOR (e.g. L ← L+1), and DECREMENT (e.g. L ← L − 1).<ref>But always preceded by IF-THEN to avoid improper subtraction.</ref> Rarely must a programmer write "code" with such a limited instruction set. But Minsky shows (as do Melzak and Lambek) that his machine is [[Turing complete]] with only four general ''types'' of instructions: conditional GOTO, unconditional GOTO, assignment/replacement/substitution, and HALT. However, a few different assignment instructions (e.g. DECREMENT, INCREMENT, and ZERO/CLEAR/EMPTY for a Minsky machine) are also required for Turing-completeness; their exact specification is somewhat up to the designer. The unconditional GOTO is a convenience; it can be constructed by initializing a dedicated location to zero e.g. the instruction " Z ← 0 "; thereafter the instruction IF Z=0 THEN GOTO xxx is unconditional.
+
+''Simulation of an algorithm: computer (computor) language'': Knuth advises the reader that "the best way to learn an algorithm is to try it . . . immediately take pen and paper and work through an example".<ref>Knuth 1973:4</ref> But what about a simulation or execution of the real thing? The programmer must translate the algorithm into a language that the simulator/computer/computor can ''effectively'' execute. Stone gives an example of this: when computing the roots of a quadratic equation the computor must know how to take a square root. If they don't, then the algorithm, to be effective, must provide a set of rules for extracting a square root.<ref>Stone 1972:5. Methods for extracting roots are not trivial: see [[Methods of computing square roots]].</ref>
+
+This means that the programmer must know a "language" that is effective relative to the target computing agent (computer/computor).
+
+But what model should be used for the simulation? Van Emde Boas observes "even if we base [[Computational complexity theory|complexity theory]] on abstract instead of concrete machines, arbitrariness of the choice of a model remains. It is at this point that the notion of ''simulation'' enters".<ref>{{cite book| last = Leeuwen| first = Jan| title = Handbook of Theoretical Computer Science: Algorithms and complexity. Volume A| url = https://books.google.com/books?id=-X39_rA3VSQC| year = 1990| publisher = Elsevier| isbn = 978-0-444-88071-0 | page = 85}}</ref> When speed is being measured, the instruction set matters. For example, the subprogram in Euclid's algorithm to compute the remainder would execute much faster if the programmer had a "[[modular arithmetic|modulus]]" instruction available rather than just subtraction (or worse: just Minsky's "decrement").
+
+''Structured programming, canonical structures'': Per the [[Church–Turing thesis]], any algorithm can be computed by a model known to be [[Turing complete]], and per Minsky's demonstrations, Turing completeness requires only four instruction types—conditional GOTO, unconditional GOTO, assignment, HALT. Kemeny and Kurtz observe that, while "undisciplined" use of unconditional GOTOs and conditional IF-THEN GOTOs can result in "[[spaghetti code]]", a programmer can write structured programs using only these instructions; on the other hand "it is also possible, and not too hard, to write badly structured programs in a structured language".<ref>[[John G. Kemeny]] and [[Thomas E. Kurtz]] 1985 ''Back to Basic: The History, Corruption, and Future of the Language'', Addison-Wesley Publishing Company, Inc. Reading, MA, {{ISBN|0-201-13433-0}}.</ref> Tausworthe augments the three [[Structured program theorem|Böhm-Jacopini canonical structures]]:<ref>Tausworthe 1977:101</ref> SEQUENCE, IF-THEN-ELSE, and WHILE-DO, with two more: DO-WHILE and CASE.<ref>Tausworthe 1977:142</ref> An additional benefit of a structured program is that it lends itself to [[proof of correctness|proofs of correctness]] using [[mathematical induction]].<ref>Knuth 1973 section 1.2.1, expanded by Tausworthe 1977 at pages 100ff and Chapter 9.1</ref>
+
+''Canonical flowchart symbols<ref>cf Tausworthe 1977</ref>'': The graphical aide called a [[flowchart]], offers a way to describe and document an algorithm (and a computer program of one). Like the program flow of a Minsky machine, a flowchart always starts at the top of a page and proceeds down. Its primary symbols are only four: the directed arrow showing program flow, the rectangle (SEQUENCE, GOTO), the diamond (IF-THEN-ELSE), and the dot (OR-tie). The Böhm–Jacopini canonical structures are made of these primitive shapes. Sub-structures can "nest" in rectangles, but only if a single exit occurs from the superstructure. The symbols, and their use to build the canonical structures are shown in the diagram.
+
+==Examples==
+{{further|List of algorithms}}
+
+===Algorithm example===
+One of the simplest algorithms is to find the largest number in a list of numbers of random order. Finding the solution requires looking at every number in the list. From this follows a simple algorithm, which can be stated in a high-level description in English prose, as:
+
+''High-level description:''
+# If there are no numbers in the set then there is no highest number.
+# Assume the first number in the set is the largest number in the set.
+# For each remaining number in the set: if this number is larger than the current largest number, consider this number to be the largest number in the set.
+# When there are no numbers left in the set to iterate over, consider the current largest number to be the largest number of the set.
+
+''(Quasi-)formal description:''
+Written in prose but much closer to the high-level language of a computer program, the following is the more formal coding of the algorithm in [[pseudocode]] or [[pidgin code]]:
+
+{{algorithm-begin|name=LargestNumber}}
+ Input: A list of numbers ''L''.
+ Output: The largest number in the list ''L''.
+
+ '''if''' ''L.size'' = 0 '''return''' null
+ ''largest'' ← ''L''[0]
+ '''for each''' ''item'' '''in''' ''L'', '''do'''
+ '''if''' ''item'' > ''largest'', '''then'''
+ ''largest'' ← ''item''
+ '''return''' ''largest''
+{{algorithm-end}}
+
+===Euclid's algorithm===
+{{further|Euclid's algorithm}}In [[mathematics]], the '''Euclidean algorithm''', or '''Euclid's algorithm''', is an efficient method for computing the [[greatest common divisor]] (GCD) of two integers (numbers), the largest number that divides them both without a [[remainder]]. It is named after the ancient Greek [[mathematician]] [[Euclid]], who first described it in [[Euclid's Elements|his ''Elements'']] ({{circa|300 BC}}).<ref>Heath 1908:300; Hawking's Dover 2005 edition derives from Heath.</ref> It is one of the oldest algorithms in common use. It can be used to reduce [[Fraction (mathematics)|fractions]] to their [[Irreducible fraction|simplest form]], and is a part of many other number-theoretic and cryptographic calculations.
+
+[[File:Euclid's algorithm Book VII Proposition 2 2.png|250px|thumb|left|The example-diagram of Euclid's algorithm from T.L. Heath (1908), with more detail added. Euclid does not go beyond a third measuring and gives no numerical examples. Nicomachus gives the example of 49 and 21: "I subtract the less from the greater; 28 is left; then again I subtract from this the same 21 (for this is possible); 7 is left; I subtract this from 21, 14 is left; from which I again subtract 7 (for this is possible); 7 is left, but 7 cannot be subtracted from 7." Heath comments that "The last phrase is curious, but the meaning of it is obvious enough, as also the meaning of the phrase about ending 'at one and the same number'."(Heath 1908:300).]]
+
+Euclid poses the problem thus: "Given two numbers not prime to one another, to find their greatest common measure". He defines "A number [to be] a multitude composed of units": a counting number, a positive integer not including zero. To "measure" is to place a shorter measuring length ''s'' successively (''q'' times) along longer length ''l'' until the remaining portion ''r'' is less than the shorter length ''s''.<ref>" 'Let CD, measuring BF, leave FA less than itself.' This is a neat abbreviation for saying, measure along BA successive lengths equal to CD until a point F is reached such that the length FA remaining is less than CD; in other words, let BF be the largest exact multiple of CD contained in BA" (Heath 1908:297)</ref> In modern words, remainder ''r'' = ''l'' − ''q''×''s'', ''q'' being the quotient, or remainder ''r'' is the "modulus", the integer-fractional part left over after the division.<ref>For modern treatments using division in the algorithm, see Hardy and Wright 1979:180, Knuth 1973:2 (Volume 1), plus more discussion of Euclid's algorithm in Knuth 1969:293–297 (Volume 2).</ref>
+
+For Euclid's method to succeed, the starting lengths must satisfy two requirements: (i) the lengths must not be zero, AND (ii) the subtraction must be "proper"; i.e., a test must guarantee that the smaller of the two numbers is subtracted from the larger (or the two can be equal so their subtraction yields zero).
+
+Euclid's original proof adds a third requirement: the two lengths must not be prime to one another. Euclid stipulated this so that he could construct a [[reductio ad absurdum]] proof that the two numbers' common measure is in fact the ''greatest''.<ref>Euclid covers this question in his Proposition 1.</ref> While Nicomachus' algorithm is the same as Euclid's, when the numbers are prime to one another, it yields the number "1" for their common measure. So, to be precise, the following is really Nicomachus' algorithm.
+
+[[File:Euclids-algorithm-example-1599-650.gif|350px|thumb|right|A graphical expression of Euclid's algorithm to find the greatest common divisor for 1599 and 650.
+<syntaxhighlight lang="text" highlight="1,5">
+ 1599 = 650×2 + 299
+ 650 = 299×2 + 52
+ 299 = 52×5 + 39
+ 52 = 39×1 + 13
+ 39 = 13×3 + 0</syntaxhighlight>]]
+
+====Computer language for Euclid's algorithm====
+Only a few instruction ''types'' are required to execute Euclid's algorithm—some logical tests (conditional GOTO), unconditional GOTO, assignment (replacement), and subtraction.
+* A ''location'' is symbolized by upper case letter(s), e.g. S, A, etc.
+* The varying quantity (number) in a location is written in lower case letter(s) and (usually) associated with the location's name. For example, location L at the start might contain the number ''l'' = 3009.
+
+====An inelegant program for Euclid's algorithm====
+[[File:Euclid's algorithm Inelegant program 1.png|thumb|163px|right|"Inelegant" is a translation of Knuth's version of the algorithm with a subtraction-based remainder-loop replacing his use of division (or a "modulus" instruction). Derived from Knuth 1973:2–4. Depending on the two numbers "Inelegant" may compute the g.c.d. in fewer steps than "Elegant".]]
+
+The following algorithm is framed as Knuth's four-step version of Euclid's and Nicomachus', but, rather than using division to find the remainder, it uses successive subtractions of the shorter length ''s'' from the remaining length ''r'' until ''r'' is less than ''s''. The high-level description, shown in boldface, is adapted from Knuth 1973:2–4:
+
+'''INPUT''':
+ {{vanchor|1|el1}} [Into two locations L and S put the numbers ''l'' and ''s'' that represent the two lengths]:
+ INPUT L, S
+ {{vanchor|2|el2}} [Initialize R: make the remaining length ''r'' equal to the starting/initial/input length ''l'']:
+ R ← L
+
+'''E0: [Ensure ''r'' ≥ ''s''.]'''
+ {{vanchor|3|el3}} [Ensure the smaller of the two numbers is in S and the larger in R]:
+ IF R > S THEN
+ the contents of L is the larger number so skip over the exchange-steps [[#4|4]], [[#5|5]] and [[#6|6]]:
+ GOTO step [[#7|7]]
+ ELSE
+ swap the contents of R and S.
+ {{vanchor|4|el4}} L ← R (this first step is redundant, but is useful for later discussion).
+ {{vanchor|5|el5}} R ← S
+ {{vanchor|6|el6}} S ← L
+
+'''E1: [Find remainder]''': Until the remaining length ''r'' in R is less than the shorter length ''s'' in S, repeatedly subtract the measuring number ''s'' in S from the remaining length ''r'' in R.
+ {{vanchor|7|el7}} IF S > R THEN
+ done measuring so
+ GOTO [[#10|10]]
+ ELSE
+ measure again,
+ {{vanchor|8|el8}} R ← R − S
+ {{vanchor|9|el9}} [Remainder-loop]:
+ GOTO [[#7|7]].
+
+'''E2: [Is the remainder zero?]''': EITHER (i) the last measure was exact, the remainder in R is zero, and the program can halt, OR (ii) the algorithm must continue: the last measure left a remainder in R less than measuring number in S.
+ {{vanchor|10|el10}} IF R = 0 THEN
+ done so
+ GOTO [[#15|step 15]]
+ ELSE
+ CONTINUE TO [[#11|step 11]],
+
+'''E3: [Interchange ''s'' and ''r'']''': The nut of Euclid's algorithm. Use remainder ''r'' to measure what was previously smaller number ''s''; L serves as a temporary location.
+ {{vanchor|11|el11}} L ← R
+ {{vanchor|12|el12}} R ← S
+ {{vanchor|13|el13}} S ← L
+ {{vanchor|14|el14}} [Repeat the measuring process]:
+ GOTO [[#7|7]]
+
+'''OUTPUT''':
+
+ {{vanchor|15|el15}} [Done. S contains the [[greatest common divisor]]]:
+ PRINT S
+
+'''DONE''':
+ {{vanchor|16|el16}} HALT, END, STOP.
+
+====An elegant program for Euclid's algorithm====
+{{clarify span|The following version of Euclid's algorithm requires only six core instructions to do what thirteen are required to do by "Inelegant"; worse, "Inelegant" requires more ''types'' of instructions.|reason=Contrary to this (unsourced) text, it is general consensus in software engineering that good programming style does not aim at minimizing the number of 'core' (whatever that means) instructions or instruction types. Software engineers during the entire recent 50 years would have ostracized the shown program, if only due to its extensive use of 'goto'. While the program should not be removed here, it could serve as an example of poor programming style, leading to hard-to-understand source code.|date=March 2019}} The flowchart of "Elegant" can be found at the top of this article. In the (unstructured) Basic language, the steps are numbered, and the instruction <syntaxhighlight lang="cbmbas" inline>LET [] = []</syntaxhighlight> is the assignment instruction symbolized by ←.
+<syntaxhighlight lang="cbmbas">
+ 5 REM Euclid's algorithm for greatest common divisor
+ 6 PRINT "Type two integers greater than 0"
+ 10 INPUT A,B
+ 20 IF B=0 THEN GOTO 80
+ 30 IF A > B THEN GOTO 60
+ 40 LET B=B-A
+ 50 GOTO 20
+ 60 LET A=A-B
+ 70 GOTO 20
+ 80 PRINT A
+ 90 END
+</syntaxhighlight>
+''How "Elegant" works'': In place of an outer "Euclid loop", "Elegant" shifts back and forth between two "co-loops", an A > B loop that computes A ← A − B, and a B ≤ A loop that computes B ← B − A. This works because, when at last the minuend M is less than or equal to the subtrahend S (Difference = Minuend − Subtrahend), the minuend can become ''s'' (the new measuring length) and the subtrahend can become the new ''r'' (the length to be measured); in other words the "sense" of the subtraction reverses.
+
+The following version can be used with [[List of C-family programming languages|programming languages from the C-family]]:
+<syntaxhighlight lang="java">
+// Euclid's algorithm for greatest common divisor
+int euclidAlgorithm (int A, int B){
+ A=abs(A);
+ B=abs(B);
+ while (B!=0){
+ while (A>B) A=A-B;
+ B=B-A;
+ }
+ return A;
+}
+</syntaxhighlight>
+
+===Testing the Euclid algorithms===
+Does an algorithm do what its author wants it to do? A few test cases usually give some confidence in the core functionality. But tests are not enough. For test cases, one source<ref>{{cite web |url=http://aleph0.clarku.edu/~djoyce/java/elements/bookVII/propVII2.html |title=Euclid's Elements, Book VII, Proposition 2 |publisher=Aleph0.clarku.edu |access-date=May 20, 2012 |archive-url=https://web.archive.org/web/20120524074919/http://aleph0.clarku.edu/~djoyce/java/elements/bookVII/propVII2.html |archive-date=May 24, 2012 |url-status=live }}</ref> uses 3009 and 884. Knuth suggested 40902, 24140. Another interesting case is the two [[relatively prime]] numbers 14157 and 5950.
+
+But "exceptional cases"<ref>While this notion is in widespread use, it cannot be defined precisely.</ref> must be identified and tested. Will "Inelegant" perform properly when R > S, S > R, R = S? Ditto for "Elegant": B > A, A > B, A = B? (Yes to all). What happens when one number is zero, both numbers are zero? ("Inelegant" computes forever in all cases; "Elegant" computes forever when A = 0.) What happens if ''negative'' numbers are entered? Fractional numbers? If the input numbers, i.e. the [[domain of a function|domain of the function]] computed by the algorithm/program, is to include only positive integers including zero, then the failures at zero indicate that the algorithm (and the program that [[instance (computer science)|instantiates]] it) is a [[partial function]] rather than a [[total function]]. A notable failure due to exceptions is the [[Ariane 5 Flight 501]] rocket failure (June 4, 1996).
+
+''Proof of program correctness by use of mathematical induction'': Knuth demonstrates the application of [[mathematical induction]] to an "extended" version of Euclid's algorithm, and he proposes "a general method applicable to proving the validity of any algorithm".<ref>Knuth 1973:13–18. He credits "the formulation of algorithm-proving in terms of assertions and induction" to R W. Floyd, Peter Naur, C.A.R. Hoare, H.H. Goldstine and J. von Neumann. Tausworth 1977 borrows Knuth's Euclid example and extends Knuth's method in section 9.1 ''Formal Proofs'' (pp. 288–298).</ref> Tausworthe proposes that a measure of the complexity of a program be the length of its correctness proof.<ref>Tausworthe 1997:294</ref>
+
+===Measuring and improving the Euclid algorithms===
+''Elegance (compactness) versus goodness (speed)'': With only six core instructions, "Elegant" is the clear winner, compared to "Inelegant" at thirteen instructions. However, "Inelegant" is ''faster'' (it arrives at HALT in fewer steps). [[Algorithm analysis]]<ref>cf Knuth 1973:7 (Vol. I), and his more-detailed analyses on pp. 1969:294–313 (Vol II).</ref> indicates why this is the case: "Elegant" does ''two'' conditional tests in every subtraction loop, whereas "Inelegant" only does one. As the algorithm (usually) requires many loop-throughs, ''on average'' much time is wasted doing a "B = 0?" test that is needed only after the remainder is computed.
+
+''Can the algorithms be improved?'': Once the programmer judges a program "fit" and "effective"—that is, it computes the function intended by its author—then the question becomes, can it be improved?
+
+The compactness of "Inelegant" can be improved by the elimination of five steps. But Chaitin proved that compacting an algorithm cannot be automated by a generalized algorithm;<ref>Breakdown occurs when an algorithm tries to compact itself. Success would solve the [[Halting problem]].</ref> rather, it can only be done [[heuristic]]ally; i.e., by exhaustive search (examples to be found at [[Busy beaver]]), trial and error, cleverness, insight, application of [[inductive reasoning]], etc. Observe that steps 4, 5 and 6 are repeated in steps 11, 12 and 13. Comparison with "Elegant" provides a hint that these steps, together with steps 2 and 3, can be eliminated. This reduces the number of core instructions from thirteen to eight, which makes it "more elegant" than "Elegant", at nine steps.
+
+The speed of "Elegant" can be improved by moving the "B=0?" test outside of the two subtraction loops. This change calls for the addition of three instructions (B = 0?, A = 0?, GOTO). Now "Elegant" computes the example-numbers faster; whether this is always the case for any given A, B, and R, S would require a detailed analysis.
+
+==Algorithmic analysis==
+{{Main|Analysis of algorithms}}
+It is frequently important to know how much of a particular resource (such as time or storage) is theoretically required for a given algorithm. Methods have been developed for the [[analysis of algorithms]] to obtain such quantitative answers (estimates); for example, an algorithm which adds up the elements of a list of ''n'' numbers would have a time requirement of ''O(n)'', using [[big O notation]]. At all times the algorithm only needs to remember two values: the sum of all the elements so far, and its current position in the input list. Therefore, it is said to have a space requirement of ''O(1)'', if the space required to store the input numbers is not counted, or ''O(n)'' if it is counted.
+
+Different algorithms may complete the same task with a different set of instructions in less or more time, space, or '[[algorithmic efficiency|effort]]' than others. For example, a [[binary search]] algorithm (with cost ''O(log n)'') outperforms a sequential search (cost ''O(n)'' ) when used for [[lookup table|table lookups]] on sorted lists or arrays.
+
+===Formal versus empirical===
+{{Main|Empirical algorithmics|Profiling (computer programming)|Program optimization}}
+The [[analysis of algorithms|analysis, and study of algorithms]] is a discipline of [[computer science]], and is often practiced abstractly without the use of a specific [[programming language]] or implementation. In this sense, algorithm analysis resembles other mathematical disciplines in that it focuses on the underlying properties of the algorithm and not on the specifics of any particular implementation. Usually [[pseudocode]] is used for analysis as it is the simplest and most general representation. However, ultimately, most algorithms are usually implemented on particular hardware/software platforms and their [[algorithmic efficiency]] is eventually put to the test using real code. For the solution of a "one off" problem, the efficiency of a particular algorithm may not have significant consequences (unless n is extremely large) but for algorithms designed for fast interactive, commercial or long life scientific usage it may be critical. Scaling from small n to large n frequently exposes inefficient algorithms that are otherwise benign.
+
+Empirical testing is useful because it may uncover unexpected interactions that affect performance. [[Benchmark (computing)|Benchmarks]] may be used to compare before/after potential improvements to an algorithm after program optimization.
+Empirical tests cannot replace formal analysis, though, and are not trivial to perform in a fair manner.<ref name="KriegelSchubert2016">{{cite journal|last1=Kriegel|first1=Hans-Peter|author-link=Hans-Peter Kriegel|last2=Schubert|first2=Erich|last3=Zimek|first3=Arthur|author-link3=Arthur Zimek|title=The (black) art of run-time evaluation: Are we comparing algorithms or implementations?|journal=Knowledge and Information Systems|volume=52|issue=2|year=2016|pages=341–378|issn=0219-1377|doi=10.1007/s10115-016-1004-2|s2cid=40772241}}</ref>
+
+=== Execution efficiency ===
+{{Main|Algorithmic efficiency}}
+To illustrate the potential improvements possible even in well-established algorithms, a recent significant innovation, relating to [[Fast Fourier transform|FFT]] algorithms (used heavily in the field of image processing), can decrease processing time up to 1,000 times for applications like medical imaging.<ref>{{cite web| title=Better Math Makes Faster Data Networks| author=Gillian Conahan| date=January 2013| url=http://discovermagazine.com/2013/jan-feb/34-better-math-makes-faster-data-networks| publisher=discovermagazine.com| access-date=May 13, 2014| archive-url=https://web.archive.org/web/20140513212427/http://discovermagazine.com/2013/jan-feb/34-better-math-makes-faster-data-networks| archive-date=May 13, 2014| url-status=live}}</ref> In general, speed improvements depend on special properties of the problem, which are very common in practical applications.<ref name="Hassanieh12">Haitham Hassanieh, [[Piotr Indyk]], Dina Katabi, and Eric Price, "[http://siam.omnibooksonline.com/2012SODA/data/papers/500.pdf ACM-SIAM Symposium On Discrete Algorithms (SODA)] {{webarchive|url=https://web.archive.org/web/20130704180806/http://siam.omnibooksonline.com/2012SODA/data/papers/500.pdf |date=July 4, 2013 }}, Kyoto, January 2012. See also the [http://groups.csail.mit.edu/netmit/sFFT/ sFFT Web Page] {{Webarchive|url=https://web.archive.org/web/20120221145740/http://groups.csail.mit.edu/netmit/sFFT/ |date=February 21, 2012 }}.</ref> Speedups of this magnitude enable computing devices that make extensive use of image processing (like digital cameras and medical equipment) to consume less power.
+
+== Classification ==
+There are various ways to classify algorithms, each with its own merits.
+
+=== By implementation ===
+One way to classify algorithms is by implementation means.
+
+{| style="float:right; width:200pt;"
+|-
+|
+<syntaxhighlight lang="C">
+int gcd(int A, int B) {
+ if (B == 0)
+ return A;
+ else if (A > B)
+ return gcd(A-B,B);
+ else
+ return gcd(A,B-A);
+}
+</syntaxhighlight>
+|-
+| Recursive [[C (programming language)|C]] implementation of Euclid's algorithm from the [[#lead|above]] flowchart
+|}
+
+; Recursion
+: A [[recursive algorithm]] is one that invokes (makes reference to) itself repeatedly until a certain condition (also known as termination condition) matches, which is a method common to [[functional programming]]. [[Iteration|Iterative]] algorithms use repetitive constructs like [[Program loops|loops]] and sometimes additional data structures like [[Stack (data structure)|stacks]] to solve the given problems. Some problems are naturally suited for one implementation or the other. For example, [[towers of Hanoi]] is well understood using recursive implementation. Every recursive version has an equivalent (but possibly more or less complex) iterative version, and vice versa.
+; Logical
+: An algorithm may be viewed as controlled [[Deductive reasoning|logical deduction]]. This notion may be expressed as: ''Algorithm = logic + control''.<ref>Kowalski 1979</ref> The logic component expresses the axioms that may be used in the computation and the control component determines the way in which deduction is applied to the axioms. This is the basis for the [[logic programming]] paradigm. In pure logic programming languages, the control component is fixed and algorithms are specified by supplying only the logic component. The appeal of this approach is the elegant [[Formal semantics of programming languages|semantics]]: a change in the axioms produces a well-defined change in the algorithm.
+; Serial, parallel or distributed
+: Algorithms are usually discussed with the assumption that computers execute one instruction of an algorithm at a time. Those computers are sometimes called serial computers. An [[algorithm design]]ed for such an environment is called a serial algorithm, as opposed to [[parallel algorithm]]s or [[distributed algorithms]]. Parallel algorithms take advantage of computer architectures where several processors can work on a problem at the same time, whereas distributed algorithms utilize multiple machines connected with a [[computer network]]. Parallel or distributed algorithms divide the problem into more symmetrical or asymmetrical subproblems and collect the results back together. The resource consumption in such algorithms is not only processor cycles on each processor but also the communication overhead between the processors. Some sorting algorithms can be parallelized efficiently, but their communication overhead is expensive. Iterative algorithms are generally parallelizable. Some problems have no parallel algorithms and are called inherently serial problems.
+; Deterministic or non-deterministic
+: [[Deterministic algorithm]]s solve the problem with exact decision at every step of the algorithm whereas [[non-deterministic algorithm]]s solve problems via guessing although typical guesses are made more accurate through the use of [[heuristics]].
+; Exact or approximate
+: While many algorithms reach an exact solution, [[approximation algorithm]]s seek an approximation that is closer to the true solution. The approximation can be reached by either using a deterministic or a random strategy. Such algorithms have practical value for many hard problems. One of the examples of an approximate algorithm is the [[Knapsack problem]], where there is a set of given items. Its goal is to pack the knapsack to get the maximum total value. Each item has some weight and some value. Total weight that can be carried is no more than some fixed number X. So, the solution must consider weights of items as well as their value.<ref>{{Cite book|url=https://www.springer.com/us/book/9783540402862|title=Knapsack Problems {{!}} Hans Kellerer {{!}} Springer|language=en|isbn=978-3-540-40286-2|publisher=Springer|year=2004|doi=10.1007/978-3-540-24777-7|access-date=September 19, 2017|archive-url=https://web.archive.org/web/20171018181055/https://www.springer.com/us/book/9783540402862|archive-date=October 18, 2017|url-status=live|last1=Kellerer|first1=Hans|last2=Pferschy|first2=Ulrich|last3=Pisinger|first3=David|s2cid=28836720 }}</ref>
+; [[Quantum algorithm]]
+: They run on a realistic model of [[quantum computation]]. The term is usually used for those algorithms which seem inherently quantum, or use some essential feature of [[Quantum computing]] such as [[quantum superposition]] or [[quantum entanglement]].
+
+=== By design paradigm ===
+Another way of classifying algorithms is by their design methodology or [[algorithmic paradigm|paradigm]]. There is a certain number of paradigms, each different from the other. Furthermore, each of these categories includes many different types of algorithms. Some common paradigms are:
+
+; [[Brute-force search|Brute-force]] or exhaustive search
+: This is the [[Naïve algorithm|naive method]] of trying every possible solution to see which is best.<ref>{{cite book| last1 = Carroll| first1 = Sue| last2 = Daughtrey| first2 = Taz| title = Fundamental Concepts for the Software Quality Engineer| url = https://books.google.com/books?id=bz_cl3B05IcC&pg=PA282| date = July 4, 2007| publisher = American Society for Quality| isbn = 978-0-87389-720-4| pages = 282 et seq }}</ref>
+; Divide and conquer
+: A [[divide-and-conquer algorithm]] repeatedly reduces an instance of a problem to one or more smaller instances of the same problem (usually [[recursion|recursively]]) until the instances are small enough to solve easily. One such example of divide and conquer is [[mergesort|merge sorting]]. Sorting can be done on each segment of data after dividing data into segments and sorting of entire data can be obtained in the conquer phase by merging the segments. A simpler variant of divide and conquer is called a ''decrease-and-conquer algorithm'', which solves an identical subproblem and uses the solution of this subproblem to solve the bigger problem. Divide and conquer divides the problem into multiple subproblems and so the conquer stage is more complex than decrease and conquer algorithms. An example of a decrease and conquer algorithm is the [[binary search algorithm]].
+; Search and enumeration
+: Many problems (such as playing [[chess]]) can be modeled as problems on [[graph theory|graphs]]. A [[graph exploration algorithm]] specifies rules for moving around a graph and is useful for such problems. This category also includes [[search algorithm]]s, [[branch and bound]] enumeration and [[backtracking]].
+;[[Randomized algorithm]]
+: Such algorithms make some choices randomly (or pseudo-randomly). They can be very useful in finding approximate solutions for problems where finding exact solutions can be impractical (see heuristic method below). For some of these problems, it is known that the fastest approximations must involve some [[randomness]].<ref>For instance, the [[volume]] of a [[convex polytope]] (described using a membership oracle) can be approximated to high accuracy by a randomized polynomial time algorithm, but not by a deterministic one: see {{citation
+ | last1 = Dyer | first1 = Martin
+ | last2 = Frieze | first2 = Alan
+ | last3 = Kannan | first3 = Ravi
+ | date = January 1991
+ | doi = 10.1145/102782.102783
+ | issue = 1
+ | journal = J. ACM
+ | pages = 1–17
+ | title = A Random Polynomial-time Algorithm for Approximating the Volume of Convex Bodies
+ | volume = 38| citeseerx = 10.1.1.145.4600| s2cid = 13268711
+ }}.</ref> Whether randomized algorithms with [[P (complexity)|polynomial time complexity]] can be the fastest algorithms for some problems is an open question known as the [[P versus NP problem]]. There are two large classes of such algorithms:
+# [[Monte Carlo algorithm]]s return a correct answer with high-probability. E.g. [[RP (complexity)|RP]] is the subclass of these that run in [[polynomial time]].
+# [[Las Vegas algorithm]]s always return the correct answer, but their running time is only probabilistically bound, e.g. [[Zero-error Probabilistic Polynomial time|ZPP]].
+; [[Reduction (complexity)|Reduction of complexity]]
+: This technique involves solving a difficult problem by transforming it into a better-known problem for which we have (hopefully) [[asymptotically optimal]] algorithms. The goal is to find a reducing algorithm whose [[Computational complexity theory|complexity]] is not dominated by the resulting reduced algorithm's. For example, one [[selection algorithm]] for finding the median in an unsorted list involves first sorting the list (the expensive portion) and then pulling out the middle element in the sorted list (the cheap portion). This technique is also known as ''[[Transform and conquer algorithm|transform and conquer]]''.
+; [[Back tracking]]
+: In this approach, multiple solutions are built incrementally and abandoned when it is determined that they cannot lead to a valid full solution.
+
+=== Optimization problems ===
+For [[optimization problem]]s there is a more specific classification of algorithms; an algorithm for such problems may fall into one or more of the general categories described above as well as into one of the following:
+
+; [[Linear programming]]
+: When searching for optimal solutions to a linear function bound to linear equality and inequality constraints, the constraints of the problem can be used directly in producing the optimal solutions. There are algorithms that can solve any problem in this category, such as the popular [[simplex algorithm]].<ref>
+[[George B. Dantzig]] and Mukund N. Thapa. 2003. ''Linear Programming 2: Theory and Extensions''. Springer-Verlag.</ref> Problems that can be solved with linear programming include the [[maximum flow problem]] for directed graphs. If a problem additionally requires that one or more of the unknowns must be an [[integer]] then it is classified in [[integer programming]]. A linear programming algorithm can solve such a problem if it can be proved that all restrictions for integer values are superficial, i.e., the solutions satisfy these restrictions anyway. In the general case, a specialized algorithm or an algorithm that finds approximate solutions is used, depending on the difficulty of the problem.
+; [[Dynamic programming]]
+: When a problem shows [[optimal substructure]]s—meaning the optimal solution to a problem can be constructed from optimal solutions to subproblems—and [[overlapping subproblems]], meaning the same subproblems are used to solve many different problem instances, a quicker approach called ''dynamic programming'' avoids recomputing solutions that have already been computed. For example, [[Floyd–Warshall algorithm]], the shortest path to a goal from a vertex in a weighted [[graph (discrete mathematics)|graph]] can be found by using the shortest path to the goal from all adjacent vertices. Dynamic programming and [[memoization]] go together. The main difference between dynamic programming and divide and conquer is that subproblems are more or less independent in divide and conquer, whereas subproblems overlap in dynamic programming. The difference between dynamic programming and straightforward recursion is in caching or memoization of recursive calls. When subproblems are independent and there is no repetition, memoization does not help; hence dynamic programming is not a solution for all complex problems. By using memoization or maintaining a [[Mathematical table|table]] of subproblems already solved, dynamic programming reduces the exponential nature of many problems to polynomial complexity.
+; The greedy method
+: A [[greedy algorithm]] is similar to a dynamic programming algorithm in that it works by examining substructures, in this case not of the problem but of a given solution. Such algorithms start with some solution, which may be given or have been constructed in some way, and improve it by making small modifications. For some problems they can find the optimal solution while for others they stop at [[local optimum|local optima]], that is, at solutions that cannot be improved by the algorithm but are not optimum. The most popular use of greedy algorithms is for finding the minimal spanning tree where finding the optimal solution is possible with this method. [[Huffman coding|Huffman Tree]], [[kruskal's algorithm|Kruskal]], [[Prim's algorithm|Prim]], [[Sollin's algorithm|Sollin]] are greedy algorithms that can solve this optimization problem.
+;The heuristic method
+:In [[optimization problem]]s, [[heuristic algorithm]]s can be used to find a solution close to the optimal solution in cases where finding the optimal solution is impractical. These algorithms work by getting closer and closer to the optimal solution as they progress. In principle, if run for an infinite amount of time, they will find the optimal solution. Their merit is that they can find a solution very close to the optimal solution in a relatively short time. Such algorithms include [[local search (optimization)|local search]], [[tabu search]], [[simulated annealing]], and [[genetic algorithm]]s. Some of them, like simulated annealing, are non-deterministic algorithms while others, like tabu search, are deterministic. When a bound on the error of the non-optimal solution is known, the algorithm is further categorized as an [[approximation algorithm]].
+
+=== By field of study ===
+{{See also|List of algorithms}}
+Every field of science has its own problems and needs efficient algorithms. Related problems in one field are often studied together. Some example classes are [[search algorithm]]s, [[sorting algorithm]]s, [[merge algorithm]]s, [[numerical analysis|numerical algorithms]], [[graph theory|graph algorithms]], [[string algorithms]], [[computational geometry|computational geometric algorithms]], [[combinatorial|combinatorial algorithms]], [[medical algorithm]]s, [[machine learning]], [[cryptography]], [[data compression]] algorithms and [[parsing|parsing techniques]].
+
+Fields tend to overlap with each other, and algorithm advances in one field may improve those of other, sometimes completely unrelated, fields. For example, dynamic programming was invented for optimization of resource consumption in industry but is now used in solving a broad range of problems in many fields.
+
+=== By complexity ===
+{{See also|Complexity class| Parameterized complexity}}
+Algorithms can be classified by the amount of time they need to complete compared to their input size:
+* Constant time: if the time needed by the algorithm is the same, regardless of the input size. E.g. an access to an [[Array data structure|array]] element.
+* Logarithmic time: if the time is a logarithmic function of the input size. E.g. [[binary search algorithm]].
+* Linear time: if the time is proportional to the input size. E.g. the traverse of a list.
+* Polynomial time: if the time is a power of the input size. E.g. the [[bubble sort]] algorithm has quadratic time complexity.
+* Exponential time: if the time is an exponential function of the input size. E.g. [[Brute-force search]].
+
+Some problems may have multiple algorithms of differing complexity, while other problems might have no algorithms or no known efficient algorithms. There are also mappings from some problems to other problems. Owing to this, it was found to be more suitable to classify the problems themselves instead of the algorithms into equivalence classes based on the complexity of the best possible algorithms for them.
+
+=== Continuous algorithms ===
+The adjective "continuous" when applied to the word "algorithm" can mean:
+* An algorithm operating on data that represents continuous quantities, even though this data is represented by discrete approximations—such algorithms are studied in [[numerical analysis]]; or
+* An algorithm in the form of a [[differential equation]] that operates continuously on the data, running on an [[analog computer]].<ref>{{cite book| author = Tsypkin| title = Adaptation and learning in automatic systems| url = https://books.google.com/books?id=sgDHJlafMskC&pg=PA54| year = 1971| publisher = Academic Press| isbn = 978-0-08-095582-7| page = 54 }}</ref>
+
+== Legal issues ==
+{{see also|Software patent}}
+
+Algorithms, by themselves, are not usually patentable. In the United States, a claim consisting solely of simple manipulations of abstract concepts, numbers, or signals does not constitute "processes" (USPTO 2006), and hence algorithms are not patentable (as in [[Gottschalk v. Benson]]). However practical applications of algorithms are sometimes patentable. For example, in [[Diamond v. Diehr]], the application of a simple [[feedback]] algorithm to aid in the curing of [[synthetic rubber]] was deemed patentable. The [[Software patent debate|patenting of software]] is highly controversial, and there are highly criticized patents involving algorithms, especially [[data compression]] algorithms, such as [[Unisys]]' [[Graphics Interchange Format#Unisys and LZW patent enforcement|LZW patent]].
+
+Additionally, some cryptographic algorithms have export restrictions (see [[export of cryptography]]).
+
+== History: Development of the notion of "algorithm" ==
+=== Ancient Near East ===
+The earliest evidence of algorithms is found in the [[Babylonian mathematics]] of ancient [[Mesopotamia]] (modern Iraq). A [[Sumer]]ian clay tablet found in [[Shuruppak]] near [[Baghdad]] and dated to circa 2500 BC described the earliest [[division algorithm]].<ref name="Springer Science & Business Media">{{cite book |last1=Chabert |first1=Jean-Luc |title=A History of Algorithms: From the Pebble to the Microchip |date=2012 |publisher=Springer Science & Business Media |isbn=9783642181924 |pages=7–8}}</ref> During the [[First Babylonian dynasty|Hammurabi dynasty]] circa 1800-1600 BC, [[Babylonia]]n clay tablets described algorithms for computing [[formulas]].<ref>{{cite journal |last1=Knuth |first1=Donald E. |title=Ancient Babylonian Algorithms |journal=Commun. ACM |date=1972 |volume=15 |issue=7 |pages=671–677 |doi=10.1145/361454.361514 |s2cid=7829945 |url=http://steiner.math.nthu.edu.tw/disk5/js/computer/1.pdf |archive-url=https://web.archive.org/web/20121224100137/http://steiner.math.nthu.edu.tw/disk5/js/computer/1.pdf |url-status=dead |archive-date=2012-12-24 |issn=0001-0782}}</ref> Algorithms were also used in [[Babylonian astronomy]]. Babylonian clay tablets describe and employ algorithmic procedures to compute the time and place of significant astronomical events.<ref>{{Citation | last = Aaboe | first = Asger | author-link = Asger Aaboe | date = 2001 | title = Episodes from the Early History of Astronomy | publisher = Springer | place = New York | pages = 40–62 | isbn = 978-0-387-95136-2 }}</ref>
+
+Algorithms for arithmetic are also found in ancient [[Egyptian mathematics]], dating back to the [[Rhind Mathematical Papyrus]] circa 1550 BC.<ref name="Springer Science & Business Media"/> Algorithms were later used in ancient [[Hellenistic mathematics]]. Two examples are the [[Sieve of Eratosthenes]], which was described in the ''[[Introduction to Arithmetic]]'' by [[Nicomachus]],<ref>{{cite web|url=http://www.math.wichita.edu/history/men/eratosthenes.html|title=Eratosthenes|publisher=Wichita State University: Department of Mathematics and Statistics|first=Courtney|last=Ast|access-date=February 27, 2015|archive-url=https://web.archive.org/web/20150227150653/http://www.math.wichita.edu/history/men/eratosthenes.html|archive-date=February 27, 2015|url-status=live}}</ref><ref name=Cooke2005/>{{rp|Ch 9.2}} and the [[Euclidean algorithm]], which was first described in ''[[Euclid's Elements]]'' ({{circa|300 BC}}).<ref name=Cooke2005/>{{rp|Ch 9.1}}
+
+=== Discrete and distinguishable symbols ===
+Tally-marks: To keep track of their flocks, their sacks of grain and their money the ancients used tallying: accumulating stones or marks scratched on sticks or making discrete symbols in clay. Through the Babylonian and Egyptian use of marks and symbols, eventually [[Roman numerals]] and the [[abacus]] evolved (Dilson, p.&nbsp;16–41). Tally marks appear prominently in [[unary numeral system]] arithmetic used in [[Turing machine]] and [[Post–Turing machine]] computations.
+
+=== Manipulation of symbols as "place holders" for numbers: algebra ===
+[[Muhammad ibn Mūsā al-Khwārizmī]], a [[Mathematics in medieval Islam|Persian mathematician]], wrote the ''[[Al-jabr]]'' in the 9th century. The terms "[[algorism]]" and "algorithm" are derived from the name al-Khwārizmī, while the term "[[algebra]]" is derived from the book ''Al-jabr''. In Europe, the word "algorithm" was originally used to refer to the sets of rules and techniques used by Al-Khwarizmi to solve algebraic equations, before later being generalized to refer to any set of rules or techniques.<ref>{{cite book |last1=Chabert |first1=Jean-Luc |title=A History of Algorithms: From the Pebble to the Microchip |date=2012 |publisher=Springer Science & Business Media |isbn=9783642181924 |page=2}}</ref> This eventually culminated in [[Gottfried Leibniz|Leibniz]]'s notion of the [[calculus ratiocinator]] ({{circa|1680}}):
+
+{{blockquote|A good century and a half ahead of his time, Leibniz proposed an algebra of logic, an algebra that would specify the rules for manipulating logical concepts in the manner that ordinary algebra specifies the rules for manipulating numbers.<ref>Davis 2000:18</ref>}}
+
+=== Cryptographic algorithms ===
+The first [[cryptographic]] algorithm for deciphering encrypted code was developed by [[Al-Kindi]], a 9th-century [[Mathematics in medieval Islam|Arab mathematician]], in ''A Manuscript On Deciphering Cryptographic Messages''. He gave the first description of [[cryptanalysis]] by [[frequency analysis]], the earliest [[codebreaking]] algorithm.<ref name="Dooley">{{cite book |last1=Dooley |first1=John F. |title=A Brief History of Cryptology and Cryptographic Algorithms |date=2013 |publisher=Springer Science & Business Media |isbn=9783319016283 |pages=12–3}}</ref>
+
+=== Mechanical contrivances with discrete states ===
+''The clock'': Bolter credits the invention of the weight-driven [[clock]] as "The key invention [of Europe in the Middle Ages]", in particular, the [[verge escapement]]<ref>Bolter 1984:24</ref> that provides us with the tick and tock of a mechanical clock. "The accurate automatic machine"<ref>Bolter 1984:26</ref> led immediately to "mechanical [[automata theory|automata]]" beginning in the 13th century and finally to "computational machines"—the [[difference engine]] and [[analytical engine]]s of [[Charles Babbage]] and Countess [[Ada Lovelace]], mid-19th century.<ref>Bolter 1984:33–34, 204–206.</ref> Lovelace is credited with the first creation of an algorithm intended for processing on a computer—Babbage's analytical engine, the first device considered a real [[Turing-complete]] computer instead of just a [[calculator]]—and is sometimes called "history's first programmer" as a result, though a full implementation of Babbage's second device would not be realized until decades after her lifetime.
+
+''Logical machines 1870 – [[Stanley Jevons]]' "logical abacus" and "logical machine"'': The technical problem was to reduce [[Boolean equation]]s when presented in a form similar to what is now known as [[Karnaugh map]]s. Jevons (1880) describes first a simple "abacus" of "slips of wood furnished with pins, contrived so that any part or class of the [logical] combinations can be picked out mechanically ... More recently, however, I have reduced the system to a completely mechanical form, and have thus embodied the whole of the indirect process of inference in what may be called a ''Logical Machine''" His machine came equipped with "certain moveable wooden rods" and "at the foot are 21 keys like those of a piano [etc.] ...". With this machine he could analyze a "[[syllogism]] or any other simple logical argument".<ref>All quotes from W. Stanley Jevons 1880 ''Elementary Lessons in Logic: Deductive and Inductive'', Macmillan and Co., London and New York. Republished as a googlebook; cf Jevons 1880:199–201. Louis Couturat 1914 ''the Algebra of Logic'', The Open Court Publishing Company, Chicago and London. Republished as a googlebook; cf Couturat 1914:75–76 gives a few more details; he compares this to a typewriter as well as a piano. Jevons states that the account is to be found at January 20, 1870 ''The Proceedings of the Royal Society''.</ref>
+
+This machine he displayed in 1870 before the Fellows of the Royal Society.<ref>Jevons 1880:199–200</ref> Another logician [[John Venn]], however, in his 1881 ''Symbolic Logic'', turned a jaundiced eye to this effort: "I have no high estimate myself of the interest or importance of what are sometimes called logical machines ... it does not seem to me that any contrivances at present known or likely to be discovered really deserve the name of logical machines"; see more at [[Algorithm characterizations]]. But not to be outdone he too presented "a plan somewhat analogous, I apprehend, to Prof. Jevon's ''abacus'' ... [And] [a]gain, corresponding to Prof. Jevons's logical machine, the following contrivance may be described. I prefer to call it merely a logical-diagram machine ... but I suppose that it could do very completely all that can be rationally expected of any logical machine".<ref>All quotes from John Venn 1881 ''Symbolic Logic'', Macmillan and Co., London. Republished as a googlebook. cf Venn 1881:120–125. The interested reader can find a deeper explanation in those pages.</ref>
+
+''Jacquard loom, Hollerith punch cards, telegraphy and telephony – the electromechanical relay'': Bell and Newell (1971) indicate that the [[Jacquard loom]] (1801), precursor to [[Hollerith cards]] (punch cards, 1887), and "telephone switching technologies" were the roots of a tree leading to the development of the first computers.<ref>Bell and Newell diagram 1971:39, cf. Davis 2000</ref> By the mid-19th century the [[telegraph]], the precursor of the telephone, was in use throughout the world, its discrete and distinguishable encoding of letters as "dots and dashes" a common sound. By the late 19th century the [[ticker tape]] ({{circa|1870s}}) was in use, as was the use of Hollerith cards in the 1890 U.S. census. Then came the [[teleprinter]] ({{circa|1910}}) with its punched-paper use of [[Baudot code]] on tape.
+
+''Telephone-switching networks'' of electromechanical [[relay]]s (invented 1835) was behind the work of [[George Stibitz]] (1937), the inventor of the digital adding device. As he worked in Bell Laboratories, he observed the "burdensome' use of mechanical calculators with gears. "He went home one evening in 1937 intending to test his idea... When the tinkering was over, Stibitz had constructed a binary adding device".<ref>* Melina Hill, Valley News Correspondent, ''A Tinkerer Gets a Place in History'', Valley News West Lebanon NH, Thursday, March 31, 1983, p. 13.</ref>
+
+The mathematician [[Martin Davis (mathematician)|Martin Davis]] observes the particular importance of the electromechanical relay (with its two "binary states" ''open'' and ''closed''):
+: It was only with the development, beginning in the 1930s, of electromechanical calculators using electrical relays, that machines were built having the scope Babbage had envisioned."<ref>Davis 2000:14</ref>
+
+=== Mathematics during the 19th century up to the mid-20th century ===
+''Symbols and rules'': In rapid succession, the mathematics of [[George Boole]] (1847, 1854), [[Gottlob Frege]] (1879), and [[Giuseppe Peano]] (1888–1889) reduced arithmetic to a sequence of symbols manipulated by rules. Peano's ''The principles of arithmetic, presented by a new method'' (1888) was "the first attempt at an axiomatization of mathematics in a [[Symbolic language (programming)|symbolic language]]".<ref>van Heijenoort 1967:81ff</ref>
+
+But Heijenoort gives Frege (1879) this kudos: Frege's is "perhaps the most important single work ever written in logic. ... in which we see a " 'formula language', that is a ''lingua characterica'', a language written with special symbols, "for pure thought", that is, free from rhetorical embellishments ... constructed from specific symbols that are manipulated according to definite rules".<ref>van Heijenoort's commentary on Frege's ''Begriffsschrift, a formula language, modeled upon that of arithmetic, for pure thought'' in van Heijenoort 1967:1</ref> The work of Frege was further simplified and amplified by [[Alfred North Whitehead]] and [[Bertrand Russell]] in their [[Principia Mathematica]] (1910–1913).
+
+''The paradoxes'': At the same time a number of disturbing paradoxes appeared in the literature, in particular, the [[Burali-Forti paradox]] (1897), the [[Russell paradox]] (1902–03), and the [[Richard Paradox]].<ref>Dixon 1906, cf. Kleene 1952:36–40</ref> The resultant considerations led to [[Kurt Gödel]]'s paper (1931)—he specifically cites the paradox of the liar—that completely reduces rules of [[recursion]] to numbers.
+
+''Effective calculability'': In an effort to solve the [[Entscheidungsproblem]] defined precisely by Hilbert in 1928, mathematicians first set about to define what was meant by an "effective method" or "effective calculation" or "effective calculability" (i.e., a calculation that would succeed). In rapid succession the following appeared: [[Alonzo Church]], [[Stephen Kleene]] and [[J.B. Rosser]]'s [[λ-calculus]]<ref>cf. footnote in Alonzo Church 1936a in Davis 1965:90 and 1936b in Davis 1965:110</ref> a finely honed definition of "general recursion" from the work of Gödel acting on suggestions of [[Jacques Herbrand]] (cf. Gödel's Princeton lectures of 1934) and subsequent simplifications by Kleene.<ref>Kleene 1935–6 in Davis 1965:237ff, Kleene 1943 in Davis 1965:255ff</ref> Church's proof<ref>Church 1936 in Davis 1965:88ff</ref> that the Entscheidungsproblem was unsolvable, [[Emil Post]]'s definition of effective calculability as a worker mindlessly following a list of instructions to move left or right through a sequence of rooms and while there either mark or erase a paper or observe the paper and make a yes-no decision about the next instruction.<ref>cf. "Finite Combinatory Processes – formulation 1", Post 1936 in Davis 1965:289–290</ref> Alan Turing's proof of that the Entscheidungsproblem was unsolvable by use of his "a- [automatic-] machine"<ref>Turing 1936–37 in Davis 1965:116ff</ref>—in effect almost identical to Post's "formulation", [[J. Barkley Rosser]]'s definition of "effective method" in terms of "a machine".<ref>Rosser 1939 in Davis 1965:226</ref> Kleene's proposal of a precursor to "[[Church thesis]]" that he called "Thesis I",<ref>Kleene 1943 in Davis 1965:273–274</ref> and a few years later Kleene's renaming his Thesis "Church's Thesis"<ref>Kleene 1952:300, 317</ref> and proposing "Turing's Thesis".<ref>Kleene 1952:376</ref>
+
+=== Emil Post (1936) and Alan Turing (1936–37, 1939) ===
+[[Emil Post]] (1936) described the actions of a "computer" (human being) as follows:
+:"...two concepts are involved: that of a ''symbol space'' in which the work leading from problem to answer is to be carried out, and a fixed unalterable ''set of directions''.
+
+His symbol space would be
+:"a two-way infinite sequence of spaces or boxes... The problem solver or worker is to move and work in this symbol space, being capable of being in, and operating in but one box at a time.... a box is to admit of but two possible conditions, i.e., being empty or unmarked, and having a single mark in it, say a vertical stroke.
+
+:"One box is to be singled out and called the starting point. ...a specific problem is to be given in symbolic form by a finite number of boxes [i.e., INPUT] being marked with a stroke. Likewise, the answer [i.e., OUTPUT] is to be given in symbolic form by such a configuration of marked boxes...
+
+:"A set of directions applicable to a general problem sets up a deterministic process when applied to each specific problem. This process terminates only when it comes to the direction of type (C ) [i.e., STOP]".<ref>Turing 1936–37 in Davis 1965:289–290</ref> See more at [[Post–Turing machine]]
+[[File:Alan Turing.jpg|thumb|200px|Alan Turing's statue at [[Bletchley Park]]]]
+[[Alan Turing]]'s work<ref>Turing 1936 in Davis 1965, Turing 1939 in Davis 1965:160</ref> preceded that of Stibitz (1937); it is unknown whether Stibitz knew of the work of Turing. Turing's biographer believed that Turing's use of a typewriter-like model derived from a youthful interest: "Alan had dreamt of inventing typewriters as a boy; Mrs. Turing had a typewriter, and he could well have begun by asking himself what was meant by calling a typewriter 'mechanical'".<ref>Hodges, p.&nbsp;96</ref> Given the prevalence at the time of Morse code, telegraphy, ticker tape machines, and teletypewriters, it is quite possible that all were influences on Turing during his youth.
+
+Turing—his model of computation is now called a [[Turing machine]]—begins, as did Post, with an analysis of a human computer that he whittles down to a simple set of basic motions and "states of mind". But he continues a step further and creates a machine as a model of computation of numbers.<ref>Turing 1936–37:116</ref>
+
+:"Computing is normally done by writing certain symbols on paper. We may suppose this paper is divided into squares like a child's arithmetic book...I assume then that the computation is carried out on one-dimensional paper, i.e., on a tape divided into squares. I shall also suppose that the number of symbols which may be printed is finite...
+
+:"The behavior of the computer at any moment is determined by the symbols which he is observing, and his "state of mind" at that moment. We may suppose that there is a bound B to the number of symbols or squares that the computer can observe at one moment. If he wishes to observe more, he must use successive observations. We will also suppose that the number of states of mind which need be taken into account is finite...
+
+:"Let us imagine that the operations performed by the computer to be split up into 'simple operations' which are so elementary that it is not easy to imagine them further divided."<ref name="Turing 1936–37 in Davis 1965:136">Turing 1936–37 in Davis 1965:136</ref>
+
+Turing's reduction yields the following:
+:"The simple operations must therefore include:
+::"(a) Changes of the symbol on one of the observed squares
+::"(b) Changes of one of the squares observed to another square within L squares of one of the previously observed squares.
+"It may be that some of these change necessarily invoke a change of state of mind. The most general single operation must, therefore, be taken to be one of the following:
+::"(A) A possible change (a) of symbol together with a possible change of state of mind.
+::"(B) A possible change (b) of observed squares, together with a possible change of state of mind"
+
+:"We may now construct a machine to do the work of this computer."<ref name="Turing 1936–37 in Davis 1965:136"/>
+
+A few years later, Turing expanded his analysis (thesis, definition) with this forceful expression of it:
+:"A function is said to be "effectively calculable" if its values can be found by some purely mechanical process. Though it is fairly easy to get an intuitive grasp of this idea, it is nevertheless desirable to have some more definite, mathematical expressible definition ... [he discusses the history of the definition pretty much as presented above with respect to Gödel, Herbrand, Kleene, Church, Turing, and Post] ... We may take this statement literally, understanding by a purely mechanical process one which could be carried out by a machine. It is possible to give a mathematical description, in a certain normal form, of the structures of these machines. The development of these ideas leads to the author's definition of a computable function, and to an identification of computability † with effective calculability...
+::"† We shall use the expression "computable function" to mean a function calculable by a machine, and we let "effectively calculable" refer to the intuitive idea without particular identification with any one of these definitions".<ref>Turing 1939 in Davis 1965:160</ref>
+
+=== J.B. Rosser (1939) and S.C. Kleene (1943) ===
+[[J. Barkley Rosser]] defined an 'effective [mathematical] method' in the following manner (italicization added):
+:"'Effective method' is used here in the rather special sense of a method each step of which is precisely determined and which is certain to produce the answer in a finite number of steps. With this special meaning, three different precise definitions have been given to date. [his footnote #5; see discussion immediately below]. The simplest of these to state (due to Post and Turing) says essentially that ''an effective method of solving certain sets of problems exists if one can build a machine which will then solve any problem of the set with no human intervention beyond inserting the question and (later) reading the answer''. All three definitions are equivalent, so it doesn't matter which one is used. Moreover, the fact that all three are equivalent is a very strong argument for the correctness of any one." (Rosser 1939:225–226)
+
+Rosser's footnote No. 5 references the work of (1) Church and Kleene and their definition of λ-definability, in particular, Church's use of it in his ''An Unsolvable Problem of Elementary Number Theory'' (1936); (2) Herbrand and Gödel and their use of recursion, in particular, Gödel's use in his famous paper ''On Formally Undecidable Propositions of Principia Mathematica and Related Systems I'' (1931); and (3) Post (1936) and Turing (1936–37) in their mechanism-models of computation.
+
+[[Stephen C. Kleene]] defined as his now-famous "Thesis I" known as the [[Church–Turing thesis]]. But he did this in the following context (boldface in original):
+:"12. ''Algorithmic theories''... In setting up a complete algorithmic theory, what we do is to describe a procedure, performable for each set of values of the independent variables, which procedure necessarily terminates and in such manner that from the outcome we can read a definite answer, "yes" or "no," to the question, "is the predicate value true?"" (Kleene 1943:273)
+
+=== History after 1950 ===
+A number of efforts have been directed toward further refinement of the definition of "algorithm", and activity is on-going because of issues surrounding, in particular, [[foundations of mathematics]] (especially the [[Church–Turing thesis]]) and [[philosophy of mind]] (especially arguments about [[artificial intelligence]]). For more, see [[Algorithm characterizations]].
+
+== See also ==
+{{div col|colwidth=22em}}
+* [[Abstract machine]]
+* [[Algorithm engineering]]
+* [[Algorithm characterizations]]
+* [[Algorithmic bias]]
+* [[Algorithmic composition]]
+* [[Algorithmic entities]]
+* [[Algorithmic synthesis]]
+* [[Algorithmic technique]]
+* [[Algorithmic topology]]
+* [[Garbage in, garbage out]]
+* ''[[Introduction to Algorithms]]'' (textbook)
+* [[Government by algorithm]]
+* [[List of algorithms]]
+* [[List of algorithm general topics]]
+* [[List of important publications in theoretical computer science#Algorithms|List of important publications in theoretical computer science – Algorithms]]
+* [[Regulation of algorithms]]
+* [[Theory of computation]]
+** [[Computability theory]]
+** [[Computational complexity theory]]
+* [[Computational mathematics]]
+{{div col end}}
+
+==Notes==
+{{Reflist}}
+
+==Bibliography==
+{{refbegin|30em}}
+* {{cite journal | last1 = Axt | first1 = P | year = 1959 | title = On a Subrecursive Hierarchy and Primitive Recursive Degrees | journal = Transactions of the American Mathematical Society | volume = 92 | issue = 1| pages = 85–105 | doi=10.2307/1993169| jstor = 1993169 | doi-access = free}}
+* Bell, C. Gordon and Newell, Allen (1971), ''Computer Structures: Readings and Examples'', McGraw–Hill Book Company, New York. {{ISBN|0-07-004357-4}}.
+* {{Cite journal|author1-link=Andreas Blass|first1=Andreas|last1=Blass|author2-link=Yuri Gurevich|first2=Yuri|last2=Gurevich|year=2003|url=http://research.microsoft.com/~gurevich/Opera/164.pdf|title=Algorithms: A Quest for Absolute Definitions|journal= Bulletin of European Association for Theoretical Computer Science|volume= 81}} Includes an excellent bibliography of 56 references.
+* {{cite book| last = Bolter| first = David J.| title = Turing's Man: Western Culture in the Computer Age| edition = 1984| year = 1984| publisher = The University of North Carolina Press|location= Chapel Hill, NC| isbn = 978-0-8078-1564-9 }}, {{ISBN|0-8078-4108-0}}
+* {{cite book| last1 = Boolos| first1 = George| last2 = Jeffrey| first2 = Richard| title = Computability and Logic| url = https://archive.org/details/computabilitylog0000bool_r8y9| url-access = registration| edition = 4th| orig-year = 1974| year = 1999| publisher = Cambridge University Press, London| isbn = 978-0-521-20402-6| author1-link = George Boolos| author2-link = Richard Jeffrey }}: cf. Chapter 3 ''Turing machines'' where they discuss "certain enumerable sets not effectively (mechanically) enumerable".
+* {{cite book| last = Burgin| first = Mark| title = Super-Recursive Algorithms| year = 2004| publisher = Springer| isbn = 978-0-387-95569-8 }}
+* Campagnolo, M.L., [[Cris Moore|Moore, C.]], and Costa, J.F. (2000) An analog characterization of the subrecursive functions. In ''Proc. of the 4th Conference on Real Numbers and Computers'', Odense University, pp.&nbsp;91–109
+* {{Cite journal|last=Church|first=Alonzo|author-link=Alonzo Church|title=An Unsolvable Problem of Elementary Number Theory|journal=The American Journal of Mathematics|volume=58|pages= 345–363|year=1936|doi=10.2307/2371045|issue=2|jstor=2371045}} Reprinted in ''The Undecidable'', p.&nbsp;89ff. The first expression of "Church's Thesis". See in particular page 100 (''The Undecidable'') where he defines the notion of "effective calculability" in terms of "an algorithm", and he uses the word "terminates", etc.
+* {{Cite journal|last=Church|first=Alonzo|author-link=Alonzo Church|title=A Note on the Entscheidungsproblem|journal=The Journal of Symbolic Logic|volume=1|year=1936|pages=40–41|doi=10.2307/2269326|issue=1|jstor=2269326}} {{cite journal|last=Church|first=Alonzo|title=Correction to a Note on the Entscheidungsproblem|journal=The Journal of Symbolic Logic|volume=1|year=1936|pages=101–102|doi=10.2307/2269030|issue=3|jstor=2269030}} Reprinted in ''The Undecidable'', p.&nbsp;110ff. Church shows that the Entscheidungsproblem is unsolvable in about 3 pages of text and 3 pages of footnotes.
+* {{cite book| last = Daffa'| first = Ali Abdullah al-| title = The Muslim contribution to mathematics| year = 1977| publisher = Croom Helm| location = London| isbn = 978-0-85664-464-1 }}
+* {{cite book| last = Davis| first = Martin| author-link = Martin Davis (mathematician)| title = The Undecidable: Basic Papers On Undecidable Propositions, Unsolvable Problems and Computable Functions| url = https://archive.org/details/undecidablebasic0000davi| url-access = registration| year = 1965| publisher = Raven Press| location = New York| isbn = 978-0-486-43228-1 }} Davis gives commentary before each article. Papers of [[Gödel]], [[Alonzo Church]], [[Alan Turing|Turing]], [[J. Barkley Rosser|Rosser]], [[Kleene]], and [[Emil Post]] are included; those cited in the article are listed here by author's name.
+* {{cite book| last = Davis| first = Martin| author-link = Martin Davis (mathematician)| title = Engines of Logic: Mathematicians and the Origin of the Computer| year = 2000| publisher = W.W. Nortion| location = New York| isbn = 978-0-393-32229-3 }} Davis offers concise biographies of [[Gottfried Leibniz|Leibniz]], [[George Boole|Boole]], [[Gottlob Frege|Frege]], [[Georg Cantor|Cantor]], [[David Hilbert|Hilbert]], Gödel and Turing with [[John von Neumann|von Neumann]] as the show-stealing villain. Very brief bios of [[Joseph-Marie Jacquard]], [[Babbage]], [[Ada Lovelace]], [[Claude Shannon]], [[Howard Aiken]], etc.
+* {{DADS|algorithm|algorithm}}
+* {{cite journal|title= Evolution and moral diversity |author=Dean, Tim |journal=Baltic International Yearbook of Cognition, Logic and Communication|year=2012|volume=7|doi=10.4148/biyclc.v7i0.1775 |doi-access=free}}
+* {{cite book| last = Dennett| first = Daniel| author-link = Daniel Dennett| title = Darwin's Dangerous Idea| journal = Complexity| volume = 2| issue = 1| pages = [https://archive.org/details/darwinsdangerous0000denn/page/32 32]–36| year = 1995| publisher = Touchstone/Simon & Schuster| location = New York| isbn = 978-0-684-80290-9| bibcode = 1996Cmplx...2a..32M| doi = 10.1002/(SICI)1099-0526(199609/10)2:1<32::AID-CPLX8>3.0.CO;2-H| url = https://archive.org/details/darwinsdangerous0000denn| url-access = registration}}
+* {{cite book| last = Dilson| first = Jesse| title = The Abacus| edition = (1968, 1994)| year = 2007| publisher = St. Martin's Press, NY| isbn = 978-0-312-10409-2| url = https://archive.org/details/abacusworldsfirs0000dils}}, {{ISBN|0-312-10409-X}}
+* [[Yuri Gurevich]], [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.146.3017&rep=rep1&type=pdf ''Sequential Abstract State Machines Capture Sequential Algorithms''], ACM Transactions on Computational Logic, Vol 1, no 1 (July 2000), pp.&nbsp;77–111. Includes bibliography of 33 sources.
+* {{cite book| last = van Heijenoort| first = Jean| author-link = Jean van Heijenoort| title = From Frege to Gödel, A Source Book in Mathematical Logic, 1879–1931| edition = (1967)| year = 2001| publisher = Harvard University Press, Cambridge| isbn = 978-0-674-32449-7 }}, 3rd edition 1976[?], {{ISBN|0-674-32449-8}} (pbk.)
+* {{cite book| last = Hodges| first = Andrew| author-link = Andrew Hodges| title = Alan Turing: The Enigma| journal = Physics Today| volume = 37| issue = 11| pages = 107–108| year = 1983| publisher = [[Simon and Schuster]]| location = New York| isbn = 978-0-671-49207-6| title-link = Alan Turing: The Enigma| bibcode = 1984PhT....37k.107H| doi = 10.1063/1.2915935}}, {{ISBN|0-671-49207-1}}. Cf. Chapter "The Spirit of Truth" for a history leading to, and a discussion of, his proof.
+* {{Cite journal|last=Kleene|first=Stephen C.|author-link=Stephen Kleene|title=General Recursive Functions of Natural Numbers|journal=Mathematische Annalen|volume=112|pages=727–742|url=http://gdz.sub.uni-goettingen.de/index.php?id=11&PPN=GDZPPN002278499&L=1|year=1936|doi=10.1007/BF01565439|issue=5|s2cid=120517999|access-date=September 30, 2013|archive-url=https://web.archive.org/web/20140903092121/http://gdz.sub.uni-goettingen.de/index.php?id=11&PPN=GDZPPN002278499&L=1|archive-date=September 3, 2014|url-status=dead}} Presented to the American Mathematical Society, September 1935. Reprinted in ''The Undecidable'', p.&nbsp;237ff. Kleene's definition of "general recursion" (known now as mu-recursion) was used by Church in his 1935 paper ''An Unsolvable Problem of Elementary Number Theory'' that proved the "decision problem" to be "undecidable" (i.e., a negative result).
+* {{Cite journal|last=Kleene|first=Stephen C.|author-link=Stephen Kleene |title= Recursive Predicates and Quantifiers|journal= Transactions of the American Mathematical Society|volume=53|pages=41–73|year=1943 |doi= 10.2307/1990131|issue=1|jstor=1990131|doi-access=free}} Reprinted in ''The Undecidable'', p.&nbsp;255ff. Kleene refined his definition of "general recursion" and proceeded in his chapter "12. Algorithmic theories" to posit "Thesis I" (p.&nbsp;274); he would later repeat this thesis (in Kleene 1952:300) and name it "Church's Thesis"(Kleene 1952:317) (i.e., the [[Church thesis]]).
+* {{cite book| last = Kleene| first = Stephen C.| author-link = Kleene| title = Introduction to Metamathematics| edition = Tenth|year= 1991| orig-year = 1952| publisher = North-Holland Publishing Company| isbn = 978-0-7204-2103-3 }}
+* {{cite book| last = Knuth| first = Donald| author-link = Donald Knuth| title = Fundamental Algorithms, Third Edition| year = 1997| publisher = Addison–Wesley| location = Reading, Massachusetts| isbn = 978-0-201-89683-1 }}
+* {{Cite book|last=Knuth|first=Donald|author-link=Donald Knuth|title=Volume 2/Seminumerical Algorithms, The Art of Computer Programming First Edition|publisher=Addison–Wesley|location=Reading, Massachusetts|year=1969}}
+* Kosovsky, N.K. ''Elements of Mathematical Logic and its Application to the theory of Subrecursive Algorithms'', LSU Publ., Leningrad, 1981
+* {{Cite journal|last=Kowalski|first=Robert|author-link=Robert Kowalski|title=Algorithm=Logic+Control|journal=[[Communications of the ACM]]|volume=22|issue=7|pages=424–436|year=1979|doi=10.1145/359131.359136|s2cid=2509896}}
+* [[A.A. Markov]] (1954) ''Theory of algorithms''. [Translated by Jacques J. Schorr-Kon and PST staff] Imprint Moscow, Academy of Sciences of the USSR, 1954 [i.e., Jerusalem, Israel Program for Scientific Translations, 1961; available from the Office of Technical Services, U.S. Dept. of Commerce, Washington] Description 444 p.&nbsp;28&nbsp;cm. Added t.p. in Russian Translation of Works of the Mathematical Institute, Academy of Sciences of the USSR, v.&nbsp;42. Original title: Teoriya algerifmov. [QA248.M2943 Dartmouth College library. U.S. Dept. of Commerce, Office of Technical Services, number OTS {{not a typo|60-51085}}.]
+* {{cite book| last = Minsky| first = Marvin| author-link = Marvin Minsky| title = Computation: Finite and Infinite Machines| url = https://archive.org/details/computationfinit0000mins| url-access = registration| edition = First| year = 1967| publisher = Prentice-Hall, Englewood Cliffs, NJ| isbn = 978-0-13-165449-5 }} Minsky expands his "...idea of an algorithm – an effective procedure..." in chapter 5.1 ''Computability, Effective Procedures and Algorithms. Infinite machines.''
+* {{Cite journal|last=Post|first=Emil|author-link=Emil Post|title=Finite Combinatory Processes, Formulation I |journal=The Journal of Symbolic Logic |volume=1 |year=1936 |pages=103–105 |doi=10.2307/2269031 |issue=3 |jstor=2269031}} Reprinted in ''The Undecidable'', pp.&nbsp;289ff. Post defines a simple algorithmic-like process of a man writing marks or erasing marks and going from box to box and eventually halting, as he follows a list of simple instructions. This is cited by Kleene as one source of his "Thesis I", the so-called [[Church–Turing thesis]].
+* {{Cite book|last=Rogers, Jr|first=Hartley|title=Theory of Recursive Functions and Effective Computability|publisher=The MIT Press|year=1987|isbn=978-0-262-68052-3}}
+* {{Cite journal|last=Rosser|first=J.B.|author-link=J. B. Rosser|title=An Informal Exposition of Proofs of Godel's Theorem and Church's Theorem|journal=Journal of Symbolic Logic|volume= 4 |issue=2|year=1939|doi=10.2307/2269059|pages=53–60|jstor=2269059}} Reprinted in ''The Undecidable'', p.&nbsp;223ff. Herein is Rosser's famous definition of "effective method": "...a method each step of which is precisely predetermined and which is certain to produce the answer in a finite number of steps... a machine which will then solve any problem of the set with no human intervention beyond inserting the question and (later) reading the answer" (p.&nbsp;225–226, ''The Undecidable'')
+* {{cite book |last=Santos-Lang |first=Christopher | year=2014 |editor1-first=Simon |editor1-last=van Rysewyk |editor2-first=Matthijs |editor2-last=Pontier |title=Machine Medical Ethics |volume=74 |publisher=Springer | location=Switzerland | pages=111–127 | chapter=Moral Ecology Approaches to Machine Ethics| chapter-url=http://grinfree.com/MoralEcology.pdf | doi=10.1007/978-3-319-08108-3_8|series=Intelligent Systems, Control and Automation: Science and Engineering |isbn=978-3-319-08107-6 }}
+* {{Cite book|last=Scott|first=Michael L.|title=Programming Language Pragmatics |edition=3rd |publisher=Morgan Kaufmann Publishers/Elsevier|year=2009|isbn=978-0-12-374514-9}}
+* {{cite book| last = Sipser| first = Michael| title = Introduction to the Theory of Computation| year = 2006| publisher = PWS Publishing Company| isbn = 978-0-534-94728-6| url = https://archive.org/details/introductiontoth00sips}}
+* {{cite book |last1=Sober |first1=Elliott |last2=Wilson |first2=David Sloan |year=1998 |title=Unto Others: The Evolution and Psychology of Unselfish Behavior |url=https://archive.org/details/untoothersevolut00sobe |url-access=registration |location=Cambridge |publisher=Harvard University Press|isbn=9780674930469 }}
+* {{Cite book|last=Stone|first=Harold S.|title=Introduction to Computer Organization and Data Structures|edition=1972|publisher=McGraw-Hill, New York|isbn=978-0-07-061726-1|year=1972}} Cf. in particular the first chapter titled: ''Algorithms, Turing Machines, and Programs''. His succinct informal definition: "...any sequence of instructions that can be obeyed by a robot, is called an ''algorithm''" (p.&nbsp;4).
+* {{cite book| last = Tausworthe| first = Robert C| title = Standardized Development of Computer Software Part 1 Methods| year = 1977| publisher = Prentice–Hall, Inc.| location = Englewood Cliffs NJ| isbn = 978-0-13-842195-3 }}
+* {{Cite journal|last=Turing|first=Alan M.|author-link=A. M. Turing|title=On Computable Numbers, With An Application to the Entscheidungsproblem|journal=[[Proceedings of the London Mathematical Society]]|series=Series 2|volume=42|pages= 230–265 |year=1936–37|doi=10.1112/plms/s2-42.1.230 |s2cid=73712 }}. Corrections, ibid, vol. 43(1937) pp.&nbsp;544–546. Reprinted in ''The Undecidable'', p.&nbsp;116ff. Turing's famous paper completed as a Master's dissertation while at King's College Cambridge UK.
+* {{Cite journal|last=Turing|first=Alan M.|author-link=A. M. Turing|title=Systems of Logic Based on Ordinals|journal=Proceedings of the London Mathematical Society|volume=45|pages=161–228|year=1939|doi=10.1112/plms/s2-45.1.161|hdl=21.11116/0000-0001-91CE-3|hdl-access=free}} Reprinted in ''The Undecidable'', pp.&nbsp;155ff. Turing's paper that defined "the oracle" was his PhD thesis while at Princeton.
+* [[United States Patent and Trademark Office]] (2006), [http://www.uspto.gov/web/offices/pac/mpep/documents/2100_2106_02.htm ''2106.02 **>Mathematical Algorithms: 2100 Patentability''], Manual of Patent Examining Procedure (MPEP). Latest revision August 2006
+{{refend|30em}}
+
+==Further reading==
+{{refbegin}}
+* {{cite book |last=Bellah |first=Robert Neelly |year=1985 |author-link=Robert N. Bellah |title=Habits of the Heart: Individualism and Commitment in American Life |location=Berkeley |isbn=978-0-520-25419-0 |publisher=University of California Press |url=https://books.google.com/books?id=XsUojihVZQcC }}
+* {{cite book |last=Berlinski |first=David |title=The Advent of the Algorithm: The 300-Year Journey from an Idea to the Computer |year=2001 |publisher=Harvest Books |isbn=978-0-15-601391-8 |url=https://archive.org/details/adventofalgorith0000berl }}
+* {{cite book |last=Chabert |first=Jean-Luc |title=A History of Algorithms: From the Pebble to the Microchip |year=1999 |publisher=Springer Verlag |isbn=978-3-540-63369-3}}
+* {{cite book |author1=Thomas H. Cormen |author2=Charles E. Leiserson |author3=Ronald L. Rivest |author4=Clifford Stein |title=Introduction To Algorithms |edition=3rd |year=2009 |publisher=MIT Press |isbn=978-0-262-03384-8}}
+* {{cite book |author=Harel, David |author2=Feldman, Yishai |title=Algorithmics: The Spirit of Computing |year=2004 |publisher=Addison-Wesley |isbn=978-0-321-11784-7}}
+* {{cite book |last1=Hertzke |first1=Allen D. |last2=McRorie |first2=Chris |year=1998 |editor1-last=Lawler |editor1-first=Peter Augustine |editor2-last=McConkey |editor2-first=Dale |chapter=The Concept of Moral Ecology |title=Community and Political Thought Today |location=Westport, CT |publisher=[[Praeger Publishers|Praeger]] }}
+* [[Donald Knuth|Knuth, Donald E.]] (2000). ''[http://www-cs-faculty.stanford.edu/~uno/aa.html Selected Papers on Analysis of Algorithms]''. Stanford, California: Center for the Study of Language and Information.
+* Knuth, Donald E. (2010). ''[http://www-cs-faculty.stanford.edu/~uno/da.html Selected Papers on Design of Algorithms]''. Stanford, California: Center for the Study of Language and Information.
+* {{Cite book |first1=Wendell |last1=Wallach |first2=Colin |last2=Allen |date=November 2008 |title=Moral Machines: Teaching Robots Right from Wrong |isbn=978-0-19-537404-9 |publisher=Oxford University Press |location=US }}
+* {{cite book |author=Bleakley, Chris |title=Poems that Solve Puzzles: The History and Science of Algorithms |year=2020 |publisher=Oxford University Press |isbn=978-0-19-885373-2 |url=https://books.google.com/books?id=3pr5DwAAQBAJ}}
+{{refend}}
+
+==External links==
+{{wiktionary}}
+{{wikibooks|Algorithms}}
+{{WVD}}
+{{Commons category|Algorithms}}
+* {{springer|title=Algorithm|id=p/a011780}}
+* {{curlie|Computers/Algorithms/|Algorithms}}
+* {{MathWorld | urlname=Algorithm | title=Algorithm}}
+* [https://www.nist.gov/dads/ Dictionary of Algorithms and Data Structures] – [[National Institute of Standards and Technology]]
+; Algorithm repositories
+* [http://www.cs.sunysb.edu/~algorith/ The Stony Brook Algorithm Repository] – [[State University of New York at Stony Brook]]
+* [http://calgo.acm.org/ Collected Algorithms of the ACM] – [[Association for Computing Machinery]]
+* [http://www-cs-staff.stanford.edu/~knuth/sgb.html The Stanford GraphBase] – [[Stanford University]]
+
+{{Industrial and applied mathematics}}
+{{Authority control}}
+
+[[Category:Algorithms| ]]
+[[Category:Articles with example pseudocode]]
+[[Category:Mathematical logic]]
+[[Category:Theoretical computer science]]
+[[Category:Disambiguation]]
diff --git a/testcases/entity/obama.txt b/testcases/entity/obama.txt
new file mode 100644
index 00000000..8769904a
--- /dev/null
+++ b/testcases/entity/obama.txt
@@ -0,0 +1,933 @@
+{{Short description|President of the United States from 2009 to 2017}}
+{{redirect2|Barack|Obama|other uses|Barack (disambiguation)|and|Obama (disambiguation)|and|Barack Obama (disambiguation)}}
+{{pp-move-indef}}
+{{pp-semi|small=yes}}
+{{pp|rpff request|small=yes}}
+{{Use American English|date=September 2020}}
+{{Use mdy dates|date=June 2022}}
+{{Infobox officeholder
+| image = President Barack Obama.jpg
+| alt = Obama standing with his arms folded and smiling.
+| order = 44th
+| office = President of the United States
+| caption = Official portrait, 2012
+| vicepresident = [[Joe Biden]]
+| term_start = January 20, 2009
+| term_end = January 20, 2017
+| predecessor = [[George W. Bush]]
+| successor = [[Donald Trump]]
+| jr/sr1 = United States Senator
+| state1 = [[Illinois]]
+| term_start1 = January 3, 2005
+| term_end1 = November 16, 2008
+| predecessor1 = [[Peter Fitzgerald (politician)|Peter Fitzgerald]]
+| successor1 = [[Roland Burris]]
+| state_senate2 = Illinois
+| district2 = [[Illinois's 13th Senate district|13th]]
+| predecessor2 = [[Alice Palmer (politician)|Alice Palmer]]
+| term_start2 = January 8, 1997
+| term_end2 = November 4, 2004
+| successor2 = [[Kwame Raoul]]
+| birth_name = Barack Hussein Obama II
+| birth_date = {{Birth date and age|1961|8|4|mf=yes}}
+| birth_place = [[Honolulu]], [[Hawaii]], U.S.
+| death_date =
+| death_place =
+| party = [[Democratic Party (United States)|Democratic]]
+| spouse = {{marriage|[[Michelle Obama|Michelle Robinson]]|October 3, 1992}}
+| children = {{flatlist|
+* [[Malia Obama|Malia]]
+* [[Sasha Obama|Sasha]]
+}}
+| parents = {{plainlist|
+* [[Barack Obama Sr.]]
+* [[Ann Dunham]]
+}}
+| relatives = [[Family of Barack Obama]]
+| residence = [[Kalorama (Washington, D.C.)]]
+| education = [[Punahou School]]
+| alma_mater = {{unbulleted list|[[Occidental College]] |[[Columbia University]] ([[Bachelor of Arts|BA]])|[[Harvard Law School|Harvard University]] ([[Juris Doctor|JD]])}}
+| occupation = {{hlist|Politician|lawyer|author}}
+| awards = [[List of honors and awards received by Barack Obama|List of honors and awards]]
+| signature = Barack Obama signature.svg
+| signature_alt = Cursive signature in ink
+| website = {{unbulleted list|{{URL|https://barackobama.com|Official website}}|{{URL|https://www.obama.org|Obama Foundation}}|{{URL|obamawhitehouse.archives.gov|White House Archives}}}}
+}}
+{{Barack Obama sidebar}}
+
+'''Barack Hussein Obama II''' ({{IPAc-en|audio=En-us-Barack-Hussein-Obama.ogg|b|ə|ˈ|r|ɑː|k|_|h|uː|ˈ|s|eɪ|n|_|oʊ|ˈ|b|ɑː|m|ə}} {{respell|bə|RAHK}} {{respell|hoo|SAYN}} {{respell|oh|BAH|mə}};<ref>{{YouTube|clMEg4-N7ao|"Barack Hussein Obama Takes The Oath Of Office"}}. January 20, 2009.</ref> born August 4, 1961) is an American politician <!--NOTE: The lead sentence should stick to what he is primarily known for. The infobox is there to include additional occupations.-->who served as the 44th [[president of the United States]] from 2009 to 2017. A member of the [[Democratic Party (United States)|Democratic Party]], he was the first African-American <!-- DO NOT LINK PER MOS:OVERLINK --> president of the United States.<ref name="FirstBlackPrez"/> Obama previously served as a [[U.S. senator]] from [[Illinois]] from 2005 to 2008 and as an [[Illinois state senator]] from 1997 to 2004. <!--PLEASE DO NOT CHANGE FROM "AFRICAN AMERICAN", per consensus. See discussions and FAQ (Q2) on the talk page.-->
+
+Obama was born in [[Honolulu]], [[Hawaii]]. After graduating from [[Columbia University]] in 1983, he worked as a [[Community organizing|community organizer]] in [[Chicago]]. In 1988, he enrolled in [[Harvard Law School]], where he was the first black president of the ''[[Harvard Law Review]]''. After graduating, he became a civil rights attorney and an academic, teaching constitutional law at the [[University of Chicago Law School]] from 1992 to 2004. Turning to elective politics, he [[Illinois Senate career of Barack Obama|represented the 13th district]] in the [[Illinois Senate]] from 1997 until 2004, when he [[2004 United States Senate election in Illinois|ran for the U.S. Senate]]. Obama received national attention in 2004 with his March Senate primary win, his well-received July [[2004 Democratic National Convention|Democratic National Convention]] [[2004 Democratic National Convention keynote address|keynote address]], and his landslide November election to the Senate. In 2008, a year after beginning [[Barack Obama 2008 presidential campaign|his campaign]], and after [[2008 Democratic Party presidential primaries|a close primary campaign]] against [[Hillary Clinton]], he was nominated by the Democratic Party for president. Obama was elected over [[Republican Party (United States)|Republican]] nominee [[John McCain]] in the [[2008 United States presidential election|general election]] and was [[First inauguration of Barack Obama|inaugurated]] alongside his running mate [[Joe Biden]], on January 20, 2009. Nine months later, he was named the [[2009 Nobel Peace Prize]] laureate, a decision that drew a mixture of praise and criticism.
+
+Obama signed many landmark bills into law during his first two [[Presidency of Barack Obama|years in office]]. The main reforms include: the [[Affordable Care Act]] (ACA or "Obamacare"), although without a [[public health insurance option]]; the [[Dodd–Frank Wall Street Reform and Consumer Protection Act]]; and the [[Don't Ask, Don't Tell Repeal Act of 2010]]. The [[American Recovery and Reinvestment Act of 2009|American Recovery and Reinvestment Act]] and [[Tax Relief, Unemployment Insurance Reauthorization, and Job Creation Act of 2010|Tax Relief, Unemployment Insurance Reauthorization, and Job Creation Act]] served as economic stimuli amidst the [[Great Recession in the United States|Great Recession]]. After a [[United States debt-ceiling crisis of 2011|lengthy debate over the national debt limit]], he signed the [[Budget Control Act of 2011|Budget Control]] and the [[American Taxpayer Relief Act of 2012|American Taxpayer Relief Acts]]. In foreign policy, he increased U.S. troop levels in [[War in Afghanistan (2001–present)|Afghanistan]], reduced nuclear weapons with the United States–[[Russia]] [[New START]] treaty, and [[Withdrawal of U.S. troops from Iraq (2007–2011)|ended military involvement]] in the [[Iraq War]]. In 2011, Obama controversially ordered the drone-strike killing of [[Anwar al-Awlaki]], a US citizen and suspected [[al-Qaeda]] operative. He ordered [[2011 military intervention in Libya|military involvement in Libya]] for the implementation of the [[United Nations Security Council Resolution 1973|UN Security Council Resolution 1973]], contributing to the overthrow of [[Muammar Gaddafi]]. He also ordered the [[Killing of Osama bin Laden#Operation Neptune Spear|military operation]] that resulted in the death of [[Osama bin Laden]].
+
+After winning [[2012 United States presidential election|re-election]] by defeating Republican opponent [[Mitt Romney]], Obama was [[Second inauguration of Barack Obama|sworn in for a second term]] on January 20, 2013. During this term, he condemned the [[Global surveillance disclosures (2013–present)|2013 Snowden leaks]] as unpatriotic, but called for more restrictions on the [[National Security Agency]] (NSA) to address privacy issues. Obama also promoted inclusion for [[LGBT American]]s. His administration filed briefs that urged the [[Supreme Court of the United States|Supreme Court]] to strike down [[Same-sex marriage in the United States|same-sex marriage]] bans as unconstitutional (''[[United States v. Windsor]]'' and ''[[Obergefell v. Hodges]]''); same-sex marriage was [[Same-sex marriage in the United States|legalized]] nationwide in 2015 after the Court ruled so in ''Obergefell''. He advocated for [[Gun politics in the United States|gun control]] in response to the [[Sandy Hook Elementary School shooting]], indicating support for a ban on [[assault weapons]], and issued wide-ranging executive actions concerning [[global warming]] and immigration. In foreign policy, he ordered [[American-led intervention in Iraq (2014–present)|military interventions in Iraq]] and [[American-led intervention in the Syrian civil war|Syria]] in response to gains made by [[Islamic State|ISIL]] after the 2011 withdrawal from Iraq, promoted discussions that led to the 2015 [[Paris Agreement]] on global climate change, drew down [[Withdrawal of United States troops from Afghanistan (2011–2016)|U.S. troops in Afghanistan]] in 2016, initiated [[International sanctions during the Ukrainian crisis|sanctions against Russia]] following its [[Annexation of Crimea by the Russian Federation|annexation of Crimea]] and again after [[Russian interference in the 2016 United States elections|interference in the 2016 U.S. elections]], brokered the [[Joint Comprehensive Plan of Action]] nuclear deal with Iran, and [[Cuban thaw|normalized U.S. relations with Cuba]]. Obama nominated [[Barack Obama Supreme Court candidates|three justices to the Supreme Court]]: [[Sonia Sotomayor]] and [[Elena Kagan]] were confirmed as justices, while [[Merrick Garland]] was [[Merrick Garland Supreme Court nomination|denied hearings or a vote]] from the Republican-majority [[United States Senate|Senate]]. Obama left office on January 20, 2017, and continues to reside in [[Washington, D.C.]]
+
+During Obama's [[Presidency of Barack Obama|terms as president]], the United States' reputation abroad, as well as the American economy, significantly improved. Scholars and historians rank him among [[Historical rankings of presidents of the United States|the upper to mid tier]] of American presidents. Since leaving office, Obama has remained active in Democratic politics, including campaigning for candidates in the [[2018 United States elections|2018 midterm elections]], appearing at the [[2020 Democratic National Convention]] and campaigning for Biden during the [[2020 United States presidential election|2020 presidential election]]. Outside of politics, Obama has published three [[Bibliography of Barack Obama|bestselling books]]: ''[[Dreams from My Father]]'' (1995)'', [[The Audacity of Hope]]'' (2006) and ''[[A Promised Land]]'' (2020).
+{{TOC limit|4}}
+
+==Early life and career==
+{{Main|Early life and career of Barack Obama}}
+[[File:Ann Dunham with father and children.jpg|thumb|left|[[Stanley Armour Dunham]], [[Ann Dunham]], [[Maya Soetoro-Ng|Maya Soetoro]] and Barack Obama, (L to R) mid-1970s in [[Honolulu]]]]
+Obama was born on August 4, 1961,<ref name="biography">{{cite web |year = 2008 |title = President Barack Obama |publisher = The White House |url=https://www.whitehouse.gov/administration/president-obama |access-date = December 12, 2008 |url-status=dead | archive-url=https://web.archive.org/web/20091026043047/http://www.whitehouse.gov/administration/president-obama |archive-date=October 26, 2009 }}</ref> at [[Kapiolani Medical Center for Women and Children]] in [[Honolulu]], [[Hawaii]].<ref name="birth-certificate" /><ref name="maraniss">{{cite news |author = Maraniss, David |date = August 24, 2008 |title = Though Obama had to leave to find himself, it is Hawaii that made his rise possible |newspaper = The Washington Post |page = A22 |url=https://www.washingtonpost.com/wp-dyn/content/article/2008/08/23/AR2008082301620.html |access-date = October 28, 2008 }}</ref><ref>{{cite news |author = Nakaso, Dan |date = December 22, 2008 |title = Twin sisters, Obama on parallel paths for years |newspaper = [[The Honolulu Advertiser]] |page = B1 |url=http://the.honoluluadvertiser.com/article/2008/Dec/22/ln/hawaii812220320.html |access-date = January 22, 2011 }}</ref> He is the only president born outside the [[contiguous United States|contiguous 48 states]].<ref name="BarretoO'Bryant2013">{{cite book|last1=Barreto|first1=Amílcar Antonio|first2=Richard L.|last2=O'Bryant|title=American Identity in the Age of Obama|chapter-url=https://books.google.com/books?id=5VQVAgAAQBAJ&pg=PT18|access-date=May 8, 2017|date=November 12, 2013|publisher=Taylor & Francis|isbn=978-1-317-93715-9|pages=18–19|chapter=Introduction}}</ref> He was born to an American mother and a Kenyan father. His mother, [[Ann Dunham]] (1942–1995), was born in [[Wichita, Kansas]]; she was mostly of English descent.<ref>Obama (1995, 2004), p. 12.</ref> In July 2012, [[Ancestry.com]] found a strong likelihood that Dunham was descended from [[John Punch (slave)|John Punch]], an enslaved African man who lived in the [[Colony of Virginia]] during the seventeenth century.<ref name="ancestry">[http://corporate.ancestry.com/press/press-releases/2012/07/ancestry.com-discovers-president-obama-related-to-first-documented-slave-in-america/ "Ancestry.com Discovers Ph Suggests"] {{webarchive|url=https://web.archive.org/web/20150402094350/http://corporate.ancestry.com/press/press-releases/2012/07/ancestry.com-discovers-president-obama-related-to-first-documented-slave-in-america/ |date=April 2, 2015 }}, ''[[The New York Times]]''. July 30, 2012.</ref><ref>Hennessey, Kathleen. [https://articles.latimes.com/2012/jul/30/news/la-pn-obama-related-to-legendary-virginia-slave-genealogist-says-20120730 "Obama related to legendary Virginia slave, genealogists say"], ''[[Los Angeles Times]]''. July 30, 2012.</ref> Obama's father, [[Barack Obama Sr.]] (1934–1982),<ref>Maraniss (2012), <span class="plainlinks">[https://www.google.com/books/edition/Barack_Obama/Wnna9CLtblAC?&gbpv=1&pg=PT65 p. 65]</span>: He had been born inside the euphorbia hedges of the K'obama homestead on June 18, 1934.</ref><ref>Liberties (2012), <span class="plainlinks">[https://books.google.com/books?id=8d9NAAAAQBAJ&pg=SL1-PA202 p. 202]</span>: The age of the father is questionable since most of the documents Barack Hussein Obama filled out during his United States student visa was June 18, 1934; however, Obama II's book ''Dreams of My Father'' states his birth date was June 18, 1936. Check out Immigration and Naturalization Service records, and those documents also indicate the birth date to be June 18, 1934, thereby making Obama Sr. twenty-seven at the birth of Obama II instead of the annotated twenty-five on the birth certificate.</ref> was a married<ref name="autogenerated2">{{cite news|last=Jacobs |first=Sally |url=https://www.npr.org/2011/07/11/137553552/president-obamas-father-a-bold-and-reckless-life |title=President Obama's Father: A 'Bold And Reckless Life' |publisher=NPR |date=July 6, 2011 |access-date=January 16, 2020}}</ref><ref>{{cite news|last=Swaine |first=Jon |url=https://www.telegraph.co.uk/news/worldnews/barackobama/8481779/Barack-Obamas-father-forced-out-of-US-in-1960s.html |archive-url=https://ghostarchive.org/archive/20220110/https://www.telegraph.co.uk/news/worldnews/barackobama/8481779/Barack-Obamas-father-forced-out-of-US-in-1960s.html |archive-date=January 10, 2022 |url-access=subscription |url-status=live |title=Barack Obama's father 'forced out of US in 1960s' |newspaper=Telegraph |date=April 29, 2011 |access-date=January 16, 2020}}{{cbignore}}</ref><ref>{{cite news|first=Rachel L. |last=Swarns |url=https://www.nytimes.com/2016/06/19/nyregion/letters-by-and-about-barack-obamas-father.html |archive-url=https://web.archive.org/web/20160618145445/http://www.nytimes.com/2016/06/19/nyregion/letters-by-and-about-barack-obamas-father.html |archive-date=June 18, 2016 |url-access=subscription |url-status=live |title=Words of Obama's Father Still Waiting to Be Read by His Son |work=The New York Times |access-date=January 16, 2020}}</ref> [[Luo people of Kenya and Tanzania|Luo Kenyan]] from [[Nyang'oma Kogelo]].<ref name="autogenerated2" /><ref>{{cite news|author=David R Arnott |url=https://www.nbcnews.com/news/photo/obamas-old-school-his-ancestral-village-world-reacts-us-presidential-flna1C6912948 |title=From Obama's old school to his ancestral village, world reacts to US presidential election |work=NBC News |access-date=January 16, 2020}}</ref> Obama's parents met in 1960 in a [[Russian language]] class at the [[University of Hawaii at Manoa]], where his father was a foreign student on a scholarship.<ref name="Jones 2007">{{cite news |author = Jones, Tim |date = March 27, 2007 |title = Barack Obama: Mother not just a girl from Kansas; Stanley Ann Dunham shaped a future senator |newspaper = [[Chicago Tribune]] |page = 1 (Tempo) |url=http://gbppr.dyndns.org/~gbpprorg/obama/barack.mother.txt |url-status=dead |archive-url=https://web.archive.org/web/20170207112933/http://gbppr.dyndns.org/~gbpprorg/obama/barack.mother.txt |archive-date = February 7, 2017 }}</ref><ref name="Obama 1995, 2004, pp. 9–10">Obama (1995, 2004), pp. 9–10.
+* Scott (2011), pp. 80–86.
+* Jacobs (2011), pp. 115–118.
+* Maraniss (2012), pp. 154–160.</ref> The couple married in [[Wailuku, Hawaii]], on February 2, 1961, six months before Obama was born.<ref name="Ripley 2008">{{cite news |author = Ripley, Amanda |date = April 9, 2008 |title = The story of Barack Obama's mother |magazine = [[Time (magazine)|Time]] |url=http://content.time.com/time/magazine/article/0,9171,1729685,00.html |access-date = April 9, 2007 }}</ref><ref>Scott (2011), p. 86.
+* Jacobs (2011), pp. 125–127.
+* Maraniss (2012), pp. 160–163.</ref>
+
+In late August 1961, a few weeks after he was born, Barack and his mother moved to the [[University of Washington]] in [[Seattle]], where they lived for a year. During that time, Barack's father completed his undergraduate degree in [[economics]] in Hawaii, graduating in June 1962. He left to attend graduate school on a scholarship at [[Harvard University]], where he earned an [[Master of Arts|M.A.]] in economics. Obama's parents divorced in March 1964.<ref>Scott (2011), pp. 87–93.
+* Jacobs (2011), pp. 115–118, 125–127, 133–161.
+* Maraniss (2012), pp. 170–183, 188–189.</ref> Obama Sr. returned to Kenya in 1964, where he married for a third time and worked for the Kenyan government as the Senior Economic Analyst in the Ministry of Finance.<ref>Obama "Dreams from My Father a Story of Race and Inheritance"</ref> He visited his son in Hawaii only once, at Christmas 1971,<ref>Scott (2011), pp. 142–144.
+* Jacobs (2011), pp. 161–177, 227–230.
+* Maraniss (2012), pp. 190–194, 201–209, 227–230.</ref> before he was killed in an automobile accident in 1982, when Obama was 21 years old.<ref>{{cite news |author = Ochieng, Philip |date = November 1, 2004 |title = From home squared to the US Senate: how Barack Obama was lost and found |newspaper = [[The EastAfrican]] |location = Nairobi |url=http://www.nationmedia.com/EastAfrican/01112004/Features/PA2-11.html |archive-date = September 27, 2007 |archive-url=https://web.archive.org/web/20070927223905/http://www.nationmedia.com/EastAfrican/01112004/Features/PA2-11.html }}
+* {{cite news |author = Merida, Kevin |date = December 14, 2007 |title = The ghost of a father |newspaper = The Washington Post |page = A12 |url=https://www.washingtonpost.com/wp-dyn/content/story/2007/12/13/ST2007121301893.html |access-date = June 25, 2008 }}
+* Jacobs (2011), pp. 251–255.
+* Maraniss (2012), pp. 411–417.</ref> Recalling his early childhood, Obama said: "That my father looked nothing like the people around me—that he was black as pitch, my mother white as milk—barely registered in my mind."<ref name="Obama 1995, 2004, pp. 9–10" /> He described his struggles as a young adult to reconcile social perceptions of his multiracial heritage.<ref>{{cite news |author = Serrano, Richard A. |date = March 11, 2007 |title = Obama's peers didn't see his angst |newspaper = Los Angeles Times |page = A20 |url=https://www.latimes.com/news/politics/la-na-obamahawaii11-2007mar11,0,199085,full.story |access-date = March 13, 2007 |url-status=dead |archive-url=https://web.archive.org/web/20081108080115/http://www.latimes.com/news/politics/la-na-obamahawaii11-2007mar11,0,199085,full.story |archive-date = November 8, 2008 }}
+* Obama (1995, 2004), Chapters 4 and 5.</ref>
+
+In 1963, Dunham met [[Lolo Soetoro]] at the [[University of Hawaii]]; he was an [[Native Indonesian|Indonesian]] [[East–West Center]] [[graduate student]] in [[geography]]. The couple married on [[Molokai]] on March 15, 1965.<ref>Scott (2011), pp. 97–103.
+* Maraniss (2012), pp. 195–201, 225–230.</ref> After two one-year extensions of his [[J-1 visa]], Lolo returned to [[Indonesia]] in 1966. His wife and stepson followed sixteen months later in 1967. The family initially lived in the Menteng Dalam neighborhood in the [[Tebet, South Jakarta|Tebet]] district of [[South Jakarta]]. From 1970, they lived in a wealthier neighborhood in the [[Menteng]] district of [[Central Jakarta]].<ref>Maraniss (2012), pp. 195–201, 209–223, 230–244.</ref>
+
+===Education===
+[[File:Barry Soetoro school record.jpg|thumb|Barack Obama's school record in St. Francis of Assisi Catholic Elementary School. Obama was enrolled as "Barry Soetoro" (no. 1), and was wrongly recorded as an Indonesian citizen (no. 3) and a Muslim (no. 4).<ref>{{Cite news|last=Suhartono|first=Anton|date=March 19, 2010|title=Sekolah di SD Asisi, Obama Berstatus Agama Islam|work=Okezone|url=https://nasional.okezone.com/read/2010/03/19/337/313977/sekolah-di-sd-asisi-obama-berstatus-agama-islam|language=Indonesian|access-date=January 21, 2021}}</ref>]]
+At the age of six, Obama and his mother had moved to Indonesia to join his stepfather. From age six to ten, he attended local [[Indonesian Language|Indonesian-language]] schools: ''Sekolah Dasar Katolik Santo Fransiskus Asisi'' (St. Francis of Assisi Catholic Elementary School) for two years and [[State Elementary School Menteng 01|''Sekolah Dasar Negeri Menteng 01'']] (State Elementary School Menteng 01) for one and a half years, supplemented by English-language [[Calvert School]] homeschooling by his mother.<ref>Maraniss (2012), pp. 216, 221, 230, 234–244.</ref><ref>{{cite web |url=https://www.calverteducation.com/calvert/barack-obama-calvert-homeschooler |title = Barack Obama: Calvert Homeschooler?—Calvert Education Blog |publisher = calverteducation.com |access-date = November 25, 2015 |date = January 25, 2014 }}</ref> As a result of his four years in [[Jakarta]], he was able to speak [[Indonesian language|Indonesian]] fluently as a child.<ref>{{cite web |url=https://www.youtube.com/watch?v=JYIK9QtNu3w |title = Wawancara Eksklusif RCTI dengan Barack Obama (Part 2) |date = March 2010 |website = YouTube |access-date = February 12, 2018}}</ref><ref name="in Jakarta" /><ref name="in Jakarta2">{{cite web |title = Obama's Indonesian pleasantries: the video |url=https://languagelog.ldc.upenn.edu/nll/?p=1052 |author = Zimmer, Benjamin |date = January 23, 2009 |access-date = October 7, 2012 |website = Language Log |publisher = [[University of Pennsylvania]] }}</ref> During his time in Indonesia, Obama's stepfather taught him to be resilient and gave him "a pretty hardheaded assessment of how the world works."<ref>{{Cite news |url=https://www.newsweek.com/what-barack-obama-learned-his-father-88011 |title=What Barack Obama Learned from His Father |last=Meacham |first=Jon |date=August 22, 2008 |newspaper=Newsweek |archive-url=https://web.archive.org/web/20170107100237/http://www.newsweek.com/what-barack-obama-learned-his-father-88011?rx=us |archive-date=January 7, 2017 |url-status=live |access-date=January 9, 2017 }}</ref>
+
+In 1971, Obama returned to [[Honolulu]] to live with his maternal grandparents, [[Madelyn Dunham|Madelyn]] and [[Stanley Armour Dunham|Stanley Dunham]]. He attended [[Punahou School]]—a private [[University-preparatory school|college preparatory school]]—with the aid of a scholarship from fifth grade until he graduated from high school in 1979.<ref>{{cite news |author = Serafin, Peter |date = March 21, 2004 |title = Punahou grad stirs up Illinois politics |newspaper = [[Honolulu Star-Bulletin]] |url=http://archives.starbulletin.com/2004/03/21/news/story4.html |access-date = March 20, 2008 }}
+* {{cite news |author = Scott, Janny |date = March 14, 2008 |title = A free-spirited wanderer who set Obama's path |work = The New York Times |page = A1 |url=https://www.nytimes.com/2008/03/14/us/politics/14obama.html |archive-url=https://web.archive.org/web/20080314042735/http://www.nytimes.com/2008/03/14/us/politics/14obama.html |archive-date=March 14, 2008 |url-access=subscription |url-status=live |access-date = November 18, 2011 }}
+* Obama (1995, 2004), Chapters 3 and 4.
+* Scott (2012), pp. 131–134.
+* Maraniss (2012), pp. 264–269.</ref> In his youth, Obama went by the nickname "Barry".<ref>{{cite news |url=https://www.newsweek.com/when-barry-became-barack-84255 |title = When Barry Became Barack |last = Wolffe |first = Richard |date = March 22, 2008 |access-date = March 21, 2016 |work = [[Newsweek]] }}</ref> Obama lived with his mother and half-sister, [[Maya Soetoro-Ng|Maya Soetoro]], in Hawaii for three years from 1972 to 1975 while his mother was a graduate student in [[anthropology]] at the [[University of Hawaii]].<ref>Scott (2011), pp. 139–157.
+* Maraniss (2012), pp. 279–281.</ref> Obama chose to stay in Hawaii when his mother and half-sister returned to Indonesia in 1975, so his mother could begin anthropology field work.<ref>Scott (2011), pp. 157–194.
+* Maraniss (2012), pp. 279–281, 324–326.</ref> His mother spent most of the next two decades in Indonesia, divorcing Lolo in 1980 and earning a [[PhD]] degree in 1992, before dying in 1995 in Hawaii following unsuccessful treatment for [[ovarian cancer|ovarian]] and [[uterine cancer]].<ref>Scott (2011), pp. 214, 294, 317–346.</ref>
+
+Of his years in Honolulu, Obama wrote: "The opportunity that Hawaii offered&nbsp;— to experience a variety of cultures in a climate of mutual respect&nbsp;— became an integral part of my world view, and a basis for the values that I hold most dear."<ref>{{cite news |author = Reyes, B.J. |date = February 8, 2007 |title = Punahou left lasting impression on Obama |newspaper = Honolulu Star-Bulletin |url=http://archives.starbulletin.com/2007/02/08/news/story02.html |access-date = February 10, 2007 |quote = As a teenager, Obama went to parties and sometimes sought out gatherings on military bases or at the University of Hawaii that were attended mostly by blacks. }}</ref> Obama has also written and talked about using [[alcohol (drug)|alcohol]], [[marijuana]], and [[cocaine]] during his teenage years to "push questions of who I was out of my mind."<ref>{{cite news|author=Elliott, Philip |agency=Associated Press |date=November 21, 2007 |title=Obama gets blunt with N.H. students |newspaper=[[The Boston Globe]] |page=8A |url=http://articles.boston.com/2007-11-21/news/29233371_1_barack-obama-education-plan-campaign-trail |access-date=May 18, 2012 |url-status=dead |archive-url=https://web.archive.org/web/20120407214401/http://articles.boston.com/2007-11-21/news/29233371_1_barack-obama-education-plan-campaign-trail |archive-date=April 7, 2012 }}</ref> Obama was also a member of the "choom gang", a self-named group of friends who spent time together and occasionally smoked marijuana.<ref>{{cite news |last=Karl |first=Jonathan |work = ABC News |date = May 25, 2012 |title = Obama and his pot-smoking "choom gang" |url=https://abcnews.go.com/blogs/politics/2012/05/obama-and-his-pot-smoking-choom-gang/ |access-date = May 25, 2012 }}
+* {{cite book |first = Barack |last = Obama |year = 2004 |orig-date = 1995 |url=https://books.google.com/books?id=HRCHJp-V0QUC&pg=PA93 |title = Dreams from My Father: A Story of Race and Inheritance |pages = 93–94 |access-date = June 3, 2016 |isbn = 978-0-307-39412-5 }}
+* {{cite book |first = David |last = Maraniss |year = 2012 |url=https://books.google.com/books?id=Wnna9CLtblAC&q=choom |title = Barack Obama: The Story |at = pages with "choom gang" |access-date = June 3, 2016 |isbn = 978-1-4391-6753-3 }}
+* for analysis of the political impact of the quote and Obama's more recent admission that he smoked marijuana as a teenager ("When I was a kid, I inhaled"), see:
+* {{cite news |author = Seelye, Katharine Q. |date = October 24, 2006 |title = Obama offers more variations from the norm |newspaper = The New York Times |page = A21 |url=https://query.nytimes.com/gst/fullpage.html?res=9D07E2DB173FF937A15753C1A9609C8B63 |access-date = October 29, 2006 }}
+* {{cite news |author = Romano, Lois |date = January 3, 2007 |title = Effect of Obama's candor remains to be seen |newspaper = The Washington Post |page = A1 |url=https://www.washingtonpost.com/wp-dyn/content/article/2007/01/02/AR2007010201359.html |access-date = January 14, 2007 }}</ref><ref>{{cite web |url=https://www.pbs.org/video/frontline-choice-2012-again/ |title = FRONTLINE The Choice 2012 |publisher = PBS |date = October 9, 2012 |access-date = October 29, 2012 }}</ref>
+
+====College and research jobs====
+
+After graduating from high school in 1979, Obama moved to [[Los Angeles]] to attend [[Occidental College]] on a full scholarship. In February 1981, Obama made his first public speech, calling for Occidental to participate in the [[disinvestment from South Africa]] in response to that nation's policy of [[apartheid]].<ref name="Occidental" /> In mid-1981, Obama traveled to Indonesia to visit his mother and half-sister Maya, and visited the families of college friends in [[Pakistan]] for three weeks.<ref name="Occidental" /> Later in 1981, he [[College transfer|transferred]] to [[Columbia University]] in [[New York City]] as a [[Junior (education year)|junior]], where he majored in [[political science]] with a specialty in [[international relations]]<ref>{{cite news |author = Boss-Bicak, Shira |date = January 2005 |title = Barack Obama '83 |magazine = Columbia College Today |issn = 0572-7820 |url=http://www.college.columbia.edu/cct_archive/jan05/cover.php |access-date = October 1, 2006 |archive-url=https://web.archive.org/web/20080905121815/http://www.college.columbia.edu/cct_archive/jan05/cover.php |archive-date = September 5, 2008 |url-status=dead }}</ref> and in [[English literature]]<ref>{{Cite news|url=https://obamawhitehouse.archives.gov/the-press-office/2014/06/26/remarks-president-town-hall|title=Remarks by the President in Town Hall|date=June 26, 2014|via=[[NARA|National Archives]]|work=[[whitehouse.gov]]|access-date=October 15, 2016}}</ref> and lived off-campus on West 109th Street.<ref>{{cite news |url=https://nymag.com/arts/all/approvalmatrix/approval-matrix-2012-8-27/ |title = The Approval Matrix |date = August 27, 2012 |work = New York }}</ref> He graduated with a [[Bachelor of Arts]] degree in 1983 and a 3.7 [[Grading (education)#United States|GPA]]. After graduating, Obama worked for about a year at the [[Business International Corporation]], where he was a financial researcher and writer,<ref>{{cite news |url=https://www.npr.org/templates/story/story.php?storyId=92337754 |title=Obama's Early Brush With Financial Markets |last=Horsley |first=Scott |date=July 9, 2008 |publisher=[[NPR]] |access-date=July 17, 2017}}</ref><ref>{{cite web |author = Obama, Barack |year = 1998 |title = Curriculum vitae |publisher = The University of Chicago Law School |url=http://www.law.uchicago.edu/faculty/obama/cv.html |archive-date = May 9, 2001 |archive-url=https://web.archive.org/web/20010509024017/http://www.law.uchicago.edu/faculty/obama/cv.html |access-date = October 1, 2006 }}
+* {{cite news |author = Issenberg, Sasha |date = August 6, 2008 |title = Obama shows hints of his year in global finance; Tied markets to social aid |newspaper = The Boston Globe |page = 1A |url=https://www.boston.com/news/nation/articles/2008/08/06/obama_shows_hints_of_his_year_in_global_finance/ |access-date = August 6, 2008 |archive-url=https://web.archive.org/web/20091107145054/http://www.boston.com/news/nation/articles/2008/08/06/obama_shows_hints_of_his_year_in_global_finance?page=full |archive-date = November 7, 2009 |url-status=dead }}</ref> then as a project coordinator for the [[New York Public Interest Research Group]] on the [[City College of New York]] campus for three months in 1985.<ref>{{cite news |author = Scott, Janny |date = July 30, 2007 |title = Obama's account of New York often differs from what others say |newspaper = The New York Times |page = B1 |url=https://www.nytimes.com/2007/10/30/us/politics/30obama.html |archive-url=https://web.archive.org/web/20071031000738/http://www.nytimes.com/2007/10/30/us/politics/30obama.html |archive-date=October 31, 2007 |url-access=subscription |url-status=live |access-date = July 31, 2007 }}
+* Obama (1995, 2004), pp. 133–140.
+* Mendell (2007), pp. 62–63.</ref><ref name="Who's Who 2008">{{cite book |editor = Chassie, Karen |year = 2007 |title = Who's Who in America, 2008 |page = 3468 |place = New Providence, NJ |publisher = Marquis Who's Who |isbn = 978-0-8379-7011-0 }}</ref><ref>{{cite news |url=http://www.newsday.com/news/new-york/obama-stood-out-even-during-brief-1985-nypirg-job-1.885513 |title = Obama stood out, even during brief 1985 NYPIRG job |date = November 9, 2008 |newspaper = Newsday |first = Jason |last = Fink }}</ref>
+
+====Community organizer and Harvard Law School====
+
+Two years after graduating from Columbia, Obama moved from New York to Chicago when he was hired as director of the [[Developing Communities Project]], a church-based community organization originally comprising eight Catholic parishes in [[Roseland, Chicago|Roseland]], [[West Pullman, Chicago|West Pullman]], and [[Riverdale, Chicago|Riverdale]] on Chicago's [[South Side, Chicago|South Side]]. He worked there as a community organizer from June 1985 to May 1988.<ref name="Who's Who 2008" /><ref>{{cite magazine|last=Lizza |first=Ryan |date=March 19, 2007 |title=The agitator: Barack Obama's unlikely political education |magazine=The New Republic |volume=236 |issue=12 |pages=22–26, 28–29 |issn=0028-6583 |url=http://www.tnr.com/article/the-agitator-barack-obamas-unlikely-political-education |access-date=August 21, 2007 }}
+* {{cite news|last1=Secter |first1=Bob |last2=McCormick |first2=John |date=March 30, 2007 |title=Portrait of a pragmatist |newspaper=Chicago Tribune |page=1 |url=https://www.chicagotribune.com/news/nationworld/chi-0703300121mar30-archive,0,2491692,full.story |archive-url=https://web.archive.org/web/20091214172131/http://www.chicagotribune.com/news/nationworld/chi-0703300121mar30-archive%2C0%2C2491692%2Cfull.story |access-date=May 18, 2012 |archive-date=December 14, 2009 |url-status=dead }}
+* Obama (1995, 2004), pp. 140–295.
+* Mendell (2007), pp. 63–83.</ref> He helped set up a job training program, a college preparatory tutoring program, and a tenants' rights organization in [[Altgeld Gardens Homes (Chicago, Illinois)|Altgeld Gardens]].<ref name="Harvard Law 1990a">{{cite news |last = Matchan |first = Linda |date = February 15, 1990 |title = A Law Review breakthrough |newspaper = The Boston Globe |page = 29 |url=https://www.boston.com/news/politics/2008/articles/1990/02/15/a_law_review_breakthrough |access-date = June 15, 2008 }}
+* {{cite news |last = Corr |first = John |date = February 27, 1990 |title = From mean streets to hallowed halls |newspaper = The Philadelphia Inquirer |page = C01 |format = paid archive |url=http://nl.newsbank.com/nl-search/we/Archives?p_multi=PI%7CDN%7C&p_product=PHNP&p_theme=phnp&p_action=search&p_maxdocs=200&s_dispstring=Author%28John%20Corr%29%20AND%20date%2802/27/1990%20to%2002/27/1990%29%20AND%20date%28all%29&p_field_advanced-0=Author&p_text_advanced-0=%28John%20Corr%29&p_bool_advanced-1=AND&p_params_advanced-1=date:B,E&p_field_advanced-1=YMD_date&p_text_advanced-1=%2802/27/1990%20to%2002/27/1990%29Êl_numdocs=20&p_perpage=10&p_sort=YMD_date:DÊl_useweights=no |access-date = June 6, 2008 }}</ref> Obama also worked as a consultant and instructor for the [[Gamaliel Foundation]], a community organizing institute.<ref>{{cite magazine |last = Obama |first = Barack |date = August–September 1988 |title = Why organize? Problems and promise in the inner city |magazine = Illinois Issues |volume = 14 |issue = 8–9 |pages = 40–42 |issn = 0738-9663 }} reprinted in:{{break}}{{cite book |editor = Knoepfle, Peg |year = 1990 |title = After Alinsky: community organizing in Illinois |place = Springfield, IL |publisher = Sangamon State University |pages = 35–40 |isbn = 978-0-9620873-3-2 |quote = He has also been a consultant and instructor for the Gamaliel Foundation, an organizing institute working throughout the Midwest. }}</ref> In mid-1988, he traveled for the first time in Europe for three weeks and then for five weeks in Kenya, where he met many of his [[Family of Barack Obama#Paternal relations|paternal relatives]] for the first time.<ref name="Obama 2012">{{cite book |last = Obama |first = Auma |year = 2012 |title = And then life happens: a memoir |location = New York |publisher = St. Martin's Press |isbn = 978-1-250-01005-6 |pages = 189–208, 212–216 }}</ref><ref>Obama (1995, 2004), pp. 299–437.
+* Maraniss (2012), pp. 564–570.</ref>
+{{external media | float = right | video1 = [http://bostonlocaltv.org/catalog/V_UDAMVZGA4JEY06N Derrick Bell threatens to leave Harvard], April 24, 1990, 11:34, [[WGBH Educational Foundation|Boston TV Digital Archive]]<ref name="wgbh">{{cite news |url=http://bostonlocaltv.org/catalog/V_UDAMVZGA4JEY06N |title=Ten O'Clock News; Derrick Bell threatens to leave Harvard |date=April 24, 1990 |work=[[WGBH Educational Foundation|WGBH]], [[American Archive of Public Broadcasting]] |publisher=WGBH and the [[Library of Congress]] |location=Boston and Washington, D.C. |access-date=September 23, 2016}}</ref> Student Barack Obama introduces Professor Derrick Bell starting at 6:25. }}
+
+Despite being offered a full scholarship to [[Northwestern University School of Law]], Obama enrolled at [[Harvard Law School]] in the fall of 1988, living in nearby [[Somerville, Massachusetts]].<ref>{{cite news |newspaper=Somerville Scout |issue=January/February 2014 |page=26 |title=Something in the Water |url=https://scoutsomerville.com/feature-something-in-the-water/ |author1=Joey Del Ponte |author2=Somerville Scout Staff |quote=Barack Obama lived in the big, ivy-covered brick building at 365 Broadway{{nbs}}... From 1988 to 1991, the future president resided in a basement apartment while attending Harvard Law School. |access-date=January 1, 2020 |archive-date=January 1, 2020 |archive-url=https://web.archive.org/web/20200101163528/https://scoutsomerville.com/feature-something-in-the-water/ |url-status=dead }}</ref> He was selected as an editor of the ''[[Harvard Law Review]]'' at the end of his first year,<ref name="Harvard Law 2007">{{cite news |first1 = Michael |last1 = Levenson |first2 = Jonathan |last2 = Saltzman |date = January 28, 2007 |title = At Harvard Law, a unifying voice |newspaper = Boston Globe |page = 1A |url=http://archive.boston.com/news/local/articles/2007/01/28/at_harvard_law_a_unifying_voice/ |access-date = June 15, 2008 }}
+* {{cite news |author = Kantor, Jodi |date = January 28, 2007 |title = In law school, Obama found political voice |newspaper = The New York Times |page = A1 |url=https://www.nytimes.com/2007/01/28/us/politics/28obama.html |archive-url=https://web.archive.org/web/20070307091848/http://www.nytimes.com/2007/01/28/us/politics/28obama.html |archive-date=March 7, 2007 |url-access=subscription |url-status=live |access-date = June 15, 2008 }}
+* {{cite news |author = Mundy, Liza |date = August 12, 2007 |title = A series of fortunate events |newspaper = The Washington Post |page = W10 |url=https://www.washingtonpost.com/wp-dyn/content/article/2007/08/08/AR2007080802038_pf.html |access-date = June 15, 2008 }}
+* Mendell (2007), pp. 80–92.</ref> president of the journal in his second year,<ref name="Harvard Law 1990a" /><ref name="Harvard Law 1990b">{{cite news |author = Butterfield, Fox |date = February 6, 1990 |title = First black elected to head Harvard's Law Review |newspaper = The New York Times |page = A20 |url = https://www.nytimes.com/1990/02/06/us/first-black-elected-to-head-harvard-s-law-review.html |access-date = June 15, 2008 }}
+* {{cite news |author = Ybarra, Michael J |date = February 7, 1990 |title = Activist in Chicago now heads Harvard Law Review |newspaper = Chicago Tribune |page = 3 |url = https://www.chicagotribune.com/news/ct-xpm-1990-02-07-9001110408-story.html |access-date = October 29, 2011 }}
+* {{cite news |author = Drummond, Tammerlin |date = March 12, 1990 |title = Barack Obama's law; Harvard Law Review's first black president plans a life of public service |newspaper = Los Angeles Times |page = E1 |format = paid archive |url = https://pqasb.pqarchiver.com/latimes/access/60017156.html?dids=60017156:60017156&FMT=ABS&FMTS=ABS:FT |access-date = June 15, 2008 |archive-date = June 17, 2008 |archive-url = https://web.archive.org/web/20080617150504/http://pqasb.pqarchiver.com/latimes/access/60017156.html?dids=60017156:60017156&FMT=ABS&FMTS=ABS:FT |url-status = dead }}
+* {{cite magazine |last = Evans |first = Gaynelle |date = March 15, 1990 |title = Opening another door: The saga of Harvard's Barack H. Obama |magazine = Black Issues in Higher Education |volume = 7 |issue = 1 |page = 5 |issn = 0742-0277 |url = https://diverseeducation.com/article/11791/ |access-date = May 18, 2012 }}
+* {{cite news |author = Pugh, Allison J. |agency = Associated Press |date = April 18, 1990 |title = Law Review's first black president aims to help poor |newspaper = The Miami Herald |page = C01 |url = https://allisonpugh.weebly.com/uploads/4/4/7/8/44787215/miami_herald__22law_review_president_22.pdf |access-date = January 1, 2020 }}</ref> and research assistant to the constitutional scholar [[Laurence Tribe]] while at Harvard for two years.<ref>{{YouTube|wzmmBZ7i4BQ}}</ref> During his summers, he returned to Chicago, where he worked as a [[Associate attorney#Summer associates|summer associate]] at the law firms of [[Sidley Austin]] in 1989 and [[Hopkins & Sutter]] in 1990.<ref>{{cite news |author = Aguilar, Louis |date = July 11, 1990 |title = Survey: Law firms slow to add minority partners |archive-url=https://web.archive.org/web/20080929145015/https://pqasb.pqarchiver.com/chicagotribune/access/28774085.html?dids=28774085:28774085&FMT=ABS&FMTS=ABS:FT |archive-date=September 29, 2008 |newspaper = Chicago Tribune |page = 1 (Business) |url=https://pqasb.pqarchiver.com/chicagotribune/access/28774085.html?dids=28774085:28774085&FMT=ABS&FMTS=ABS:FT |access-date = June 15, 2008 }}</ref> After graduating with a [[Juris Doctor]] ''[[magna cum laude]]''<ref name="Juris Doctor" /> from Harvard in 1991, he returned to Chicago.<ref name="Harvard Law 2007" /> Obama's election as the [[List of African-American firsts|first black president of the ''Harvard Law Review'']] gained national media attention<ref name="Harvard Law 1990a" /><ref name="Harvard Law 1990b" /> and led to a publishing contract and advance for a book about race relations,<ref name="Scott 2008a">{{cite news |author = Scott, Janny |date = May 18, 2008 |title = The story of Obama, written by Obama |newspaper = The New York Times |page = A1 |url=https://www.nytimes.com/2008/05/18/us/politics/18memoirs.html |access-date = June 15, 2008 }}
+* Obama (1995, 2004), pp. xiii–xvii.</ref> which evolved into a personal memoir. The manuscript was published in mid-1995 as ''[[Dreams from My Father]]''.<ref name="Scott 2008a" />
+
+====University of Chicago Law School====
+
+In 1991, Obama accepted a two-year position as Visiting Law and Government Fellow at the [[University of Chicago Law School]] to work on his first book.<ref name="Scott 2008a" /><ref name="Fellow" /> He then taught [[constitutional law]] at the University of Chicago Law School for twelve years, first as a [[lecturer]] from 1992 to 1996, and then as a senior lecturer from 1996 to 2004.<ref>{{cite web |date = March 27, 2008 |title = Statement regarding Barack Obama |publisher = University of Chicago Law School |url=http://www.law.uchicago.edu/media/index.html |access-date = June 5, 2008 |archive-url=https://web.archive.org/web/20080608225931/http://www.law.uchicago.edu/media/index.html |archive-date = June 8, 2008 |url-status=dead }}
+* {{cite web |last=Miller |first=Joe |date = March 28, 2008 |title = Was Barack Obama really a constitutional law professor? |work=FactCheck.org |url=https://www.factcheck.org/2008/03/obama-a-constitutional-law-professor/ |access-date = May 18, 2012 }}
+* {{cite web |last=Holan |first=Angie Drobnic |date=March 7, 2008 |title = Obama's 20 years of experience |work=PolitiFact.com |url=https://www.politifact.com/truth-o-meter/article/2008/mar/07/obamas-20-years-experience/ |access-date = June 10, 2008 }}</ref>
+
+From April to October 1992, Obama directed Illinois's [[Project Vote]], a [[voter registration campaign]] with ten staffers and seven hundred volunteer registrars; it achieved its goal of registering 150,000 of 400,000 unregistered African Americans in the state, leading ''[[Crain's Chicago Business]]'' to name Obama to its 1993 list of "40 under Forty" powers to be.<ref name="Forty" />
+
+===Family and personal life===
+
+{{Main|Family of Barack Obama}}
+
+In a 2006 interview, Obama highlighted the diversity of [[family of Barack Obama|his extended family]]: "It's like a little mini-United Nations," he said. "I've got relatives who look like [[Bernie Mac]], and I've got relatives who look like [[Margaret Thatcher]]."<ref>{{cite web |url=http://www.oprah.com/slideshow/oprahshow/oprahshow1_ss_20061018/10 |title = Keeping Hope Alive: Barack Obama Puts Family First |date = October 18, 2006|website = The Oprah Winfrey Show |access-date = June 24, 2008}}</ref> Obama has a half-sister with whom he was raised ([[Maya Soetoro-Ng]]) and seven other half-siblings from his Kenyan father's family—six of them living.<ref>{{cite news |first=Scott |last=Fornek |title=Half Siblings: 'A Complicated Family' |date=September 9, 2007 |url=http://www.suntimes.com/news/politics/obama/familytree/545462,BSX-News-wotrees09.stng |archive-url=https://www.webcitation.org/5msGZ6sKn?url=http://www.suntimes.com/news/politics/obama/familytree/545462,BSX-News-wotrees09.stng |archive-date=January 18, 2010 |work=Chicago Sun-Times |access-date=June 24, 2008 |url-status=dead}} See also: {{cite news |url=http://www.suntimes.com/images/cds/special/family_tree.html |archive-url=https://web.archive.org/web/20080703042659/http://www.suntimes.com/images/cds/special/family_tree.html |archive-date=July 3, 2008 |title=Interactive Family Tree |date=September 9, 2007 |work=Chicago Sun-Times |access-date=June 24, 2008 }}</ref> Obama's mother was survived by her Kansas-born mother, [[Madelyn Dunham]],<ref>{{cite news |first=Scott |last=Fornek |title=Madelyn Payne Dunham: 'A Trailblazer' |date=September 9, 2007 |url=http://www.suntimes.com/news/politics/obama/familytree/545449,BSX-News-wotreeee09.stng |archive-url=https://web.archive.org/web/20090304232433/http://www.suntimes.com/news/politics/obama/familytree/545449,BSX-News-wotreeee09.article |archive-date=March 4, 2009 |work=Chicago Sun-Times |access-date=June 24, 2008 |url-status=live}}</ref> until her death on November 2, 2008,<ref>{{cite news |url=http://www.cnn.com/2008/POLITICS/11/03/obama.grandma/index.html |title = Obama's grandmother dies after battle with cancer |publisher = CNN |access-date = November 4, 2008 |date = November 3, 2008 |archive-url=https://web.archive.org/web/20081103235343/http://www.cnn.com/2008/POLITICS/11/03/obama.grandma/index.html |archive-date = November 3, 2008 |url-status=live }}</ref> two days before his election to the presidency. Obama also has roots in Ireland; he met with his Irish cousins in [[Moneygall]] in May 2011.<ref>{{cite news |url=https://www.huffingtonpost.com/megan-smolenyak-smolenyak/tracing-barack-obamas-roo_b_859151.html |title = Tracing Barack Obama's Roots to Moneygall |date = May 9, 2011 |work = The Huffington Post |first = Megan |last = Smolenyak }}</ref> In ''Dreams from My Father'', Obama ties his mother's family history to possible Native American ancestors and distant relatives of [[Jefferson Davis]], [[President of the Confederate States of America]] during the [[American Civil War]]. He also shares distant ancestors in common with [[George W. Bush]] and [[Dick Cheney]], among others.<ref>Obama (1995, 2004), p. 13. For reports on Obama's maternal genealogy, including slave owners, Irish connections, and common ancestors with George W. Bush, [[Dick Cheney]], and [[Harry S. Truman]], see: {{cite news|first1=David |last1=Nitkin |first2=Harry |last2=Merritt |title=A New Twist to an Intriguing Family History |date=March 2, 2007 |url=http://www.baltimoresun.com/news/nationworld/politics/bal-te.obama02mar02,0,3453027.story |archive-url=https://web.archive.org/web/20070930033339/http://www.baltimoresun.com/news/nationworld/politics/bal-te.obama02mar02%2C0%2C3453027.story |archive-date=September 30, 2007 |work=The Baltimore Sun |access-date=June 24, 2008 |url-status=dead }}</ref><ref>{{cite news|first=Mary |last=Jordan |title=Tiny Irish Village Is Latest Place to Claim Obama as Its Own |date=May 13, 2007 |url=https://www.washingtonpost.com/wp-dyn/content/article/2007/05/12/AR2007051201551.html |newspaper=The Washington Post |access-date=June 24, 2008 }}</ref><ref>{{cite news|title=Obama's Family Tree Has a Few Surprises |date=September 8, 2007 |publisher=CBS 2 (Chicago) |url=http://cbs2chicago.com/topstories/Barack.Obama.family.2.339709.html |agency=Associated Press |access-date=June 24, 2008 |archive-url=https://web.archive.org/web/20080602215833/http://cbs2chicago.com/topstories/Barack.Obama.family.2.339709.html |archive-date=June 2, 2008 }}</ref>
+
+Obama lived with anthropologist [[Sheila Miyoshi Jager]] while he was a community organizer in Chicago in the 1980s.<ref name="theindependentbeforemichelle">{{cite news|last1=Hosie|first1=Rachel|title=BEFORE MICHELLE: THE STORY OF BARACK OBAMA'S PROPOSAL TO SHEILA MIYOSHI JAGER|url=https://www.independent.co.uk/life-style/before-michelle-barack-obama-sheila-miyoshi-jager-engagement-chicago-us-president-david-j-garrow-a7714771.html|access-date=May 11, 2017|work=The Independent|date=May 3, 2017}}</ref> He proposed to her twice, but both Jager and her parents turned him down.<ref name="theindependentbeforemichelle" /><ref name="tobiasoberlincollegeprofessor">{{cite news|last1=Tobias|first1=Andrew J.|title=Oberlin College professor received unsuccessful marriage proposal from Barack Obama in 1980s, new biography reveals|url=http://www.cleveland.com/politics/index.ssf/2017/05/oberlin_college_professor_rece.html|access-date=May 11, 2017|work=The Plain Dealer|date=May 3, 2017}}</ref> The relationship was not made public until May 2017, several months after his presidency had ended.<ref name="tobiasoberlincollegeprofessor" />
+
+[[File:Obama family portrait in the Green Room.jpg|thumb|Obama poses in the [[Green Room (White House)|Green Room]] of the White House with wife Michelle and daughters Sasha and Malia, 2009]]
+In June 1989, Obama met [[Michelle Obama|Michelle Robinson]] when he was employed as a summer associate at the Chicago law firm of [[Sidley Austin]].<ref>Obama (2006), pp. 327–332. See also: {{cite news |first = Sarah |last = Brown |title = Obama '85 masters balancing act |work = The Daily Princetonian |url=http://www.dailyprincetonian.com/2005/12/07/14049 |date = December 7, 2005 |access-date = February 9, 2009 |archive-url=https://web.archive.org/web/20090220165725/http://www.dailyprincetonian.com/2005/12/07/14049/ |archive-date = February 20, 2009 }}</ref> Robinson was assigned for three months as Obama's adviser at the firm, and she joined him at several group social functions but declined his initial requests to date.<ref>Obama (2006), p. 329.</ref> They began dating later that summer, became engaged in 1991, and were married on October 3, 1992.<ref>{{cite news |author=Fornek, Scott |title=Michelle Obama: 'He Swept Me Off My Feet' |date=October 3, 2007 |url=http://www.suntimes.com/news/politics/obama/585261,CST-NWS-wedding03.stng |archive-url=https://web.archive.org/web/20091208051056/http://www.suntimes.com/news/politics/obama/585261,CST-NWS-wedding03.stng |archive-date=December 8, 2009 |work=Chicago Sun-Times |access-date=April 28, 2008 |url-status=dead}}</ref> After suffering a miscarriage, Michelle underwent [[in vitro fertilization]] to conceive their children.<ref>{{cite news|url=https://www.telegraph.co.uk/news/2018/11/09/michelle-obama-had-miscarriage-used-ivf-conceive-girls/ |archive-url=https://ghostarchive.org/archive/20220110/https://www.telegraph.co.uk/news/2018/11/09/michelle-obama-had-miscarriage-used-ivf-conceive-girls/ |archive-date=January 10, 2022 |url-access=subscription |url-status=live|title=Michelle Obama had miscarriage, used IVF to conceive girls|first=Ben|last=Riley-Smith|date=November 9, 2018|access-date=November 15, 2018|newspaper=The Telegraph}}{{cbignore}}</ref> The couple's first daughter, Malia Ann, was born in 1998,<ref>{{cite news |url=http://www.politico.com/blogs/jonathanmartin/0708/Born_on_the_4th_of_July.html |title = Born on the 4th of July |date = July 4, 2008 |access-date = July 10, 2008 |work = Politico |last = Martin |first = Jonathan |archive-url=https://web.archive.org/web/20080710073536/http://www.politico.com/blogs/jonathanmartin/0708/Born_on_the_4th_of_July.html |archive-date = July 10, 2008 |url-status=live }}</ref> followed by a second daughter, Natasha ("Sasha"), in 2001.<ref>Obama (1995, 2004), p. 440, and Obama (2006), pp. 339–340. See also: {{cite web |title = Election 2008 Information Center: Barack Obama |url=http://www.gannettnewsservice.com/?cat=153 |publisher = Gannett News Service |access-date = April 28, 2008 }}</ref> The Obama daughters attended the [[University of Chicago Laboratory Schools]]. When they moved to Washington, D.C., in January 2009, the girls started at the [[Sidwell Friends School]].<ref>{{cite web |url=http://iht.com/articles/ap/2008/11/22/america/Obama-School.php |archive-url=https://web.archive.org/web/20090129194323/http://iht.com/articles/ap/2008/11/22/america/Obama-School.php |title = Obamas choose private Sidwell Friends School |website = International Herald Tribune |date = November 22, 2008 |access-date = July 2, 2015 |archive-date = January 29, 2009 }}</ref> The Obamas had two [[Portuguese Water Dog]]s; the first, a male named [[Bo (dog)|Bo]], was a gift from Senator [[Ted Kennedy]].<ref>{{cite news |url=https://www.nytimes.com/2009/04/13/us/politics/13obama.html |archive-url=https://web.archive.org/web/20090416023426/http://www.nytimes.com/2009/04/13/us/politics/13obama.html |archive-date=April 16, 2009 |url-access=subscription |url-status=live |title = One Obama Search Ends With a Puppy Named Bo |work = The New York Times |date = April 13, 2009 |access-date = December 22, 2010 |first = Helene |last = Cooper }}</ref> In 2013, Bo was joined by [[Sunny (dog)|Sunny]], a female.<ref name=Feldmann>{{Cite journal |last = Feldmann |first = Linda |title = New little girl arrives at White House. Meet Sunny Obama. (+video) |url=http://www.csmonitor.com/USA/DC-Decoder/Decoder-Wire/2013/0820/New-little-girl-arrives-at-White-House.-Meet-Sunny-Obama.-video |journal = Christian Science Monitor |access-date = August 20, 2013 |date = August 20, 2013 }}</ref> Bo died of cancer on May 8, 2021.<ref>{{Cite news|last=Wang|first=Amy|date=May 8, 2021|title=Obamas announce death of dog Bo, 'a true friend and loyal companion'|url=https://www.washingtonpost.com/science/2021/05/08/obama-dog-bo-dies/|access-date=May 8, 2021|newspaper=The Washington Post}}</ref>
+
+[[File:Barack Obama playing basketball with members of Congress and Cabinet secretaries 2.jpg|thumb|upright|left|alt=Obama about to take a shot while three other players look at him. One of those players attempts to block Obama.|Obama playing in a [[Pick-up game|pickup game]] on the [[White House]] basketball court, 2009]]
+Obama is a supporter of the [[Chicago White Sox]], and he threw out the first pitch at the [[2005 American League Championship Series|2005 ALCS]] when he was still a senator.<ref>{{cite news |title = Barack Obama: White Sox 'serious' ball |date = August 25, 2008 |first = Mark |last = Silva |work = Chicago Tribune |url=http://www.swamppolitics.com/news/politics/blog/2008/08/barack_obama_white_sox_serious.html |archive-url=https://web.archive.org/web/20080829134235/http://www.swamppolitics.com/news/politics/blog/2008/08/barack_obama_white_sox_serious.html |archive-date = August 29, 2008 }}</ref> In 2009, he threw out the ceremonial first pitch at the [[2009 Major League Baseball All-Star Game|All-Star Game]] while wearing a White Sox jacket.<ref>{{cite web |title = Barack Obama Explains White Sox Jacket, Talks Nats in All-Star Booth Visit |date = July 14, 2009 |publisher = MLB Fanhouse |url=http://www.yardbarker.com/all_sports/articles/barack_obama_explains_white_sox_jacket_talks_nats_in_all_star_booth_visit/803700 |access-date = December 6, 2009 |archive-url=https://web.archive.org/web/20120704194211/http://www.yardbarker.com/all_sports/articles/barack_obama_explains_white_sox_jacket_talks_nats_in_all_star_booth_visit/803700 |archive-date = July 4, 2012 |url-status = dead }}</ref> He is also primarily a [[Chicago Bears]] football fan in the [[National Football League|NFL]], but in his childhood and adolescence was a [[Steeler Nation|fan of the Pittsburgh Steelers]], and rooted for them ahead of their victory in [[Super Bowl XLIII]] 12 days after he took office as president.<ref name="Steelers">{{cite news |last = Branigin |first = William |title = Steelers Win Obama's Approval |newspaper = The Washington Post |date = January 30, 2009 |url=https://www.washingtonpost.com/wp-dyn/content/article/2009/01/29/AR2009012903196.html |quote = But other than the Bears, the Steelers are probably the team that's closest to my heart. }}</ref> In 2011, Obama invited the [[1985 Chicago Bears season|1985 Chicago Bears]] to the White House; the team had not visited the White House after their [[Super Bowl XX|Super Bowl win]] in 1986 due to the [[Space Shuttle Challenger disaster]].<ref>{{cite web |last = Mayer |first = Larry |url=http://www.chicagobears.com/news/article-1/85-Bears-honored-by-President-Obama-at-White-House/A3C494F7-6681-44BB-850A-61EEE18315E4 |title = 1985 Bears honored by President Obama |publisher = [[Chicago Bears]] |date = October 7, 2011 |access-date = November 4, 2012 |archive-url=https://web.archive.org/web/20130507094538/http://www.chicagobears.com/news/article-1/85-Bears-honored-by-President-Obama-at-White-House/A3C494F7-6681-44BB-850A-61EEE18315E4 |archive-date = May 7, 2013 |url-status=dead }}</ref> He plays basketball, a sport he participated in as a member of his high school's varsity team,<ref>{{cite news |first = Jodi |last = Kantor |title = One Place Where Obama Goes Elbow to Elbow |date = June 1, 2007 |url=https://www.nytimes.com/2007/06/01/us/politics/01hoops.html |work = The New York Times |access-date = April 28, 2008 |archive-url=https://web.archive.org/web/20090401222632/http://www.nytimes.com/2007/06/01/us/politics/01hoops.html|archive-date=April 1, 2009 |url-status=live }} See also: {{cite news |title = The Love of the Game |format = video |date = April 15, 2008 |work = Real Sports with Bryant Gumbel |publisher = HBO |url=http://www.hbo.com/real-sports-with-bryant-gumbel/episodes#/real-sports-with-bryant-gumbel/episodes/0/133-april-15-2008/index.html |access-date = October 12, 2011 }}</ref> and he is left-handed.<ref>{{cite news |url=https://www.nytimes.com/2009/01/22/us/politics/22obama.html |archive-url=https://web.archive.org/web/20090123145020/http://www.nytimes.com/2009/01/22/us/politics/22obama.html |archive-date=January 23, 2009 |url-access=subscription |url-status=live |title = On First Day, Obama Quickly Sets a New Tone |last = Stolberg |first = Sheryl Gay |author2 = Kirkpatrick, David D. |author3 = Shane, Scott |date = January 22, 2009 |work = The New York Times |page = 1 |access-date = September 7, 2012 }}</ref>
+
+In 2005, the Obama family applied the proceeds of a book deal and moved from a [[Hyde Park, Chicago]] condominium to a $1.6{{nbs}}million house (equivalent to ${{Inflation|US|1.6|2005|r=1}}{{nbs}}million in {{Inflation-year|US}}) in neighboring [[Kenwood, Chicago]].<ref>{{cite news |first=Jeff |last=Zeleny |title=The first time around: Sen. Obama's freshman year |date=December 24, 2005 |url=https://www.chicagotribune.com/news/local/chi-051224obama,0,1779783,full.story |work=Chicago Tribune |access-date=April 28, 2008 |archive-url=https://web.archive.org/web/20110513214525/http://www.chicagotribune.com/news/local/chi-051224obama%2C0%2C1779783%2Cfull.story |archive-date=May 13, 2011 |url-status=dead }}</ref> The purchase of an adjacent lot—and sale of part of it to Obama by the wife of developer, campaign donor and friend [[Tony Rezko]]—attracted media attention because of Rezko's subsequent indictment and conviction on political corruption charges that were unrelated to Obama.<ref name="corruption charges" />
+
+In December 2007, ''[[Money (magazine)|Money Magazine]]'' estimated Obama's net worth at $1.3{{nbs}}million (equivalent to ${{Inflation|US|1.3|2007|r=1}}{{nbs}}million in {{Inflation-year|US}}).<ref>{{cite news |title = Obama's Money |date = December 7, 2007 |url=https://money.cnn.com/galleries/2007/moneymag/0712/gallery.candidates.moneymag/5.html |publisher = [[CNNMoney]] |access-date = April 28, 2008 |first = Marlys |last = Harris |archive-url=https://web.archive.org/web/20080424113420/https://money.cnn.com/galleries/2007/moneymag/0712/gallery.candidates.moneymag/5.html |archive-date = April 24, 2008 |url-status=live }}{{break}}See also:{{cite news |first = Zachary A |last = Goldfarb |title = Measuring Wealth of the '08 Candidates |date = March 24, 2007 |url=https://www.washingtonpost.com/wp-dyn/content/article/2007/03/24/AR2007032400305.html |newspaper = The Washington Post |access-date = April 28, 2008 }}</ref> Their 2009 tax return showed a household income of $5.5{{nbs}}million—up from about $4.2{{nbs}}million in 2007 and $1.6{{nbs}}million in 2005—mostly from sales of his books.<ref>{{cite news |first = Jeff |last = Zeleny |title = Book Sales Lifted Obamas' Income in 2007 to a Total of $4.2 Million |url=https://www.nytimes.com/2008/04/17/us/politics/17obama.html |date = April 17, 2008 |work = The New York Times |access-date = April 28, 2008 |archive-url=https://web.archive.org/web/20090416015848/http://www.nytimes.com/2008/04/17/us/politics/17obama.html|archive-date=April 16, 2009 |url-status=live }}</ref><ref>{{cite news |url=https://www.washingtonpost.com/wp-dyn/content/article/2010/04/15/AR2010041504485.html |title = Obamas report $5.5 million in income on 2009 tax return |newspaper = The Washington Post |date = April 16, 2010 |access-date = December 22, 2010 |first1 = Michael D. |last1 = Shear |first2 = David S. |last2 = Hilzenrath }}</ref> On his 2010 income of $1.7{{nbs}}million, he gave 14 percent to non-profit organizations, including $131,000 to [[Fisher House Foundation]], a charity assisting wounded veterans' families, allowing them to reside near where the veteran is receiving medical treatments.<ref>{{cite news |url=https://www.pbs.org/newshour/businessdesk/2011/04/how-much-did-president-obama-m.html |date = April 18, 2011 |title = How Much Did President Obama Make in 2010? |work = [[PBS NewsHour]] |first = Paul |last = Solman |archive-url=https://web.archive.org/web/20110502113725/http://www.pbs.org/newshour/businessdesk/2011/04/how-much-did-president-obama-m.html |archive-date = May 2, 2011 |access-date = January 27, 2012 }}</ref><ref>{{cite news |url=https://www.pbs.org/newshour/rundown/2011/04/the-obamas-gave-131000-to-the-fisher-house-foundation-last-year-what-is-it.html |date = April 27, 2011 |title = The Obamas Gave $131,000 to Fisher House Foundation in 2010; What Is It? |work = [[PBS NewsHour]] |first = Paul |last = Solman |archive-url=https://web.archive.org/web/20140129072652/http://www.pbs.org/newshour/rundown/2011/04/the-obamas-gave-131000-to-the-fisher-house-foundation-last-year-what-is-it.html |archive-date = January 29, 2014 |access-date = January 27, 2012 }}</ref> Per his 2012 financial disclosure, Obama may be worth as much as $10{{nbs}}million.<ref name="networth12">{{cite news |url=http://content.usatoday.com/communities/theoval/post/2012/05/obama-worth-as-much-as-10-million/1 |title = Obama worth as much as $10 million |last = Wolf |first = Richard |date = May 16, 2012 |work = [[USA Today]] |access-date = June 16, 2012 }}</ref>
+
+===Religious views===
+
+Obama is a [[Protestant]] Christian whose religious views developed in his adult life.<ref name="Christian" /> He wrote in ''[[The Audacity of Hope]]'' that he "was not raised in a religious household." He described his mother, raised by non-religious parents, as being detached from religion, yet "in many ways the most spiritually awakened person{{nbsp}}... I have ever known", and "a lonely witness for [[secular humanism]]." He described his father as a "confirmed [[Atheism|atheist]]" by the time his parents met, and his stepfather as "a man who saw religion as not particularly useful." Obama explained how, through working with [[black church]]es as a [[Community organizing|community organizer]] while in his twenties, he came to understand "the power of the African-American religious tradition to spur social change."<ref name="social change" />
+[[File:Obamas at church on Inauguration Day 2013.jpg|thumb|The Obamas worship at [[African Methodist Episcopal Church]] in Washington, D.C., January 2013]]
+
+In January 2008, Obama told ''[[Christianity Today]]'': "I am a Christian, and I am a devout Christian. I believe in the [[Redeemer (Christianity)|redemptive death]] and [[resurrection of Jesus Christ]]. I believe that faith gives me a path to be cleansed of sin and have eternal life."<ref>{{cite news |last1 = Pulliam |first1 = Sarah |last2 = Olsen |first2 = Ted |url=http://www.christianitytoday.com/ct/2008/januaryweb-only/104-32.0.html?start=2 |title = Q&A: Barack Obama |work = Christianity Today |date = January 23, 2008 |access-date = January 4, 2013 }}</ref> On September 27, 2010, Obama released a statement commenting on his religious views, saying:
+{{blockquote|I'm a Christian by choice. My family didn't—frankly, they weren't folks who went to church every week. And my mother was one of the most spiritual people I knew, but she didn't raise me in the church. So I came to my Christian faith later in life, and it was because the precepts of [[Jesus Christ]] spoke to me in terms of the kind of life that I would want to lead—being my brothers' and sisters' keeper, [[Golden Rule|treating others as they would treat me]].<ref name="APbychoice">{{cite news|url=https://www.huffingtonpost.com/2010/09/28/obama-christian-by-choice_n_742124.html|title=Obama 'Christian By Choice': President Responds To Questioner|last1=Babington|first1=Charles|last2=Superville|first2=Darlene|agency=Associated Press|date=September 28, 2010|work=The Huffington Post|url-status=dead|archive-url=https://web.archive.org/web/20110511232554/http://www.huffingtonpost.com/2010/09/28/obama-christian-by-choice_n_742124.html|archive-date=May 11, 2011}}</ref><ref name="ABCVideobychoice">{{cite news|url=http://blogs.abcnews.com/politicalpunch/2010/09/president-obama-i-am-a-christian-by-choicethe-precepts-of-jesus-spoke-to-me.html|title=President Obama: 'I am a Christian By Choice ... The Precepts of Jesus Spoke to Me'|work=[[ABC News]]|date=September 29, 2010|access-date=December 27, 2016|archive-url=https://archive.today/20120713041729/http://abcnews.go.com/blogs/politics/2010/09/president-obama-i-am-a-christian-by-choicethe-precepts-of-jesus-spoke-to-me/|archive-date=July 13, 2012|url-status=dead}}</ref>}}
+
+Obama met [[Trinity United Church of Christ]] pastor [[Jeremiah Wright]] in October 1987 and became a member of Trinity in 1992.<ref name="Trinity" /> During Obama's first presidential campaign in May 2008, he resigned from Trinity after [[Jeremiah Wright controversy|some of Wright's statements were criticized]].<ref>{{cite news |agency = Associated Press |date = November 17, 2008 |title = Obama's church choice likely to be scrutinized |work = NBC News |url=https://www.nbcnews.com/id/27775757 |access-date = January 20, 2009 }}</ref> Since moving to Washington, D.C., in 2009, the Obama family has attended several Protestant churches, including [[Shiloh Baptist Church (Washington, D.C.)|Shiloh Baptist Church]] and [[St. John's Episcopal Church, Lafayette Square|St. John's Episcopal Church]], as well as Evergreen Chapel at [[Camp David]], but the members of the family do not attend church on a regular basis.<ref>{{cite news |last=Parker |first=Ashley |url=https://www.nytimes.com/2013/12/29/us/as-the-obamas-celebrate-christmas-rituals-of-faith-stay-on-the-sidelines.html |archive-url=https://web.archive.org/web/20131230064130/http://www.nytimes.com//2013/12/29/us/as-the-obamas-celebrate-christmas-rituals-of-faith-stay-on-the-sidelines.html |archive-date=December 30, 2013 |url-access=subscription |url-status=live |title=As the Obamas Celebrate Christmas, Rituals of Faith Become Less Visible |work=The New York Times |date=December 28, 2013 |access-date=January 15, 2017 }}</ref><ref>{{cite news |last=Gilgoff |first=Dan |url=https://www.usnews.com/news/blogs/god-and-country/2009/06/30/time-report-white-house-reaction-raise-more-questions-about-obamas-church-hunt |title=TIME Report, White House Reaction Raise More Questions About Obama's Church Hunt |work=U.S. News & World Report |date=June 30, 2009 |access-date=January 15, 2017 }}</ref><ref>{{cite news |url=https://washington.cbslocal.com/2014/04/22/first-lady-we-use-sundays-for-naps-if-were-not-going-to-church/ |title=First Lady: We Use Sundays For Naps If We're Not Going To Church |publisher=CBS DC |agency=Associated Press |date=April 22, 2014 |access-date=January 15, 2017 }}</ref>
+
+In 2016, he said that he gets inspiration from a few items that remind him "of all the different people I've met along the way", adding: "I carry these around all the time. I'm not that superstitious, so it's not like I think I necessarily have to have them on me at all times." The items, "a whole bowl full", include rosary beads given to him by [[Pope Francis]], a figurine of the Hindu deity [[Hanuman]], a [[Coptic cross]] from Ethiopia, a small [[Buddha statue]] given by a monk, and a metal poker chip that used to be the lucky charm of a motorcyclist in Iowa.<ref>{{cite news |title=Revealed: Obama always carries Hanuman statuette in pocket |url=https://www.thehindu.com/news/international/Revealed-Obama-always-carries-Hanuman-statuette-in-pocket/article14001552.ece |access-date=April 8, 2021 |work=[[The Hindu]] |date=January 16, 2016 |language=en-IN}}</ref><ref>{{cite web |title=Obama Reveals Lucky Charms During Interview |url=https://www.youtube.com/watch?v=ox6LidnmbPM |publisher=[[Associated Press]] |access-date=April 8, 2021 |language=en |date=January 16, 2016}}</ref>
+
+== Legal career ==
+
+=== Civil Rights attorney ===
+He joined Davis, Miner, Barnhill & Galland, a 13-attorney law firm specializing in civil rights litigation and neighborhood economic development, where he was an [[associate attorney|associate]] for three years from 1993 to 1996, then [[of counsel]] from 1996 to 2004.{{failed verification|date=October 2021}} In 1994, he was listed as one of the lawyers in ''Buycks-Roberson v. Citibank Fed. Sav. Bank'', 94 C 4094 (N.D. Ill.).<ref>{{cite web |url=https://www.clearinghouse.net/chDocs/public/FH-IL-0011-9000.pdf |title = Civil Docket for Case #: 1:94-cv-04094 |author = <nowiki>United States District Court: Northern District of Illinois—CM/ECF LIVE, Ver 3.0 (Chicago)</nowiki> |date = July 6, 1994 |publisher = clearinghouse.net |access-date = June 3, 2016 }}</ref> This [[Class-action lawsuit|class action lawsuit]] was filed in 1994 with Selma Buycks-Roberson as lead plaintiff and alleged that Citibank Federal Savings Bank had engaged in practices forbidden under the [[Equal Credit Opportunity Act]] and the [[Fair Housing Act]].<ref>{{cite web |url=https://www.clearinghouse.net/detail.php?id=10112 |title = Buycks-Roberson v. Citibank Fed. Sav. Bank—Civil Rights Litigation Clearinghouse |publisher = clearinghouse.net |access-date = November 25, 2015 }}</ref> The case was settled out of court.<ref>{{cite web |url=https://www.clearinghouse.net/chDocs/public/FH-IL-0011-0008.pdf |title = Settlement Agreement |author = United States District Court for the Northern District of Illinois Eastern Division |date = January 16, 1988 |publisher = clearinghouse.net |access-date = June 3, 2016 }}</ref> Final judgment was issued on May 13, 1998, with Citibank Federal Savings Bank agreeing to pay attorney fees.<ref>{{cite web |url=https://www.clearinghouse.net/chDocs/public/FH-IL-0011-0010.pdf |title = Final Judgment and Order of Dismissal |author = United States District Court For the Northern District of Illinois Eastern Division |date = May 13, 1998 |publisher = clearinghouse.net |access-date = June 3, 2016 }}</ref>
+
+From 1994 to 2002, Obama served on the boards of directors of the [[Woods Fund of Chicago]]—which in 1985 had been the first foundation to fund the Developing Communities Project—and of the [[Joyce Foundation]].<ref name="Who's Who 2008" /> He served on the board of directors of the [[Chicago Annenberg Challenge]] from 1995 to 2002, as founding president and chairman of the board of directors from 1995 to 1999.<ref name="Who's Who 2008" /> Obama's law license became inactive in 2007.<ref>{{cite web |url=https://www.factcheck.org/2012/06/the-obamas-law-licenses/ |title = The Obamas' Law Licenses |publisher = FactCheck.org |date = June 14, 2012 |access-date = July 16, 2012 |last=Gore |first=D'Angelo }}</ref><ref name="DavisMiner" />
+
+== Legislative career ==
+=== Illinois Senate (1997–2004) ===
+
+{{Main|Illinois Senate career of Barack Obama}}
+[[File:Obamamiltondavis1.jpg|thumb|State Senator Obama and others celebrate the naming of a street in Chicago after [[ShoreBank]] co-founder Milton Davis in 1998]]
+
+Obama was elected to the [[Illinois Senate]] in 1996, succeeding Democratic State Senator [[Alice Palmer (politician)|Alice Palmer]] from Illinois's 13th District, which, at that time, spanned Chicago South Side neighborhoods from [[Hyde Park, Chicago|Hyde Park]]–[[Kenwood, Chicago|Kenwood]] south to [[South Shore, Chicago|South Shore]] and west to [[Chicago Lawn, Chicago|Chicago Lawn]].<ref>{{cite news |first1=David |last1=Jackson |last2=Long |first2=Ray |title=Obama Knows His Way Around a Ballot |date=April 3, 2007 |url=https://www.chicagotribune.com/news/politics/obama/chi-070403obama-ballot-archive,0,5693903.story |archive-url=https://web.archive.org/web/20081011054057/http://www.chicagotribune.com/news/politics/obama/chi-070403obama-ballot-archive%2C0%2C5693903.story |work=Chicago Tribune |access-date=May 18, 2012 |archive-date=October 11, 2008 |url-status=dead }}
+* {{cite book |last = White |first = Jesse |author-link = Jesse White (politician) |year = 2001 |chapter = Legislative Districts of Cook County, 1991 Reapportionment |chapter-url=http://www.sos.state.il.us/publications/02bluebook/legislative_branch/legdistrictmaps.pdf |title = Illinois Blue Book 2001–2002 |place = Springfield |publisher = [[Illinois Secretary of State]] |page = 65 |access-date = July 16, 2011 |url-status=dead |archive-url=https://web.archive.org/web/20080226221919/http://www.sos.state.il.us/publications/02bluebook/legislative_branch/legdistrictmaps.pdf |archive-date = February 26, 2008 }} State Sen. District 13 = State Rep. Districts 25 & 26.</ref> Once elected, Obama gained bipartisan support for legislation that reformed ethics and health care laws.<ref>{{cite news|first=Peter |last=Slevin |title=Obama Forged Political Mettle in Illinois Capitol |date=February 9, 2007 |url=https://www.washingtonpost.com/wp-dyn/content/article/2007/02/08/AR2007020802262.html |newspaper=The Washington Post |access-date=April 20, 2008 }}</ref><ref>{{cite news|first=Scott |last=Helman |title=In Illinois, Obama dealt with Lobbyists |date=September 23, 2007 |url=https://www.boston.com/news/nation/articles/2007/09/23/in_illinois_obama_dealt_with_lobbyists/ |work=The Boston Globe |access-date=April 20, 2008 |archive-url=https://web.archive.org/web/20080416235513/http://www.boston.com/news/nation/articles/2007/09/23/in_illinois_obama_dealt_with_lobbyists/ |archive-date=April 16, 2008 |url-status=live }} See also:{{cite news|title=Obama Record May Be Gold Mine for Critics |date=January 17, 2007 |work=CBS News |url=https://www.cbsnews.com/stories/2007/01/17/politics/main2369157.shtml |agency=Associated Press |access-date=April 20, 2008 |archive-url=https://web.archive.org/web/20080412223055/http://www.cbsnews.com/stories/2007/01/17/politics/main2369157.shtml |archive-date=April 12, 2008 |url-status=live }}</ref> He sponsored a law that increased [[tax credit]]s for low-income workers, negotiated [[welfare reform]], and promoted increased subsidies for childcare.<ref name="Scott20070730">{{cite news |first = Janny |last = Scott |title = In Illinois, Obama Proved Pragmatic and Shrewd |date = July 30, 2007 |url=https://www.nytimes.com/2007/07/30/us/politics/30obama.html |work = The New York Times |access-date = April 20, 2008 |archive-url=https://web.archive.org/web/20081210135903/http://www.nytimes.com/2007/07/30/us/politics/30obama.html|archive-date=December 10, 2008 |url-status=live }}</ref> In 2001, as co-chairman of the bipartisan Joint Committee on Administrative Rules, Obama supported Republican Governor Ryan's [[payday loan]] regulations and [[Predatory lending|predatory mortgage lending]] regulations aimed at averting home [[foreclosure]]s.<ref>{{cite news |last=Allison| first=Melissa |date=December 15, 2000 |title=State takes on predatory lending; Rules would halt single-premium life insurance financing |url=https://pqasb.pqarchiver.com/chicagotribune/access/65214450.html?dids=65214450:65214450&FMT=ABS&FMTS=ABS:FT |format=paid archive |work=Chicago Tribune |page=1 (Business) |access-date=June 1, 2008 |archive-url=https://web.archive.org/web/20080617151154/https://pqasb.pqarchiver.com/chicagotribune/access/65214450.html?dids=65214450%3A65214450&FMT=ABS&FMTS=ABS%3AFT |archive-date=June 17, 2008 |url-status=live }}</ref><ref>{{cite news |first1=Ray |last1=Long |first2=Melissa |last2=Allison |date=April 18, 2001 |title=Illinois OKs predatory loan curbs; State aims to avert home foreclosures |url=https://pqasb.pqarchiver.com/chicagotribune/access/71459393.html?dids=71459393:71459393&FMT=ABS&FMTS=ABS:FT |format=paid archive |work=Chicago Tribune |page=1 |access-date=June 1, 2008 |archive-date=December 18, 2008 |archive-url=https://web.archive.org/web/20081218011718/http://pqasb.pqarchiver.com/chicagotribune/access/71459393.html?dids=71459393:71459393&FMT=ABS&FMTS=ABS:FT |url-status=dead }}</ref>
+
+He was reelected to the Illinois Senate in 1998, defeating Republican Yesse Yehudah in the general election, and was re-elected again in 2002.<ref>{{cite web |url=http://www.senatedem.state.il.us/obama/index.html |title = 13th District: Barack Obama |access-date = April 20, 2008 |date = August 24, 2000 |publisher = Illinois State Senate Democrats |archive-url=https://web.archive.org/web/20000824102110/http://www.senatedem.state.il.us/obama/index.html |archive-date = August 24, 2000 }}</ref><ref>{{cite web |url=http://www.senatedem.state.il.us/obama/index.html |title = 13th District: Barack Obama |access-date = April 20, 2008 |date = October 9, 2004 |publisher = Illinois State Senate Democrats |archive-url=https://web.archive.org/web/20040802233730/http://www.senatedem.state.il.us/obama/index.html |archive-date = August 2, 2004 }}</ref> In 2000, he lost a [[2000 Illinois's 1st congressional district election|Democratic primary race]] for [[Illinois's 1st congressional district]] in the [[United States House of Representatives]] to four-term incumbent [[Bobby Rush]] by a margin of two to one.<ref name="Democratic primary" />
+
+In January 2003, Obama became chairman of the Illinois Senate's Health and Human Services Committee when Democrats, after a decade in the minority, regained a majority.<ref>{{cite news|first=Jackie |last=Calmes |title=Statehouse Yields Clues to Obama |date=February 23, 2007 |url=https://www.wsj.com/public/article/SB117219748197216894-Sn6oV_4KLQHp_xz7CjYLuyjv3Jg_20070324.html |work=The Wall Street Journal |access-date=April 20, 2008 |url-status=dead |archive-url=https://web.archive.org/web/20080918032039/http://online.wsj.com/public/article/SB117219748197216894-Sn6oV_4KLQHp_xz7CjYLuyjv3Jg_20070324.html |archive-date=September 18, 2008 }}</ref> He sponsored and led unanimous, bipartisan passage of legislation to monitor [[racial profiling]] by requiring police to record the race of drivers they detained, and legislation making Illinois the first state to mandate videotaping of homicide interrogations.<ref name="Scott20070730" /><ref>{{cite news|author=Tavella, Anne Marie |date=April 14, 2003 |title=Profiling, taping plans pass Senate |url=http://nl.newsbank.com/nl-search/we/Archives?p_product=ADHB&p_theme=adhb&p_action=search&p_text_search-0=Profiling,%20AND%20taping%20AND%20plans%20AND%20pass%20AND%20Senate |format=paid archive |work=Daily Herald |page=17 |access-date=June 1, 2008 }}</ref><ref>{{cite news|author=Haynes, V. Dion |date=June 29, 2003 |title=Fight racial profiling at local level, lawmaker says; U.S. guidelines get mixed review |url=https://pqasb.pqarchiver.com/chicagotribune/access/352884461.html?dids=352884461:352884461&FMT=ABS&FMTS=ABS:FT |format=paid archive |work=Chicago Tribune |page=8 |access-date=June 1, 2008 |archive-url=https://web.archive.org/web/20080617150449/https://pqasb.pqarchiver.com/chicagotribune/access/352884461.html?dids=352884461%3A352884461&FMT=ABS&FMTS=ABS%3AFT |archive-date=June 17, 2008 |url-status=live }}</ref><ref>{{cite news |last=Pearson |first=Rick |date=July 17, 2003 |title=Taped confessions to be law; State will be 1st to pass legislation |url=https://pqasb.pqarchiver.com/chicagotribune/access/370136121.html?dids=370136121:370136121&FMT=ABS&FMTS=ABS:FT |format=paid archive |work=Chicago Tribune |page=1 (Metro) |access-date=June 1, 2008 |archive-date=December 18, 2008 |archive-url=https://web.archive.org/web/20081218011706/http://pqasb.pqarchiver.com/chicagotribune/access/370136121.html?dids=370136121:370136121&FMT=ABS&FMTS=ABS:FT |url-status=dead }}</ref> During his 2004 general election campaign for the U.S. Senate, police representatives credited Obama for his active engagement with police organizations in enacting [[Capital punishment in the United States|death penalty]] reforms.<ref>{{cite news |first1 = Sam |last1 = Youngman |last2 = Blake |first2 = Aaron |title = Obama's Crime Votes Are Fodder for Rivals |date = March 14, 2007 |url=http://thehill.com/homenews/news/11316-obamas-crime-votes-are-fodder-for-rivals |work = The Hill |access-date = May 18, 2012 }} See also: {{cite news |title = US Presidential Candidate Obama Cites Work on State Death Penalty Reforms |date = November 12, 2007 |work = International Herald Tribune |url=http://www.iht.com/articles/ap/2007/11/12/america/NA-POL-US-Obama-Death-Penalty.php |archive-url=https://web.archive.org/web/20080607111231/http://www.iht.com/articles/ap/2007/11/12/america/NA-POL-US-Obama-Death-Penalty.php |agency = Associated Press |access-date = May 18, 2012 |archive-date = June 7, 2008 }}</ref> Obama resigned from the Illinois Senate in November 2004 following his election to the U.S. Senate.<ref>{{cite news|first=Melanie |last=Coffee |title=Attorney Chosen to Fill Obama's State Senate Seat |date=November 6, 2004 |publisher=HPKCC |url=http://www.hydepark.org/hpkccnews/raoul.htm#ap |agency=Associated Press |access-date=April 20, 2008 |archive-url=https://web.archive.org/web/20080516174431/http://www.hydepark.org/hpkccnews/raoul.htm |archive-date=May 16, 2008 |url-status=dead }}</ref>
+
+=== 2004 U.S. Senate campaign ===
+
+{{Main|2004 United States Senate election in Illinois}}
+[[File:2004 United States Senate election in Illinois results map by county.svg|left|upright=.6|thumb|Results of the 2004 U.S. Senate race in Illinois; Obama won the counties in blue.]]
+
+In May 2002, Obama commissioned a poll to assess his prospects in a 2004 U.S. Senate race. He created a campaign committee, began raising funds, and lined up political media consultant [[David Axelrod (political consultant)|David Axelrod]] by August 2002. Obama formally announced his candidacy in January 2003.<ref>{{cite news |last = Helman |first = Scott |date = October 12, 2007 |title = Early defeat launched a rapid political climb |newspaper = [[The Boston Globe]] |page = 1A |url=https://www.boston.com/news/nation/articles/2007/10/12/early_defeat_launched_a_rapid_political_climb |access-date = April 13, 2008 }}</ref>
+
+Obama was an early opponent of the [[George W. Bush]] administration's [[2003 invasion of Iraq]].<ref>{{cite news |last = Strausberg |first = Chinta |date = September 26, 2002 |title = Opposition to war mounts |newspaper = Chicago Defender |page = 1 |url=http://www.highbeam.com/doc/1P3-220062931.html |archive-url=https://web.archive.org/web/20110511195931/http://www.highbeam.com/doc/1P3-220062931.html |url-status=dead |archive-date = May 11, 2011 |format = paid archive |access-date = February 3, 2008 }}</ref> On October 2, 2002, the day President Bush and Congress agreed on the [[Iraq Resolution|joint resolution]] authorizing the [[Iraq War]],<ref name="Rose Garden" /> Obama addressed the first high-profile Chicago [[Protests against the Iraq War|anti-Iraq War rally]],<ref name="Federal Plaza" /> and spoke out against the war.<ref name="spoke out" /> He addressed another anti-war rally in March 2003 and told the crowd "it's not too late" to stop the war.<ref name="stop the war" />
+
+Decisions by Republican incumbent [[Peter Fitzgerald (politician)|Peter Fitzgerald]] and his Democratic predecessor [[Carol Moseley Braun]] to not participate in the election resulted in wide-open Democratic and Republican primary contests involving 15 candidates.<ref>{{cite news |last = Davey |first = Monica |date = March 7, 2004 |title = Closely watched Illinois Senate race attracts 7 candidates in millionaire range |url=https://www.nytimes.com/2004/03/07/politics/campaign/07ILLI.html |archive-url=https://web.archive.org/web/20090416015834/http://www.nytimes.com/2004/03/07/politics/campaign/07ILLI.html|archive-date=April 16, 2009 |newspaper = [[The New York Times]] |page = 19 |access-date = April 13, 2008 }}</ref> In the March 2004 primary election, Obama won in an unexpected landslide—which overnight made him a rising star within the [[Democratic National Committee|national Democratic Party]], started speculation about a presidential future, and led to the reissue of his memoir, ''Dreams from My Father''.<ref name="future" /> In July 2004, Obama delivered the keynote address at the [[2004 Democratic National Convention]],<ref>{{cite news |last = Bernstein |first = David |date = June 2007 |title = The Speech |magazine = Chicago Magazine |url=http://www.chicagomag.com/Chicago-Magazine/June-2007/The-Speech |access-date = April 13, 2008 }}</ref> seen by nine million viewers. His speech was well received and elevated his status within the Democratic Party.<ref name="status" />
+
+Obama's expected opponent in the general election, Republican primary winner [[Jack Ryan (politician)|Jack Ryan]], withdrew from the race in June 2004.<ref>{{cite news |date = June 25, 2004 |title = Ryan drops out of Senate race in Illinois |publisher = CNN |url=http://www.cnn.com/2004/ALLPOLITICS/06/25/il.ryan/ |access-date = May 18, 2012 }}
+* Mendell (2007), pp. 260–271.</ref> Six weeks later, [[Alan Keyes]] accepted the Republican nomination to replace Ryan.<ref>{{cite news |last = Lannan |first = Maura Kelly |agency = Associated Press |date = August 9, 2004 |title = Alan Keyes enters U.S. Senate race in Illinois against rising Democratic star |newspaper = [[The San Diego Union-Tribune]] |url=http://legacy.signonsandiego.com/news/politics/20040809-0849-illinoissenate.html |access-date = April 13, 2008 |archive-url=https://web.archive.org/web/20111214115053/http://legacy.signonsandiego.com/news/politics/20040809-0849-illinoissenate.html |archive-date = December 14, 2011 |url-status=dead }}</ref> In the [[2004 United States Senate election in Illinois|November 2004 general election]], Obama won with 70 percent of the vote, the largest margin of victory for a Senate candidate in Illinois history.<ref name="margin" /> He took 92 of the state's 102 counties, including several where Democrats traditionally do not do well.
+
+=== U.S. Senate (2005–2008) ===
+
+{{See also|United States Senate career of Barack Obama|List of bills sponsored by Barack Obama in the United States Senate}}
+[[File:BarackObamaportrait.jpg|thumb|upright|Official portrait of Obama as a member of the United States Senate]]
+
+Obama was sworn in as a senator on January 3, 2005,<ref>{{CongBio|o000167|inline=1|date=October 12, 2011}}</ref> becoming the only Senate member of the [[Congressional Black Caucus]].<ref>{{cite web |title = Member Info |url=http://www.house.gov/kilpatrick/cbc/member_info.html |archive-url=https://web.archive.org/web/20080709114659/http://www.house.gov/kilpatrick/cbc/member_info.html |archive-date = July 9, 2008 |publisher = Congressional Black Caucus |access-date = June 25, 2008 }}</ref> He introduced two initiatives that bore his name: Lugar–Obama, which expanded the [[Nunn–Lugar Cooperative Threat Reduction]] concept to conventional weapons;<ref>{{cite web |url=http://obama.senate.gov/press/070111-lugar-obama_non/ |title = Lugar–Obama Nonproliferation Legislation Signed into Law by the President |date = January 11, 2007 |publisher = Richard Lugar U.S. Senate Office |access-date = April 27, 2008 |archive-url=https://web.archive.org/web/20081218154746/http://obama.senate.gov/press/070111-lugar-obama_non/ |archive-date = December 18, 2008 }} See also: {{cite news |first1 = Richard G. |last1 = Lugar |last2 = Obama |first2 = Barack |title = Junkyard Dogs of War |date = December 3, 2005 |url=https://www.washingtonpost.com/wp-dyn/content/article/2005/12/02/AR2005120201509.html |newspaper = The Washington Post |access-date = April 27, 2008 }}</ref> and the [[Federal Funding Accountability and Transparency Act of 2006]], which authorized the establishment of USAspending.gov, a web search engine on federal spending.<ref>{{cite news |first = John |last = McCormack |title = Google Government Gone Viral |date = December 21, 2007 |url=http://www.weeklystandard.com/Content/Public/Articles/000/000/014/502njiqx.asp |work = Weekly Standard |access-date = April 27, 2008 |archive-url=https://web.archive.org/web/20080423235240/http://www.weeklystandard.com/Content/Public/Articles/000/000/014/502njiqx.asp |archive-date = April 23, 2008 |url-status=live }} See also: {{cite web |title = President Bush Signs Coburn–Obama Transparency Act |date = September 26, 2006 |url=http://coburn.senate.gov/ffm/index.cfm?FuseAction=LegislativeFloorAction.Home&ContentRecord_id=eb582f19-802a-23ad-41db-7a7cb464cfdb |archive-url=https://web.archive.org/web/20080501233103/http://coburn.senate.gov/ffm/index.cfm?FuseAction=LegislativeFloorAction.Home&ContentRecord_id=eb582f19-802a-23ad-41db-7a7cb464cfdb |archive-date = May 1, 2008 |publisher = Tom Coburn U.S. Senate Office |access-date = April 27, 2008 }}</ref> On June 3, 2008, Senator Obama—along with Senators [[Tom Carper]], [[Tom Coburn]], and [[John McCain]]—introduced follow-up legislation: Strengthening Transparency and Accountability in Federal Spending Act of 2008.<ref>{{cite web |url=http://www.govtrack.us/congress/bills/110/s3077 |title = S. 3077: Strengthening Transparency and Accountability in Federal Spending Act of 2008: 2007–2008 (110th Congress) |publisher = Govtrack.us |date = June 3, 2008 |access-date = May 18, 2012 }}</ref> He also [[Sponsor (legislative)|cosponsored]] the [[Secure America and Orderly Immigration Act]].<ref>{{cite web |first = 109th Congress, 1st Session |last = U.S. Senate |title = S. 1033, Secure America and Orderly Immigration Act |date = May 12, 2005 |url=https://www.congress.gov/bill/109th-congress/senate-bill/1033/cosponsors |publisher = Library of Congress |access-date = February 25, 2017}}</ref>
+
+In December 2006, President Bush signed into law the [[Democratic Republic of the Congo]] Relief, Security, and Democracy Promotion Act, marking the first federal legislation to be enacted with Obama as its primary sponsor.<ref>{{cite web |title = Democratic Republic of the Congo |date = April 2006 |url=http://www.usccb.org/sdwp/international/drc0406.shtml |publisher = United States Conference of Catholic Bishops |access-date = January 26, 2012 |archive-url=https://web.archive.org/web/20110108193726/http://www.usccb.org/sdwp/international/drc0406.shtml |archive-date = January 8, 2011 }}</ref><ref>{{cite web |title = The IRC Welcomes New U.S. Law on Congo |date = January 5, 2007 |url=http://www.theirc.org/news/the-irc-welcomes-new-us-law.html |publisher = International Rescue Committee |access-date = April 27, 2008 |archive-url=https://web.archive.org/web/20110807061958/http://www.rescue.org/news/the-irc-welcomes-new-us-law.html |archive-date = August 7, 2011 }}</ref> In January 2007, Obama and Senator Feingold introduced a corporate jet provision to the [[Honest Leadership and Open Government Act]], which was signed into law in September 2007.<ref>{{cite news|first=Nathaniel |last=Weixel |title=Feingold, Obama Go After Corporate Jet Travel |date=November 15, 2007 |url=http://thehill.com/leading-the-news/feingold-obama-go-after-corporate-jet-travel-2007-11-15.html |work=The Hill |access-date=April 27, 2008 |archive-url=https://web.archive.org/web/20080515201902/http://thehill.com/leading-the-news/feingold-obama-go-after-corporate-jet-travel-2007-11-15.html |archive-date=May 15, 2008 |url-status=live }}</ref><ref>{{cite news|first=Nathaniel |last=Weixel |title=Lawmakers Press FEC on Bundling Regulation |date=December 5, 2007 |url=http://thehill.com/leading-the-news/lawmakers-press-fec-on-bundling-regulation-2007-12-05.html |work=The Hill |access-date=April 27, 2008 |archive-url=https://web.archive.org/web/20080416162108/http://thehill.com/leading-the-news/lawmakers-press-fec-on-bundling-regulation-2007-12-05.html |archive-date=April 16, 2008 |url-status=live }} See also: {{cite news|title=Federal Election Commission Announces Plans to Issue New Regulations to Implement the Honest Leadership and Open Government Act of 2007 |date=September 24, 2007 |publisher=Federal Election Commission |url=http://www.fec.gov/press/press2007/20070924travel.shtml |access-date=April 27, 2008 |archive-url=https://web.archive.org/web/20080411220016/http://www.fec.gov/press/press2007/20070924travel.shtml |archive-date=April 11, 2008 |url-status=dead }}</ref>
+
+[[File:Lugar-Obama.jpg|thumb|alt=Gray-haired man and Obama stand, wearing casual polo shirts. Obama wears sunglasses and holds something slung over his right shoulder.|left|Obama and U.S. Senator [[Richard Lugar]] (R-IN) visit a Russian facility for dismantling mobile missiles (August 2005)<ref>{{cite web |title = Nunn–Lugar Report |date = August 2005 |publisher = Richard Lugar U.S. Senate Office |url=http://lugar.senate.gov/nunnlugar/pdf/trip_report_2005.pdf |archive-url=https://web.archive.org/web/20080501002134/http://lugar.senate.gov/nunnlugar/pdf/trip_report_2005.pdf |archive-date = May 1, 2008 |access-date = April 30, 2008 }}</ref>]]
+Later in 2007, Obama sponsored an amendment to the Defense Authorization Act to add safeguards for personality-disorder military discharges.<ref>{{cite web |title = Obama, Bond Hail New Safeguards on Military Personality Disorder Discharges, Urge Further Action |date = October 1, 2007 |url=http://bond.senate.gov/public/index.cfm?FuseAction=PressRoom.NewsReleases&ContentRecord_id=5C1EBFEB-1321-0E36-BA7D-04630AEFAD31 |publisher = Kit Bond U.S. Senate Office |access-date = April 27, 2008 |archive-url=https://web.archive.org/web/20101205075008/http://bond.senate.gov/public/index.cfm?FuseAction=PressRoom.NewsReleases&ContentRecord_id=5C1EBFEB-1321-0E36-BA7D-04630AEFAD31 |archive-date = December 5, 2010 }}</ref> This amendment passed the full Senate in the spring of 2008.<ref>{{cite web |title = Obama, Bond Applaud Senate Passage of Amendment to Expedite the Review of Personality Disorder Discharge Cases |url=http://obama.senate.gov/press/080314-obama_bond_appl/ |archive-url=https://web.archive.org/web/20081218154824/http://obama.senate.gov/press/080314-obama_bond_appl/ |archive-date = December 18, 2008 |date = March 14, 2008 }}</ref> He sponsored the [[Disinvestment from Iran|Iran Sanctions Enabling Act]] supporting divestment of state pension funds from Iran's oil and gas industry, which was never enacted but later incorporated in the [[Comprehensive Iran Sanctions, Accountability, and Divestment Act of 2010]];<ref>{{cite web|url=https://www.govtrack.us/congress/bills/111/s1065|title=Iran Sanctions Enabling Act of 2009 (2009—S. 1065)|website=GovTrack.us|access-date=August 27, 2018}}</ref> and co-sponsored legislation to reduce risks of nuclear terrorism.<ref name="nuclear terrorism" /> Obama also sponsored a Senate amendment to the [[State Children's Health Insurance Program]], providing one year of job protection for family members caring for soldiers with combat-related injuries.<ref>{{cite web |title = Senate Passes Obama, McCaskill Legislation to Provide Safety Net for Families of Wounded Service Members |date = August 2, 2007 |url=http://obama.senate.gov/press/070802-senate_passes_o_1/ |publisher = Barack Obama U.S. Senate Office |access-date = April 27, 2008 |archive-url=https://web.archive.org/web/20081218154819/http://obama.senate.gov/press/070802-senate_passes_o_1/ |archive-date = December 18, 2008 }}</ref>
+
+Obama held assignments on the Senate Committees for [[United States Senate Committee on Foreign Relations|Foreign Relations]], [[United States Senate Committee on Environment and Public Works|Environment and Public Works]] and [[United States Senate Committee on Veterans' Affairs|Veterans' Affairs]] through December 2006.<ref>{{cite web |url=http://obama.senate.gov/committees/ |date = December 9, 2006 |title = Committee Assignments |access-date = April 27, 2008 |publisher = Barack Obama U.S. Senate Office |archive-url=https://web.archive.org/web/20061209190827/http://obama.senate.gov/committees/ |archive-date = December 9, 2006 }}</ref> In January 2007, he left the Environment and Public Works committee and took additional assignments with [[United States Senate Committee on Health, Education, Labor and Pensions|Health, Education, Labor and Pensions]] and [[United States Senate Committee on Homeland Security and Governmental Affairs|Homeland Security and Governmental Affairs]].<ref>{{cite news |title = Obama Gets New Committee Assignments |date = November 15, 2006 |publisher = Barack Obama U.S. Senate Office |url=http://obama.senate.gov/news/061115-obama_gets_new/ |agency = Associated Press |access-date = April 27, 2008 |archive-url=https://web.archive.org/web/20081218154741/http://obama.senate.gov/news/061115-obama_gets_new/ |archive-date = December 18, 2008 }}</ref> He also became Chairman of the Senate's subcommittee on [[United States Senate Foreign Relations Subcommittee on Europe and Regional Security Cooperation|European Affairs]].<ref>{{cite news |first = Tom |last = Baldwin |title = 'Stay at home' Barack Obama comes under fire for a lack of foreign experience |date = December 21, 2007 |url=https://www.thetimes.co.uk/article/stay-at-home-barack-obama-comes-under-fire-for-a-lack-of-foreign-experience-2qjm86d9l2n |work = Sunday Times (UK) |access-date = April 27, 2008 }}</ref> As a member of the Senate Foreign Relations Committee, Obama made official trips to Eastern Europe, the Middle East, Central Asia and Africa. He met with [[Mahmoud Abbas]] before Abbas became [[President of the Palestinian National Authority]], and gave a speech at the [[University of Nairobi]] in which he condemned corruption within the Kenyan government.<ref name="Kenyan" />
+
+Obama [[resignation from the United States Senate|resigned his Senate seat]] on November 16, 2008, to focus on his transition period for the presidency.<ref name="transition period" />
+
+==Presidential campaigns==
+===2008===
+
+{{Main|2008 United States presidential election|Barack Obama 2008 presidential primary campaign|Barack Obama 2008 presidential campaign}}
+[[File:Flickr Obama Springfield 01.jpg|thumb|alt=Photograph|Obama on stage with wife and daughters just before announcing presidential candidacy in [[Springfield, Illinois]], February 10, 2007]]
+[[File:ElectoralCollege2008.svg|thumb|upright=1.3|alt=Electoral map of the 2008 U.S. presidential election|2008 electoral vote results. Obama won 365–173.]]
+
+On February 10, 2007, Obama announced his candidacy for President of the [[United States]] in front of the [[Old State Capitol State Historic Site (Illinois)|Old State Capitol]] building in [[Springfield, Illinois]].<ref name="ChicagoTribune_Pearson_20070210">{{cite news |last1=Pearson |first1=Rick |last2=Long |first2=Ray |date=February 10, 2007 |title=Obama: I'm running for president |newspaper=Chicago Tribune |url=https://www.chicagotribune.com/news/politics/chi-070210obama-pearson1-story,0,3768114.story |access-date=September 20, 2008 |archive-url=https://web.archive.org/web/20070813115846/http://www.chicagotribune.com/news/politics/chi-070210obama-pearson1-story%2C0%2C3768114.story |archive-date=August 13, 2007 |url-status=live }}</ref><ref name="BBC20070210">{{cite news |date=February 10, 2007 |title=Obama Launches Presidential Bid |publisher=[[BBC News]] |url=http://news.bbc.co.uk/2/hi/americas/6349081.stm |url-status=live |access-date=January 14, 2008 |archive-url=https://web.archive.org/web/20080202060802/http://news.bbc.co.uk/2/hi/americas/6349081.stm |archive-date=February 2, 2008}}</ref> The choice of the announcement site was viewed as symbolic because it was also where [[Abraham Lincoln]] delivered his historic [[Lincoln's House Divided Speech|"House Divided"]] speech in 1858.<ref name="ChicagoTribune_Pearson_20070210" /><ref name="ChicagoTribune_Parsons20070210">{{cite news |url=http://www.highbeam.com/doc/1G1-159132539.html |url-status=dead |access-date=June 12, 2009 |archive-url=https://web.archive.org/web/20110511195905/http://www.highbeam.com/doc/1G1-159132539.html |archive-date = May 11, 2011 |title = Obama's launch site: Symbolic Springfield: Announcement venue evokes Lincoln legacy |last=Parsons |first=Christi |date=February 10, 2007 |newspaper=Chicago Tribune }}</ref> Obama emphasized issues of rapidly ending the [[Iraq War]], increasing [[Energy policy of the United States|energy independence]], and [[Health care reform in the United States|reforming the health care system]],<ref>{{cite news |title=Barack Obama on the Issues: What Would Be Your Top Three Overall Priorities If Elected? |newspaper=The Washington Post |url=http://projects.washingtonpost.com/2008-presidential-candidates/issues/candidates/barack-obama/#top-priorities |url-status=dead |access-date=April 14, 2008 |archive-url=https://web.archive.org/web/20080509140350/http://projects.washingtonpost.com/2008-presidential-candidates/issues/candidates/barack-obama/ |archive-date=May 9, 2008}} See also:
+* {{cite book |last=Thomas |first=Evan |author-link=Evan Thomas |year=2009 |title=A Long Time Coming |publisher=[[PublicAffairs]] |location=New York |url=https://archive.org/details/alongtimecominge00thom |url-access=registration |isbn=978-1-58648-607-5 |page=[https://archive.org/details/alongtimecominge00thom/page/74 74]}}
+* {{cite news |last=Falcone |first=Michael |date=December 21, 2007 |title=Obama's 'One Thing' |newspaper=The New York Times |url=https://archive.nytimes.com/thecaucus.blogs.nytimes.com/2007/12/21/obamas-one-thing/ |access-date=April 14, 2008 }}</ref> in a campaign that projected themes of hope and change.<ref>{{cite news |date=November 1, 2008 |title=The Obama promise of hope and change |newspaper=The Independent |location=London |url=https://www.independent.co.uk/opinion/leading-articles/leading-article-the-obama-promise-of-hope-and-change-981761.html |url-status=dead |archive-url=https://web.archive.org/web/20110515091856/http://www.independent.co.uk/opinion/leading-articles/leading-article-the-obama-promise-of-hope-and-change-981761.html |archive-date=May 15, 2011}}</ref>
+
+Numerous candidates entered the [[2008 Democratic Party presidential primaries|Democratic Party presidential primaries]]. The field narrowed to a duel between Obama and Senator [[Hillary Clinton]] after early contests, with the race remaining close throughout the primary process but with Obama gaining a steady lead in pledged [[Delegate (American politics)|delegates]] due to better long-range planning, superior fundraising, dominant organizing in [[caucus]] states, and better exploitation of delegate allocation rules.<ref name="allocation" />
+On June 2, 2008, Obama had received enough votes to clinch his election. On all previous occasions the defeated candidate had immediately conceded and endorsed the winner. Clinton however refused to do so. On June 6, 2008, Obama unexpectedly flew to a meeting of AIPAC (The American Israel Public Action Committee) where he made a wildly applauded speech in which he declared that "Jerusalem will remain the capital of Israel, and it must remain undivided", contrary to his previous views about the Palestinian issue.<ref>{{cite magazine |last=Brownfeld |first=Allan C. |date=July 29, 2009 |title=AIPAC's Role in the 2008 Election Coming Under Increasingly Critical Scrutiny |magazine=[[Washington Report on Middle East Affairs]] |url=https://www.wrmea.org/008-september-october/aipacs-role-in-the-2008-election-coming-under-increasingly-critical-scrutiny.html}}</ref> This opened the door to additional Jewish funding for his presidential campaign. On June 7, 2008, Clinton ended her campaign and endorsed Obama.<ref>{{cite news |last1=Nagourney |first1=Adam |first2=Jeff |last2=Zeleny |date=June 5, 2008 |title=Clinton to End Bid and Endorse Obama |newspaper=The New York Times |url=https://www.nytimes.com/2008/06/05/us/politics/04cnd-campaign.html |url-access=subscription |url-status=live |access-date=November 20, 2010 |archive-url=https://web.archive.org/web/20080605014013/http://www.nytimes.com/2008/06/05/us/politics/04cnd-campaign.html |archive-date=June 5, 2008}}</ref>
+
+On August 23, 2008, Obama announced his [[2008 Democratic Party vice presidential candidate selection|selection]] of [[Delaware]] Senator [[Joe Biden]] as his vice presidential running mate.<ref name=nagourney>{{cite news |last1=Nagourney |first1=Adam |first2=Jeff |last2=Zeleny |date=August 23, 2008 |title=Obama Chooses Biden as Running Mate |newspaper=The New York Times |url=https://www.nytimes.com/2008/08/24/us/politics/24biden.html |url-status=live |access-date=September 20, 2008 |archive-url=https://web.archive.org/web/20090401222653/http://www.nytimes.com/2008/08/24/us/politics/24biden.html |archive-date=April 1, 2009}}</ref> Obama selected Biden from a field speculated to include former Indiana Governor and Senator [[Evan Bayh]] and Virginia Governor [[Tim Kaine]].<ref name=nagourney /> At the [[2008 Democratic National Convention|Democratic National Convention]] in [[Denver]], Colorado, Hillary Clinton called for her supporters to endorse Obama, and she and [[Bill Clinton]] gave convention speeches in his support.<ref>{{cite news |last=Baldwin |first=Tom |date=August 27, 2008 |title=Hillary Clinton: 'Barack is my candidate' |work=[[The Times]] |url=https://www.thetimes.co.uk/article/hillary-clinton-barack-is-my-candidate-50w3d5n7wm9 |access-date=December 15, 2021 |issn=0140-0460}}</ref><ref>{{cite news |last=Nagourney |first=Adam |date=August 28, 2008 |title=Obama Wins Nomination; Biden and Bill Clinton Rally Party |newspaper=The New York Times |url=https://www.nytimes.com/2008/08/28/us/politics/28DEMSDAY.html |url-access=subscription |url-status=live |access-date=December 15, 2021 |archive-url=https://web.archive.org/web/20080827212341/http://www.nytimes.com/2008/08/28/us/politics/28DEMSDAY.html |archive-date=August 27, 2008 |issn=0362-4331}}</ref> Obama delivered his acceptance speech at [[Invesco Field at Mile High]] stadium to a crowd of about eighty-four thousand; the speech was viewed by over three million people worldwide.<ref name="npr1409">{{cite news |last1=Liasson |first1=Mara |last2=Norris |first2=Michele |date=July 7, 2008 |title=Obama To Accept Nomination at Mile High Stadium |publisher=NPR |url=https://www.npr.org/templates/story/story.php?storyId=92301409 |access-date=December 22, 2010}}</ref><ref name="acceptance" /><ref>{{cite news |last=Lloyd |first=Robert |date=August 29, 2008 |title=Barack Obama, Al Gore Raise the Roof at Invesco Field |newspaper=[[Los Angeles Times]] |url=https://www.latimes.com/entertainment/news/la-na-tvcritic29-2008aug29,0,3593116.story |access-date=August 29, 2008}}</ref>
+
+During both the primary process and the general election, Obama's campaign set numerous fundraising records, particularly in the quantity of small donations.<ref name="small donations" /> On June 19, 2008, Obama became the first major-party presidential candidate to turn down [[Campaign finance in the United States#Public financing of campaigns|public financing]] in the general election since the system was created in 1976.<ref name="Bloomberg_Salant_20080619">{{cite news |last=Salant |first=Jonathan D. |date=June 19, 2008 |title=Obama Won't Accept Public Money in Election Campaign |publisher=[[Bloomberg L.P.|Bloomberg]] |url=https://article.wn.com/view/2008/06/19/Obama_Wont_Accept_Public_Money_in_Election_Campaign/ |access-date=June 19, 2008}}</ref>
+
+[[John McCain]] was nominated as the Republican candidate, and he selected [[Sarah Palin]] as his running mate. Obama and McCain engaged in three [[United States presidential election debates|presidential debates]] in September and October 2008.<ref name="presidential debates" /> On November 4, Obama won the presidency with 365 [[Electoral College (United States)|electoral votes]] to 173 received by McCain.<ref name="electoral votes" /> Obama won 52.9 percent of the [[Election|popular vote]] to McCain's 45.7 percent.<ref>{{cite web |url=http://www.realclearpolitics.com/epolls/2008/president/us/general_election_mccain_vs_obama-225.html |title = General Election: McCain vs. Obama |access-date = February 20, 2009 |publisher = Real Clear Politics |archive-url=https://web.archive.org/web/20090217083055/http://www.realclearpolitics.com//epolls//2008//president//us//general_election_mccain_vs_obama-225.html |archive-date = February 17, 2009 |url-status=live }}</ref> He became the first African-American to be elected president.<ref name="FirstBlackPrez">{{cite news |url=http://news.bbc.co.uk/1/hi/world/americas/us_elections_2008/7709978.stm |title = Obama wins historic US election |publisher = BBC News |date = November 5, 2008 |access-date = November 5, 2008 |archive-url=https://web.archive.org/web/20081218083153/http://news.bbc.co.uk/1/hi/world/americas/us_elections_2008/7709978.stm |archive-date = December 18, 2008 |url-status=live }}
+* {{cite news |access-date = November 5, 2008 |url=https://www.nytimes.com/2008/11/05/us/politics/05elect.html |title = Obama Elected President as Racial Barrier Falls |first = Adam |last = Nagourney |date = November 4, 2008 |work = The New York Times |archive-url=https://web.archive.org/web/20081209071842/http://www.nytimes.com/2008/11/05/us/politics/05elect.html |archive-date = December 9, 2008 |url-status=live }}
+* {{cite news |access-date = November 5, 2008 |url=http://www.cnn.com/2008/POLITICS/11/04/election.president/index.html |title = Obama: 'This is your victory' |publisher = CNN |date = November 5, 2008 |archive-url=https://web.archive.org/web/20081104231227/http://www.cnn.com/2008/POLITICS/11/04/election.president/index.html |archive-date = November 4, 2008 |url-status=live }}</ref> Obama delivered [[Barack Obama election victory speech, 2008|his victory speech]] before hundreds of thousands of supporters in Chicago's [[Grant Park (Chicago)|Grant Park]].<ref name="independent1">{{cite news |access-date = November 5, 2008 |url=https://www.independent.co.uk/news/world/americas/change-has-come-says-presidentelect-obama-992930.html |title = Change has come, says President-elect Obama |work = The Independent |location = London |date = November 5, 2008 |last = Johnson |first = Wesley |archive-url=https://web.archive.org/web/20081209055411/http://www.independent.co.uk/news/world/americas/change-has-come-says-presidentelect-obama-992930.html |archive-date = December 9, 2008 |url-status=live }}</ref> He is one of the three United States senators moved directly from the U.S. Senate to the White House, the others are [[Warren G. Harding]] and [[John F. Kennedy]].<ref>{{Cite web|title=U.S. Senate: Senators Who Became President|url=https://www.senate.gov/artandhistory/history/common/briefing/senators_became_president.htm|access-date=August 27, 2021|website=senate.gov}}</ref>
+
+===2012===
+
+{{Main|2012 United States presidential election|Barack Obama 2012 presidential campaign}}
+[[File:ElectoralCollege2012.svg|thumb|upright=1.3|alt=Electoral map of the 2012 U.S. presidential election|2012 electoral vote results. Obama won 332–206.]]
+
+On April 4, 2011, Obama filed election papers with the [[Federal Election Commission]] and then announced his reelection campaign for 2012 in a video titled "It Begins with Us" that he posted on his website.<ref>{{cite news |title = Obama Begins Re-Election Facing New Political Challenges |url=http://thecaucus.blogs.nytimes.com/2011/04/04/obama-launches-re-election-facing-new-political-challenges/ |date = April 4, 2011 |first = Michael D. |last = Shear |work = The New York Times (blog) |archive-url=https://web.archive.org/web/20110405205656/http://thecaucus.blogs.nytimes.com/2011/04/04/obama-launches-re-election-facing-new-political-challenges/ |archive-date = April 5, 2011 }}</ref><ref>{{cite news |title = Obama announces re-election bid |url=http://www.upi.com/Top_News/US/2011/04/04/Obama-announces-re-election-bid/UPI-95081301905800/?dailybrief |date = April 4, 2011 |work = [[United Press International]] |archive-url=https://web.archive.org/web/20110510011832/http://www.upi.com/Top_News/US/2011/04/04/Obama-announces-re-election-bid/UPI-95081301905800/?dailybrief |archive-date = May 10, 2011 }}</ref><ref>{{cite news |title = Obama Opens 2012 Campaign, With Eye on Money and Independent Voters |url=https://www.nytimes.com/2011/04/05/us/politics/05obama.html |date = April 4, 2011 |first1 = Jeff |last1 = Zeleny |work = The New York Times |first2 = Jackie |last2 = Calmes |name-list-style = amp |access-date = April 5, 2011 |archive-url=https://web.archive.org/web/20121115021431/http://www.nytimes.com/2011/04/05/us/politics/05obama.html|archive-date=November 15, 2012 }}</ref> As the incumbent president, he ran virtually unopposed in the [[Democratic Party presidential primaries, 2012|Democratic Party presidential primaries]],<ref name="CNN-clinch1">{{cite news |url=http://politicalticker.blogs.cnn.com/2012/04/03/leading-presidential-candidate-to-clinch-nomination-tuesday/ |title = Leading presidential candidate to clinch nomination Tuesday |publisher = CNN (blog) |last = Yoon |first = Robert |date = April 3, 2012 |access-date = May 2, 2012 }}</ref> and on April 3, 2012, Obama secured the 2778 [[2012 Democratic National Convention|convention]] delegates needed to win the Democratic nomination.<ref name="CNN-clinch2">{{cite news |url=http://politicalticker.blogs.cnn.com/2012/04/03/breaking-obama-clinches-democratic-nomination/ |title = Obama clinches Democratic nomination |publisher = CNN (blog) |date = April 3, 2012 |access-date = April 3, 2012 }}</ref>
+
+At the [[2012 Democratic National Convention|Democratic National Convention]] in [[Charlotte, North Carolina]], Obama and [[Joe Biden]] were formally nominated by former President [[Bill Clinton]] as the Democratic Party candidates for president and vice president in the general election. Their main opponents were Republicans [[Mitt Romney]], the former governor of Massachusetts, and Representative [[Paul Ryan]] of Wisconsin.<ref>{{cite news |last = Cohen |first = Tom |title = Clinton says Obama offers a better path forward for America |url=http://edition.cnn.com/2012/09/05/politics/democratic-convention-wrap/index.html |publisher = CNN |date = September 6, 2012 |access-date = July 5, 2015 }}</ref>
+
+On November 6, 2012, Obama won 332 [[Electoral College (United States)|electoral votes]], exceeding the 270 required for him to be reelected as president.<ref>{{cite news|last=Lauter |first=David |title=Romney campaign gives up in Florida |url=https://www.chicagotribune.com/news/la-pn-romney-concedes-florida-election-20121108,0,415187.story |archive-url=https://web.archive.org/web/20121109020204/http://www.chicagotribune.com/news/la-pn-romney-concedes-florida-election-20121108%2C0%2C415187.story |archive-date=November 9, 2012 |newspaper=Chicago Tribune |date=November 8, 2012 |access-date=July 5, 2015 |url-status=dead }}</ref><ref>{{cite news |last = Barnes |first = Robert |title = Obama wins a second term as U.S. president |url=https://www.washingtonpost.com/politics/decision2012/after-grueling-campaign-polls-open-for-election-day-2012/2012/11/06/d1c24c98-2802-11e2-b4e0-346287b7e56c_story.html |newspaper = The Washington Post |date = November 6, 2012 |access-date = July 5, 2015 }}</ref><ref>{{cite news |last1 = Welch |first1 = William M. |last2 = Strauss |first2 = Gary |title = With win in critical battleground states, Obama wins second term |url=https://www.usatoday.com/story/news/politics/2012/11/06/election-day-obama-romney/1680933/ |newspaper = USA Today |date = November 7, 2012 |access-date = July 5, 2015 }}</ref> With 51.1 percent of the popular vote,<ref name="FEC">{{cite web |url=http://www.fec.gov/pubrec/fe2012/federalelections2012.pdf |title = Election Results for the U.S. President, the U.S. Senate and the U.S. House of Representatives |publisher = [[Federal Elections Commission]] |author = FEC |date = July 2013 |access-date = August 20, 2013 |page = 5 }}</ref> Obama became the first Democratic president since [[Franklin D. Roosevelt]] to win the [[List of United States presidential elections by popular vote margin|majority of the popular vote]] twice.<ref>{{cite news |last=Brownstein |first=Ronald |title=The U.S. has reached a demographic milestone—and it's not turning back |url=http://www.nationaljournal.com/thenextamerica/demographics/the-u-s-has-reached-a-demographic-milestone-and-it-s-not-turning-back-20121109 |work=[[National Journal]] |date=November 9, 2012 |archive-url=https://web.archive.org/web/20121111231854/http://www.nationaljournal.com/thenextamerica/demographics/the-u-s-has-reached-a-demographic-milestone-and-it-s-not-turning-back-20121109 |archive-date=November 11, 2012 |access-date=July 5, 2015 }}</ref><ref>{{cite news |url=http://www.thenation.com/blog/171178/obama-has-great-big-mandate-and-he-must-use-it |title = Obama's 3 Million Vote, Electoral College Landslide, Majority of States Mandate |last = Nichols |first = John |date = November 9, 2012 |work = The Nation |access-date = November 18, 2012 }}</ref> Obama addressed supporters and volunteers at Chicago's [[McCormick Place]] after his reelection and said: "Tonight you voted for action, not politics as usual. You elected us to focus on your jobs, not ours. And in the coming weeks and months, I am looking forward to reaching out and working with leaders of both parties."<ref>{{cite news|last=Lee|first=Kristen A.|title=Election 2012: President Obama gives victory speech in front of thousands in Chicago, 'I have never been more hopeful about America{{'-}}|url=http://www.nydailynews.com/news/politics/president-obama-victory-speech-hopeful-america-article-1.1197895|access-date=November 8, 2012|newspaper=Daily News|location=New York|date=November 7, 2012}}</ref><ref name="NYT20130121">{{cite news|url=https://www.nytimes.com/2013/01/22/us/politics/obama-inauguration-draws-hundreds-of-thousands.html |archive-url=https://web.archive.org/web/20130121151143/http://www.nytimes.com/2013/01/22/us/politics/obama-inauguration-draws-hundreds-of-thousands.html |archive-date=January 21, 2013 |url-access=subscription |url-status=live|title=Obama Offers Liberal Vision: 'We Must Act{{'-}}|newspaper=[[The New York Times]]|first=Michael|last=Shear|date=January 21, 2013|access-date=July 10, 2013}}</ref>
+
+==Presidency (2009–2017)==
+[[File:Official portrait of Barack Obama.jpg|thumb|First official portrait of Barack Obama as President of the United States, 2009]]
+{{Main|Presidency of Barack Obama}}
+{{for timeline|Timeline of the Barack Obama presidency}}
+
+===First 100 days===
+
+{{Main|First 100 days of Barack Obama's presidency}}
+[[File:US President Barack Obama taking his Oath of Office - 2009Jan20.jpg|thumb|Obama takes [[Oath of office of the President of the United States|the oath of office]] administered by [[Chief Justice of the United States|Chief Justice]] [[John Roberts|John G. Roberts Jr.]] at [[United States Capitol|the Capitol]], January 20, 2009|alt=Photograph]]
+The [[First inauguration of Barack Obama|inauguration of Barack Obama]] as the 44th president took place on January 20, 2009. In his first few days in office, Obama issued [[executive order]]s and [[Presidential memorandum|presidential memoranda]] directing the U.S. military to develop plans to withdraw troops from Iraq.<ref>{{cite news |title=Obama asks Pentagon for responsible Iraq drawdown |date=January 23, 2009 |url=https://www.post-gazette.com/news/nation/2009/01/22/Obama-asks-Pentagon-for-responsible-Iraq-drawdown/stories/200901220423 |work=[[Pittsburgh Post-Gazette]] |first1=Anne |last1=Gearan |first2=Lolita C. |last2=Baldor |agency=Associated Press |access-date=February 23, 2020 }}</ref> He ordered the closing of the [[Guantanamo Bay detention camp]],<ref>{{cite news |url=https://www.nytimes.com/2009/01/22/washington/22gitmo.html |title = Obama Orders Halt to Prosecutions at Guantánamo |last = Glaberson |first = William |date = January 21, 2009 |work = The New York Times |access-date = February 3, 2009 |archive-url=https://web.archive.org/web/20090416015909/http://www.nytimes.com/2009/01/22/washington/22gitmo.html|archive-date=April 16, 2009 }}</ref> but Congress prevented the closure by refusing to appropriate the required funds<ref>{{cite news |title = Senate blocks transfer of Gitmo detainees |url=https://www.nbcnews.com/id/30826649 |date=May 20, 2009 |work = [[NBC News]] |agency = Associated Press |mode = cs2 |access-date = March 22, 2011 }}</ref><ref>{{cite web |title=Presidential Memorandum—Closure of Detention Facilities at the Guantanamo Bay Naval Base |url=https://obamawhitehouse.archives.gov/the-press-office/presidential-memorandum-closure-dentention-facilities-guantanamo-bay-naval-base |date=December 15, 2009 |first=Barack |last=Obama |mode = cs2 |via=[[NARA|National Archives]] |work=[[whitehouse.gov]] |access-date = March 22, 2011 }}</ref><ref>{{cite news |title=Obama signs Defense authorization bill |url=https://federalnewsnetwork.com/congress/2011/01/obama-signs-defense-authorization-bill/ |date = January 7, 2011 |first = Jared |last = Serbu |publisher = [[Federal News Radio]] |mode = cs2 |access-date = March 22, 2011 }}</ref> and preventing moving any Guantanamo detainee.<ref>{{cite news |url=https://www.npr.org/2013/01/23/169922171/obamas-promise-to-close-guantanamo-prison-falls-short |title = Obama's Promise To Close Guantanamo Prison Falls Short |last = Northam |first = Jackie |date = January 23, 2013 |access-date = April 22, 2013 |publisher = [[NPR]] }}</ref> Obama reduced the secrecy given to presidential records.<ref>{{cite web|url=https://www.whitehouse.gov/the_press_office/ExecutiveOrderPresidentialRecords/ |title=Executive Order—Presidential Records |access-date=January 22, 2009 |archive-url=https://web.archive.org/web/20090122234307/http://www.whitehouse.gov/the_press_office/ExecutiveOrderPresidentialRecords/ |archive-date=January 22, 2009 |url-status=dead }}</ref> He also revoked President [[George W. Bush]]'s restoration of President [[Ronald Reagan]]'s [[Mexico City policy]] which prohibited federal aid to international [[family planning]] organizations that perform or provide counseling about [[abortion]].<ref>{{cite web |last = Obama |first = Barack |date = January 23, 2009 |title = Mexico City Policy and assistance for voluntary population planning (Presidential memorandum) |publisher = The White House |url=https://www.gpo.gov/fdsys/pkg/CFR-2010-title3-vol1/pdf/CFR-2010-title3-vol1-other-id197.pdf |access-date = September 21, 2012}}
+* {{cite news |last = Meckler |first = Laura |date = January 24, 2009 |title = Obama lifts 'gag rule' on family-planning groups |newspaper = The Wall Street Journal |page = A3 |url=https://www.wsj.com/articles/SB123272364299610287 |access-date = September 21, 2012 }}
+* {{cite news |last1 = Stein |first1 = Rob |last2 = Shear |first2 = Michael |date = January 24, 2009 |title = Funding restored to groups that perform abortions, other care |newspaper = The Washington Post |page = A3 |url=https://www.washingtonpost.com/wp-dyn/content/article/2009/01/23/AR2009012302814.html |access-date = September 21, 2012 |quote = Lifting the Mexico City Policy would not permit U.S. tax dollars to be used for abortions, but it would allow funding to resume to groups that provide other services, including counseling about abortions. }}</ref>
+
+===Domestic policy===
+
+{{See also|Social policy of the Barack Obama administration}}
+
+The first bill signed into law by Obama was the [[Lilly Ledbetter Fair Pay Act of 2009]], relaxing the [[statute of limitations]] for equal-pay lawsuits.<ref>{{cite news |title = Obama Signs Equal-Pay Legislation |work = The New York Times |first=Sheryl Gay|last=Stolberg|url=https://www.nytimes.com/2009/01/30/us/politics/30ledbetter-web.html |archive-url=https://web.archive.org/web/20090130125449/http://www.nytimes.com/2009/01/30/us/politics/30ledbetter-web.html |archive-date=January 30, 2009 |url-access=subscription |url-status=live |access-date = June 15, 2009 |date = January 30, 2009 }}</ref> Five days later, he signed the reauthorization of the [[State Children's Health Insurance Program]] to cover an additional four million uninsured children.<ref>{{cite news|title=Obama signs into law expansion of SCHIP health care program for children |work=Chicago Tribune |url=https://www.chicagotribune.com/news/nationworld/chi-kids-health-care_thufeb05,0,30310.story |access-date=June 15, 2009 |first=Noam N. |last=Levey |archive-url=https://web.archive.org/web/20090430194400/http://www.chicagotribune.com/news/nationworld/chi-kids-health-care_thufeb05%2C0%2C30310.story |archive-date=April 30, 2009 |url-status=dead |date=February 5, 2009 }}</ref> In March 2009, Obama reversed a Bush-era policy that had limited funding of [[embryonic stem cell]] research and pledged to develop "strict guidelines" on the research.<ref>{{cite news |url=http://www.cnn.com/2009/POLITICS/03/09/obama.stem.cells/index.html |title = Obama overturns Bush policy on stem cells |publisher = CNN |date = March 9, 2009 |access-date = April 18, 2010 |archive-url=https://web.archive.org/web/20100330183125/http://www.cnn.com/2009/POLITICS/03/09/obama.stem.cells/index.html |archive-date = March 30, 2010 }}</ref>
+
+[[File:Barack Obama addresses joint session of Congress 2009-02-24.jpg|thumb|left|Obama delivers a [[Barack Obama speech to joint session of Congress, February 2009|speech at joint session of Congress]] with Vice President [[Joe Biden]] and [[Speaker of the United States House of Representatives|House Speaker]] [[Nancy Pelosi]] on February 24, 2009.]]
+
+Obama appointed two women to serve on the Supreme Court in the first two years of his presidency. He nominated [[Sonia Sotomayor]] on May 26, 2009, to replace retiring [[Associate Justice of the Supreme Court of the United States|Associate Justice]] [[David Souter]]; she was confirmed on August 6, 2009,<ref>{{cite news |title = Senate confirms Sotomayor for Supreme Court |url=https://edition.cnn.com/2009/POLITICS/08/06/sonia.sotomayor/ |first1=Lisa |last1=Desjardins |first2=Kristi |last2=Keck |first3=Bill |last3=Mears |date = August 6, 2009 |publisher = CNN |access-date = August 6, 2009 }}</ref> becoming the first Supreme Court Justice of [[Hispanic]] descent.<ref>{{cite news |url=http://www.cnn.com/2009/POLITICS/05/26/supreme.court/index.html |first1=Peter |last1=Hamby |first2=Ed |last2=Henry |first3=Suzanne |last3=Malveaux |first4=Bill |last4=Mears |title = Obama nominates Sotomayor to Supreme Court |access-date = September 13, 2014 }}</ref> Obama nominated [[Elena Kagan]] on May 10, 2010, to replace retiring Associate Justice [[John Paul Stevens]]. She was confirmed on August 5, 2010, bringing the number of women sitting simultaneously on the Court to three for the first time in American history.<ref>{{cite news |url = https://www.theledger.com/article/LK/20101004/News/608110519/LL/ |title = New Era Begins on High Court: Kagan Takes Place as Third Woman |last = Sherman |first = Mark |date = October 4, 2010 |agency = Associated Press |access-date = November 13, 2010 |archive-date = October 10, 2017 |archive-url = https://web.archive.org/web/20171010074850/http://www.theledger.com/article/LK/20101004/News/608110519/LL/ |url-status = dead }}</ref>
+
+On March 11, 2009, Obama created the [[White House Council on Women and Girls]], which formed part of the [[White House Office of Intergovernmental Affairs|Office of Intergovernmental Affairs]], having been established by {{Executive Order|13506}} with a broad mandate to advise him on issues relating to the welfare of American women and girls.<ref name="Executive">''Executive Order 13506'', Washington, DC: President Barack Obama, The White House, March 11, 2009, Obama, B. Retrieved January 27, 2014.</ref> The council was chaired by [[Senior Advisor to the President]] [[Valerie Jarrett]].<ref name="Sexualassault">{{cite web |url=https://obamawhitehouse.archives.gov/blog/2014/01/22/renewed-call-action-end-rape-and-sexual-assault |title = A renewed call to action to end rape and sexual assault |first=Valerie |last=Jarrett |access-date = September 13, 2014 |via= [[NARA|National Archives]] |work= [[whitehouse.gov]] |date = January 23, 2014 }}</ref> Obama also established the [[White House Task Force to Protect Students from Sexual Assault]] through a government memorandum on January 22, 2014, with a broad mandate to advise him on issues relating to sexual assault on college and university campuses throughout the United States.<ref name="Sexualassault" /><ref name="Memo">{{cite web |url=https://obamawhitehouse.archives.gov/the-press-office/2014/01/22/memorandum-establishing-white-house-task-force-protect-students-sexual-a |title = Memorandum: Establishing White House Task Force to Protect Students from Sexual Assault |access-date = September 13, 2014 |via= [[NARA|National Archives]] |work= [[whitehouse.gov]] |date = January 22, 2014 }}</ref><ref name="Freedom">{{cite news |url = https://www.msnbc.com/morning-joe/obama-we-have-power-end-sexual-assaults |title = Obama admin: Freedom from sexual assault a basic human right |publisher = MSNBC |access-date = September 13, 2014 |date = January 22, 2014 |archive-date = January 25, 2014 |archive-url = https://web.archive.org/web/20140125031015/http://www.msnbc.com/morning-joe/obama-we-have-power-end-sexual-assaults |url-status = dead }}</ref> The co-chairs of the Task Force were Vice President Joe Biden and Jarrett.<ref name="Memo" /> The Task Force was a development out of the White House Council on Women and Girls and [[Office of the Vice President of the United States]], and prior to that the 1994 [[Violence Against Women Act]] first drafted by Biden.<ref name="Report">{{cite web |url=http://www.sapr.mil/public/docs/research/201401_WhiteHouse_CouncilonWomenandGirls_RapeandSexualAssault.pdf |title=Rape and sexual assault: A renewed call to action |work=White House Council on Women and Girls |location=Washington, D.C. |publisher=White House Council on Women and Girls & Office of the Vice President |date=January 2014 |access-date=June 10, 2014 |archive-url=https://web.archive.org/web/20140402015447/http://www.sapr.mil/public/docs/research/201401_WhiteHouse_CouncilonWomenandGirls_RapeandSexualAssault.pdf |archive-date=April 2, 2014|url-status=dead }}</ref>
+
+In a [[Space policy of the Barack Obama administration|major space policy speech]] in April 2010, Obama announced a planned change in direction at [[NASA]], the U.S. space agency. He ended plans for a return of [[human spaceflight]] to the moon and development of the [[Ares I]] rocket, [[Ares V]] rocket and [[Constellation program]], in favor of funding [[Earth science]] projects, a new rocket type, research and development for an eventual crewed mission to Mars, and ongoing missions to the [[International Space Station]].<ref>{{cite news |first1=Robert |last1=Block |first2=Mark K. |last2=Matthews |url=https://www.latimes.com/archives/la-xpm-2010-jan-27-la-na-nasa-budget27-2010jan27-story.html |title = White House won't fund NASA moon program |quote = President Obama's budget proposal includes no money for the Ares I and Ares V rocket or Constellation program. Instead, NASA would be asked to monitor climate change and develop a new rocket |date = January 27, 2010 |work = Los Angeles Times |access-date = January 30, 2011 }}</ref>
+
+[[File:Barack Obama visiting victims of 2012 Aurora shooting.jpg|thumb|Obama visits an [[2012 Aurora, Colorado shooting|Aurora shooting]] victim at [[University of Colorado Hospital]], 2012.]]
+
+On January 16, 2013, one month after the [[Sandy Hook Elementary School shooting]], Obama signed 23 executive orders and outlined a series of sweeping proposals regarding [[Gun politics in the United States|gun control]].<ref>{{cite news |url=https://www.bbc.co.uk/news/world-us-canada-21049942 |publisher = BBC News |title = US gun debate: Obama unveils gun control proposals |first = Mark |last = Mardell |date = January 16, 2013 |access-date = January 16, 2013 }}</ref> He urged Congress to reintroduce an [[Federal Assault Weapons Ban|expired ban]] on military-style [[assault weapons]], such as those used in several recent mass shootings, impose limits on ammunition magazines to 10 rounds, introduce background checks on all gun sales, pass a ban on possession and sale of armor-piercing bullets, introduce harsher penalties for gun-traffickers, especially unlicensed dealers who buy arms for criminals and approving the appointment of the head of the federal [[Bureau of Alcohol, Tobacco, Firearms and Explosives]] for the first time since 2006.<ref>{{cite news |title = What's in Obama's Gun Control Proposal |url=https://www.nytimes.com/interactive/2013/01/16/us/obama-gun-control-proposal.html |work = The New York Times |date = January 16, 2013 |access-date = February 12, 2013 }}</ref> On January 5, 2016, Obama announced new executive actions extending background check requirements to more gun sellers.<ref>{{cite news |url=https://edition.cnn.com/2016/01/05/politics/obama-gun-control-executive-action/ |title=Obama announces gun control executive action (full transcript) |work=CNN|date=January 5, 2016 |access-date=January 7, 2016 }}</ref> In a 2016 editorial in ''The New York Times'', Obama compared the struggle for what he termed "common-sense gun reform" to [[women's suffrage]] and other [[civil rights movements]] in American history.<ref>{{cite news |last=Obama |first=Barack |url=https://www.nytimes.com/2016/01/08/opinion/president-barack-obama-guns-are-our-shared-responsibility.html |title=Barack Obama: Guns Are Our Shared Responsibility |work=The New York Times |date=January 7, 2016 |access-date=January 7, 2016 }}</ref>
+
+In 2011, Obama signed a four-year renewal of the Patriot Act.<ref>{{cite news |url=https://www.nbcnews.com/id/43180202/ns/us_news-security/t/obama-europe-signs-patriot-act-extension/ |work=[[NBC News]] |title=Obama, in Europe, signs Patriot Act extension | date=May 27, 2011|access-date= August 8, 2019}}</ref> Following the [[Global surveillance disclosures (2013–present)|2013 global surveillance disclosures]] by [[whistleblower]] [[Edward Snowden]], Obama condemned the leak as unpatriotic,<ref name="CNN-Snowden">{{cite news |work=CNN|url=http://www.cnn.com/2013/08/12/politics/obama-snowden-whistleblower | title=Fact-checking Obama's claims about Snowden | date=August 13, 2013 | access-date=August 8, 2019 |last=Wolf |first=Z. Byron}}</ref> but called for increased restrictions on the [[National Security Agency]] (NSA) to address violations of privacy.<ref>{{cite news |url=https://www.reuters.com/article/usa-security-obama-idUSL1N0MS1QW20140403?type=companyNews| title=Obama's NSA overhaul may require phone carriers to store more data| date=April 3, 2014 | work=Reuters | access-date=August 8, 2019 | author=Hosenball, Mark}}</ref><ref>{{cite news |last=Ackerman |first=Spencer |date=January 17, 2014 |title=Obama to overhaul NSA's bulk storage of Americans' telephone data |url=https://www.theguardian.com/world/2014/jan/17/obama-end-nsa-bulk-storage-telephone-metadata |work=[[The Guardian]] |access-date=August 12, 2019 }}</ref> Obama continued and expanded surveillance programs set up by George W. Bush, while implementing some reforms.<ref name=":0">{{Cite web |last=Roth |first=Kenneth |date=2017-01-09 |title=Barack Obama's Shaky Legacy on Human Rights |url=https://www.hrw.org/news/2017/01/09/barack-obamas-shaky-legacy-human-rights |access-date=2022-06-26 |website=[[Human Rights Watch]] |language=en}}</ref> He supported legislation that would have limited the NSA's ability to collect phone records in bulk under a single program and supported bringing more transparency to the [[United States Foreign Intelligence Surveillance Court|Foreign Intelligence Surveillance Court]] (FISC).<ref name=":0" />
+<!--
+<ref>{{cite news |url=https://www.huffingtonpost.com/2013/06/17/obama-nsa-surveillance_n_3455771.html | title=Obama Defends NSA Surveillance Program, Says It's 'Transparent' | work=The Huffington Post | date=June 17, 2013 | access-date=February 21, 2014 |last=Reilly |first=Molly}}</ref>
+-->
+
+====LGBT rights and same-sex marriage====
+
+On October 8, 2009, Obama signed the [[Matthew Shepard and James Byrd Jr. Hate Crimes Prevention Act]], a measure that expanded the [[Hate crime laws in the United States#Federal prosecution of hate crimes|1969 United States federal hate-crime law]] to include crimes motivated by a victim's actual or perceived gender, sexual orientation, gender identity, or disability.<ref>{{cite news |url=https://edition.cnn.com/2009/POLITICS/10/28/hate.crimes/ |title=Obama signs hate crimes bill into law |work=CNN|date=October 28, 2009 |access-date=October 12, 2011}}</ref> On October 30, 2009, Obama lifted the ban on travel to the United States by those infected with [[HIV]]. The lifting of the ban was celebrated by [[Immigration Equality]].<ref>{{cite news |last=Preston |first=Julia |date=October 30, 2009 |url=https://www.nytimes.com/2009/10/31/us/politics/31travel.html |archive-url=https://web.archive.org/web/20100407213122/http://www.nytimes.com/2009/10/31/us/politics/31travel.html |archive-date=April 7, 2010 |url-access=subscription |url-status=live |title=Obama Lifts a Ban on Entry Into U.S. by H.I.V.-Positive People |newspaper=The New York Times |access-date=February 8, 2017 }}</ref> On December 22, 2010, Obama signed the [[Don't Ask, Don't Tell Repeal Act of 2010]], which fulfilled a promise made in the 2008 presidential campaign<ref>{{cite news |url=https://www.theguardian.com/world/2010/dec/22/obama-repeals-dont-ask-dont-tell |title = 'Don't ask, don't tell' repealed as Obama signs landmark law |work = The Guardian |location = London |date = December 22, 2010 |access-date = June 2, 2018 |archive-url=https://web.archive.org/web/20101223060037/http://www.guardian.co.uk/world/2010/dec/22/obama-repeals-dont-ask-dont-tell |archive-date = December 23, 2010}}</ref><ref>{{cite news|author=Sheryl Gay Stolberg|url=https://www.nytimes.com/2010/12/23/us/politics/23military.html |archive-url=https://web.archive.org/web/20110512170430/http://www.nytimes.com/2010/12/23/us/politics/23military.html |archive-date=May 12, 2011 |url-access=subscription |url-status=live|title=Obama Signs Away 'Don't Ask, Don't Tell'|date=December 23, 2010|newspaper=The New York Times}}</ref> to end the [[don't ask, don't tell]] policy of 1993 that had prevented gay and lesbian people from serving openly in the [[United States Armed Forces]].<ref>{{cite web |last=Lee |first=Jesse |url=https://obamawhitehouse.archives.gov/blog/2010/12/22/president-signs-repeal-dont-ask-dont-tell-out-many-we-are-one |title=The President Signs Repeal of "Don't Ask Don't Tell": "Out of Many, We Are One" |access-date = December 22, 2010|via=[[NARA|National Archives]] |work=[[whitehouse.gov]] |date = December 22, 2010 }}</ref> In 2016, the Pentagon ended the policy that barred [[Transgender personnel in the United States military|transgender people from serving openly in the military]].<ref name=TransBan1>{{cite news|url=https://www.theguardian.com/us-news/2016/jun/30/us-military-ends-ban-transgender-service-members |first1=Molly |last1=Redden |first2=Amanda |last2=Holpuch |title=US military ends ban on transgender service members|work=The Guardian|date=June 30, 2016}}</ref>
+
+[[File:Celebrating a new America -lovewins 58242 (18588276403).jpg|thumb|The [[White House]] was illuminated in rainbow colors on the evening of the Supreme Court [[Obergefell v. Hodges|same-sex marriage ruling]], June 26, 2015.]]
+As a candidate for the Illinois state senate in 1996, Obama stated he favored legalizing [[Same-sex marriage in the United States|same-sex marriage]].<ref name="WCT0114">{{cite news |last = Baim |first = Tracy |title = Windy City Times exclusive: Obama's Marriage Views Changed. WCT Examines His Step Back |url=http://www.windycitymediagroup.com/lgbt/Windy-City-Times-exclusive-Obamas-Marriage-Views-Changed-WCT-Examines-His-Step-Back/20524.html |access-date = May 10, 2012 |newspaper = [[Windy City Times]] |date = January 14, 2009 }}</ref> During his Senate run in 2004, he said he supported civil unions and domestic partnerships for same-sex partners but opposed same-sex marriages.<ref name="WCT0204">{{cite news |last = Baim |first = Tracy |title = Obama Seeks U.S. Senate seat |url=http://www.windycitymediagroup.com/gay/lesbian/news/ARTICLE.php?AID=3931 |access-date = May 10, 2012 |newspaper = [[Windy City Times]] |date = February 4, 2004 }}</ref> In 2008, he reaffirmed this position by stating "I believe marriage is between a man and a woman. I am not in favor of gay marriage."<ref>{{Cite news|url=https://www.politifact.com/truth-o-meter/statements/2012/may/11/barack-obama/president-barack-obamas-shift-gay-marriage/|title=President Barack Obama's shifting stance on gay marriage|work=PolitiFact|access-date=November 28, 2018}}</ref> On May 9, 2012, shortly after the official launch of his campaign for re-election as president, Obama said his views had evolved, and he publicly affirmed his personal support for the legalization of same-sex marriage, becoming the first sitting U.S. president to do so.<ref>{{cite news |url=https://www.cbsnews.com/news/obama-backs-same-sex-marriage/ |first=Corbett |last=Daly |title=Obama backs same-sex marriage |work=[[CBS News]] |date=May 9, 2012 |access-date = May 9, 2012 }}</ref><ref name="The Huffington Post">{{cite news |url=https://www.huffingtonpost.com/2012/05/09/obama-gay-marriage_n_1503245.html |title = Obama Backs Gay Marriage |last = Stein |first = Sam |date = May 9, 2012 |work = The Huffington Post |access-date = July 5, 2015 }}</ref> During his second [[Second inauguration of Barack Obama|inaugural address]] on January 21, 2013,<ref name="NYT20130121" /> Obama became the first U.S. president in office to call for full equality for gay Americans, and the first to mention [[LGBT rights in the United States|gay rights]] or the word "gay" in an inaugural address.<ref>{{cite news |last = Robillard |first = Kevin |title = First inaugural use of the word 'gay' |url=https://www.politico.com/story/2013/01/first-inaugural-use-of-the-word-gay-086499 |access-date = January 21, 2013 |work = Politico |date = January 21, 2013 }}</ref><ref>{{cite news |title = Obama Inauguration Speech Makes History With Mention of Gay Rights Struggle, Stonewall Uprising |url=https://www.huffingtonpost.com/2013/01/21/obama-inauguration-speech-stonewall-gays_n_2520962.html |work = The Huffington Post |access-date = January 21, 2013 |first = Noah |last = Michelson |date = January 21, 2013 }}</ref> In 2013, the Obama administration filed briefs that urged the [[Supreme Court of the United States|Supreme Court]] to rule in favor of same-sex couples in the cases of ''[[Hollingsworth v. Perry]]'' (regarding [[Same-sex marriage in the United States|same-sex marriage]])<ref name="huffpo-amicus">{{cite news |url=https://www.huffingtonpost.com/2013/02/28/obama-gay-marriage_n_2783912.html |title = Obama Administration: Gay Marriage Ban Unconstitutional In Prop. 8 Supreme Court Case |last = Reilly |first = Ryan J. |date = February 28, 2013 |work = [[The Huffington Post]] |access-date = April 21, 2013 }}</ref> and ''[[United States v. Windsor]]'' (regarding the [[Defense of Marriage Act]]).<ref name="cnn-amicus">{{cite news |url=https://edition.cnn.com/2013/02/22/politics/supreme-court-marriage |title=Obama administration weighs in on defense of marriage law |last = Mears |first = Bill |date = February 27, 2013 |publisher = CNN |access-date = April 21, 2013 }}</ref>
+
+====Economic policy====
+
+{{Main|Economic policy of the Barack Obama administration}}
+[[File:20090124 WeeklyAddress.ogv|thumbtime=1:3|thumb|Obama presents his first [[commons:Obama Administration weekly video addresses|weekly address]] as president of the United States on January 24, 2009, discussing the [[American Recovery and Reinvestment Act of 2009]]|alt=Photograph]]
+
+On February 17, 2009, Obama signed the [[American Recovery and Reinvestment Act of 2009]], a $787{{nbs}}billion (equivalent to ${{Inflation|US|787|2009}} billion in {{Inflation/year|US}}) [[stimulus (economics)|economic stimulus]] package aimed at helping the economy recover from the [[Great Recession|deepening worldwide recession]].<ref>{{cite news |url=http://www.cnn.com/2009/POLITICS/02/13/stimulus/index.html |title = Stimulus package en route to Obama's desk |access-date = March 29, 2009 |publisher = CNN |date = February 14, 2009 |archive-url=https://web.archive.org/web/20090330094958/http://www.cnn.com/2009/POLITICS/02/13/stimulus/index.html |archive-date = March 30, 2009 |url-status=live }}</ref> The act includes increased federal spending for health care, infrastructure, education, various tax breaks and [[tax incentive|incentives]], and direct assistance to individuals.<ref name="direct assistance" /> In March 2009, Obama's [[Treasury Secretary]], [[Timothy Geithner]], took further steps to manage the [[financial crisis of 2007–08|financial crisis]], including introducing the [[Public–Private Investment Program for Legacy Assets]], which contains provisions for buying up to $2{{nbs}}trillion in depreciated real estate assets.<ref name="markets opened" />
+
+[[File:U.S. Total Deficits vs. National Debt Increases 2001-2010.png|thumb|[[United States federal budget|Deficit]] and [[National debt of the United States|debt]] increases, 2001–2016]]
+
+Obama intervened in the [[automotive industry crisis of 2008–10|troubled automotive industry]]<ref>{{cite news|title=White House questions viability of GM, Chrysler |date=March 30, 2009 |work=The Huffington Post |url=https://www.huffingtonpost.com/2009/03/30/obama-denies-bailout-fund_n_180563.html |url-status=dead |archive-url=https://web.archive.org/web/20090407010806/http://www.huffingtonpost.com/2009/03/30/obama-denies-bailout-fund_n_180563.html |archive-date=April 7, 2009 }}</ref> in March 2009, renewing loans for [[General Motors]] (GM) and [[Chrysler]] to continue operations while reorganizing. Over the following months the White House set terms for both firms' bankruptcies, including the [[Chrysler Chapter 11 reorganization|sale of Chrysler]] to Italian automaker [[Fiat]]<ref>{{cite news |title = Chrysler and Union Agree to Deal Before Federal Deadline |url=https://www.nytimes.com/2009/04/27/business/27chrysler.html |archive-url=https://web.archive.org/web/20090428062100/http://www.nytimes.com/2009/04/27/business/27chrysler.html |archive-date=April 28, 2009 |url-access=subscription |url-status=live |work = The New York Times |first1 = Nick |last1 = Bunkley |first2 = Bill |last2 = Vlasic |date = April 27, 2009 |access-date = April 12, 2010 }}</ref> and a [[General Motors Chapter 11 reorganization|reorganization of GM]] giving the U.S. government a temporary 60 percent equity stake in the company.<ref>{{cite news|title=GM Begins Bankruptcy Process With Filing for Affiliate |first1=John |last1=Hughes |first2=Caroline |last2=Salas |first3=Jeff |last3=Green |first4=Bob |last4=Van Voris |url=http://bloomberg.com/apps/news?pid=20601087&sid=aw4F_L7E4xYg |agency=[[Bloomberg News]] |date=June 1, 2009 |access-date=July 5, 2015 |url-status=dead |archive-url=https://web.archive.org/web/20100613163056/http://www.bloomberg.com/apps/news?pid=20601087 |archive-date=June 13, 2010 }}</ref> In June 2009, dissatisfied with the pace of economic stimulus, Obama called on his cabinet to accelerate the investment.<ref name="Christopher Conkey and Louise Radnofsky">{{cite news |title = Obama Presses Cabinet to Speed Stimulus Spending |date = June 9, 2009 |work = The Wall Street Journal |publisher = News Corp |url=https://www.wsj.com/articles/SB124445867883193821 |first1 = Christopher |last1 = Conkey |first2 = Louise |last2 = Radnofsky |access-date = July 5, 2015 }}</ref> He signed into law the [[Car Allowance Rebate System]], known colloquially as "Cash for Clunkers", which temporarily boosted the economy.<ref>{{cite news |url=https://www.washingtonpost.com/wp-dyn/content/article/2009/08/20/AR2009082002699.html |title = U.S. Says 'Cash for Clunkers' Program Will End on Monday |last = Hedgpeth |first = Dana |newspaper = The Washington Post |date = August 21, 2009 |access-date = March 26, 2010 }}</ref><ref>{{cite news |url=http://www.time.com/time/business/article/0,8599,1918692,00.html |archive-url=https://web.archive.org/web/20090828040214/http://www.time.com/time/business/article/0,8599,1918692,00.html |url-status= dead |archive-date= August 28, 2009 |title = Was Cash for Clunkers a Success? |last = Szczesny |first = Joseph R. |magazine = Time |date = August 26, 2009 |access-date = March 26, 2010 }}</ref><ref>{{cite journal |last1 = Mian |first1 = Atif R. |first2 = Amir |last2 = Sufi |s2cid = 219352572 |title = The Effects of Fiscal Stimulus: Evidence from the 2009 'Cash for Clunkers' Program |date = September 1, 2010 |ssrn = 1670759 |doi = 10.2139/ssrn.1670759 |journal=The Quarterly Journal of Economics|volume=127|issue=3|pages=1107–1142}}</ref>
+
+The Bush and Obama administrations authorized spending and loan guarantees from the [[Federal Reserve System|Federal Reserve]] and the [[United States Department of the Treasury|Department of the Treasury]]. These guarantees totaled about $11.5{{nbs}}trillion, but only $3{{nbs}}trillion had been spent by the end of November 2009.<ref>{{cite news |title = CNNMoney.com's bailout tracker |work=CNNMoney |page = 20 |volume = 06 |url=https://money.cnn.com/news/storysupplement/economy/bailouttracker/ |access-date = March 26, 2010 |last = Goldman |first = David |date = April 6, 2009 }}</ref> On August 2, 2011, after a lengthy congressional debate over whether to raise the nation's debt limit, Obama signed the bipartisan [[Budget Control Act of 2011]]. The legislation enforced limits on discretionary spending until 2021, established a procedure to increase the debt limit, created a Congressional Joint Select Committee on Deficit Reduction to propose further deficit reduction with a stated goal of achieving at least $1.5{{nbs}}trillion in budgetary savings over 10 years, and established automatic procedures for reducing spending by as much as $1.2{{nbs}}trillion if legislation originating with the new joint select committee did not achieve such savings.<ref>{{cite web |last = Stein |first = Sylvie |url=http://firstread.msnbc.msn.com/_news/2011/08/02/7231805-a-breakdown-of-the-debt-limit-legislation |archive-url=https://web.archive.org/web/20120114001916/http://firstread.msnbc.msn.com/_news/2011/08/02/7231805-a-breakdown-of-the-debt-limit-legislation |archive-date = January 14, 2012 |title = First Read—A breakdown of the debt-limit legislation |publisher = MSNBC |access-date = August 3, 2011 }}</ref> By passing the legislation, Congress was able to prevent a [[Federal government of the United States|U.S. government]] [[Default (finance)|default]] on its obligations.<ref>{{cite news |url=https://www.nbcnews.com/id/43967924 |title = House passes debt ceiling bill |work = NBC News |date = March 8, 2011 |access-date = August 3, 2011 }}</ref>
+
+The unemployment rate rose in 2009, reaching a peak in October at 10.0 percent and averaging 10.0 percent in the fourth quarter. Following a decrease to 9.7 percent in the first quarter of 2010, the unemployment rate fell to 9.6 percent in the second quarter, where it remained for the rest of the year.<ref name="Theodossiou">{{cite journal |last1 = Theodossiou |first1 = Eleni |last2 = Hipple |first2 = Steven F. |year = 2011 |title = Unemployment Remains High in 2010 |journal = Monthly Labor Review |volume = 134 |issue = 3 |pages = 3–22 |url=http://www.bls.gov/opub/mlr/2011/03/art1full.pdf |access-date = April 7, 2011 |archive-url=https://web.archive.org/web/20110508050328/http://www.bls.gov/opub/mlr/2011/03/art1full.pdf |archive-date = May 8, 2011 }}</ref> Between February and December 2010, employment rose by 0.8 percent, which was less than the average of 1.9 percent experienced during comparable periods in the past four employment recoveries.<ref name="Eddlemon">{{cite journal |last1 = Eddlemon |first1 = John P. |year = 2011 |title = Payroll Employment Turns the Corner in 2010 |journal = Monthly Labor Review |volume = 134 |issue = 3 |pages = 23–32 |url=http://www.bls.gov/opub/mlr/2011/03/art2full.pdf |access-date = April 7, 2011 |archive-url=https://web.archive.org/web/20110506195757/http://www.bls.gov/opub/mlr/2011/03/art2full.pdf |archive-date = May 6, 2011 }}</ref> By November 2012, the unemployment rate fell to 7.7 percent,<ref>{{cite web |url=http://data.bls.gov/pdq/SurveyOutputServlet |title = Unemployment Rate |publisher = [[Bureau of Labor Statistics]] |access-date = December 11, 2012 }}</ref> decreasing to 6.7 percent in the last month of 2013.<ref>{{cite web |url=http://data.bls.gov/timeseries/LNS14000000 |title = Unemployment Rate |publisher = [[Bureau of Labor Statistics]] |access-date = January 10, 2014 }}</ref> During 2014, the unemployment rate continued to decline, falling to 6.3 percent in the first quarter.<ref>{{cite web |url=http://data.bls.gov/timeseries/LNS14000000 |title = Unemployment Rate |publisher = [[Bureau of Labor Statistics]] |access-date = June 6, 2014 }}</ref> GDP growth returned in the third quarter of 2009, expanding at a rate of 1.6 percent, followed by a 5.0 percent increase in the fourth quarter.<ref name="BEA1">{{cite web |url=http://bea.gov/national/nipaweb/TableView.asp?SelectedTable=1&ViewSeries=NO&Java=no&Request3Place=N&3Place=N&FromView=YES&Freq=Qtr&FirstYear=2009&LastYear=2010&3Place=N&Update=Update&JavaBox=no#Mid |title = Percent Change in Real Gross Domestic Product (Quarterly) |website = National Income and Product Accounts Table |publisher = [[Bureau of Economic Analysis]] |access-date = April 7, 2011 |archive-url=https://web.archive.org/web/20110512014536/http://bea.gov/national/nipaweb/TableView.asp?SelectedTable=1&ViewSeries=NO&Java=no&Request3Place=N&3Place=N&FromView=YES&Freq=Qtr&FirstYear=2009&LastYear=2010&3Place=N&Update=Update&JavaBox=no#Mid |archive-date = May 12, 2011 |url-status=dead }}</ref> Growth continued in 2010, posting an increase of 3.7 percent in the first quarter, with lesser gains throughout the rest of the year.<ref name="BEA1" /> In July 2010, the [[Federal Reserve System|Federal Reserve]] noted that economic activity continued to increase, but its pace had slowed, and chairman [[Ben Bernanke]] said the economic outlook was "unusually uncertain".<ref>{{cite news |last = Harding |first = Robin |title = Beige Book survey reports signs of slowdown |url=http://www.ft.com/cms/s/0/dac3245a-9a7b-11df-87fd-00144feab49a.html |work = [[Financial Times]] |access-date = July 29, 2010 |date = July 28, 2010 |archive-url=https://web.archive.org/web/20100729184009/http://www.ft.com/cms/s/0/dac3245a-9a7b-11df-87fd-00144feab49a.html|archive-date=July 29, 2010 }}</ref> Overall, the economy expanded at a rate of 2.9 percent in 2010.<ref>{{cite web |url=http://bea.gov/national/nipaweb/TableView.asp?SelectedTable=1&ViewSeries=NO&Java=no&Request3Place=N&3Place=N&FromView=YES&Freq=Year&FirstYear=2009&LastYear=2010&3Place=N&Update=Update&JavaBox=no#Mid |title = Percent Change in Real Gross Domestic Product (Annual) |website = National Income and Product Accounts Table |publisher = Bureau of Economic Analysis |access-date = April 7, 2011 |archive-url=https://web.archive.org/web/20110512014513/http://bea.gov/national/nipaweb/TableView.asp?SelectedTable=1&ViewSeries=NO&Java=no&Request3Place=N&3Place=N&FromView=YES&Freq=Year&FirstYear=2009&LastYear=2010&3Place=N&Update=Update&JavaBox=no#Mid |archive-date = May 12, 2011 |url-status=dead }}</ref>
+
+[[File:US Employment Statistics.svg|thumb|left|upright=1.35|US employment statistics ([[unemployment rate]] and monthly changes in net employment) during Obama's tenure as U.S. president<ref>{{cite web |url=http://data.bls.gov/timeseries/LNS14000000 |title = Unemployment Rate |publisher = [[Bureau of Labor Statistics]] |access-date=September 12, 2018}}</ref><ref>{{cite web |url=http://data.bls.gov/timeseries/CES0000000001?output_view=net_1mth |title = 1-month net change in employment |publisher = [[Bureau of Labor Statistics]] |access-date=September 12, 2018}}</ref>]]
+
+The [[Congressional Budget Office]] (CBO) and a broad range of economists credit Obama's stimulus plan for economic growth.<ref name="estimated" /><ref name="newc" /> The CBO released a report stating that the stimulus bill increased employment by 1–2.1{{nbs}}million,<ref name="newc">{{cite news |url=https://www.nytimes.com/2009/11/21/business/economy/21stimulus.html |title = New Consensus Sees Stimulus Package as Worthy Step |work = The New York Times |date = November 20, 2009 |access-date = December 21, 2010 |first1 = Jackie |last1 = Calmes |first2 = Michael |last2 = Cooper |archive-url=https://web.archive.org/web/20110511230904/http://www.nytimes.com/2009/11/21/business/economy/21stimulus.html|archive-date=May 11, 2011 }}</ref><ref>{{cite news |url=http://thehill.com/blogs/blog-briefing-room/news/83253-cbo-stimulus-created-as-many-as-21-million-jobs |title = CBO: Stimulus created as many as 2.1 million jobs |date = February 23, 2010 |access-date = April 25, 2010 }}</ref><ref>{{cite news |url=https://www.nytimes.com/2009/11/02/opinion/02krugman.html |archive-url=https://web.archive.org/web/20091105001423/http://www.nytimes.com/2009/11/02/opinion/02krugman.html |archive-date=November 5, 2009 |url-access=subscription |url-status=live |title = Too Little of a Good Thing |work = The New York Times |date = November 2, 2009 |access-date = December 22, 2010 |first = Paul |last = Krugman }}</ref><ref>{{cite news |last = Isidore |first = Chris |url=https://money.cnn.com/2010/01/29/news/economy/gdp/index.htm |title = Best economic growth in six years |publisher = CNN |date = January 29, 2010 |access-date = April 18, 2010 }}</ref> while conceding that "it is impossible to determine how many of the reported jobs would have existed in the absence of the stimulus package."<ref name="estimated">{{cite web |url=http://www.cbo.gov/publication/42715 |title = Estimated Impact of the American Recovery and Reinvestment Act on Employment and Economic Output |date = November 22, 2011 |publisher = Congressional Budget Office |access-date = February 21, 2012 }}</ref> Although an April 2010, survey of members of the [[National Association for Business Economics]] showed an increase in job creation (over a similar January survey) for the first time in two years, 73 percent of 68 respondents believed the stimulus bill has had no impact on employment.<ref>{{cite web|url=http://www.nabe.com/publib/indsum.html |title=New NABE Survey Shows Business Recovery Gaining Momentum, with More Jobs Ahead |access-date=April 26, 2010 |archive-url=https://web.archive.org/web/20100502053859/http://www.nabe.com/publib/indsum.html |archive-date=May 2, 2010 |url-status=dead }}</ref> The economy of the United States has grown faster than the other original [[NATO]] members by a wider margin under President Obama than it has anytime since the end of [[World War II]].<ref>{{cite web |work=Politics that Work |url=http://politicsthatwork.com/graphs/gdp-growth-vs-nato-president |title=U.S. GDP Growth Relative to Original NATO Members |date=March 9, 2015 }}</ref> The [[OECD|Organisation for Economic Co-operation and Development]] credits the much faster growth in the United States to the stimulus plan of the U.S. and the austerity measures in the European Union.<ref>{{cite news |first=Irene |last=Chapple |url=https://edition.cnn.com/2013/05/29/business/oecd-u-s-europe-economic-recovery/ |title=OECD: U.S. will recover faster, Europe faces unemployment crisis |work=CNN|date=May 29, 2013 }}</ref>
+
+Within a month of the [[2010 United States elections|2010 midterm elections]], Obama announced a compromise deal with the Congressional Republican leadership that included a temporary, two-year extension of the [[Bush tax cuts|2001 and 2003 income tax rates]], a one-year [[Federal Insurance Contributions Act tax|payroll tax]] reduction, continuation of unemployment benefits, and a new rate and exemption amount for [[Estate tax in the United States|estate taxes]].<ref>{{cite news |url=https://www.nytimes.com/2010/12/08/us/politics/08cong.html |archive-url=https://web.archive.org/web/20101209044154/http://www.nytimes.com/2010/12/08/us/politics/08cong.html |archive-date=December 9, 2010 |url-access=subscription |url-status=live |title = Democrats Skeptical of Obama on New Tax Plan |last1 = Herszenhorn |first1 = David M. |last2 = Stolberg |first2 = Sheryl Gay |newspaper = The New York Times |date = December 7, 2010 }}</ref> The compromise overcame opposition from some in both parties, and the resulting $858{{nbs}}billion (equivalent to ${{Inflation|US|.858|2010|r=1}} trillion in {{Inflation/year|US}}) [[Tax Relief, Unemployment Insurance Reauthorization, and Job Creation Act of 2010]] passed with bipartisan majorities in both houses of Congress before Obama signed it on December 17, 2010.<ref>{{cite news |url=http://www.cnn.com/2010/POLITICS/12/17/tax.deal/index.html |title = Obama signs tax deal into law |publisher = CNN |date = December 17, 2010 |access-date = December 17, 2010 }}</ref>
+
+In December 2013, Obama declared that growing [[Income inequality in the United States|income inequality]] is a "defining challenge of our time" and called on Congress to bolster the safety net and raise wages. This came on the heels of the [[Fast food worker strikes|nationwide strikes of fast-food workers]] and [[Pope Francis]]' criticism of inequality and [[trickle-down economics]].<ref>{{cite news |url=https://finance.yahoo.com/news/obama-income-inequality-defining-challenge-164430631.html |title = Obama: Income Inequality a Defining Challenge |first = Jim |last = Kuhnhenn |agency = Associated Press |date = December 4, 2013 |access-date = January 9, 2014 }}</ref> Obama urged Congress to ratify a 12-nation free trade pact called the [[Trans-Pacific Partnership]].<ref>{{cite news |url=https://www.cbsnews.com/news/president-obama-makes-trade-deal-a-top-priority-in-remaining-months/ |title=President Obama uses his final months to bring congressional approval of a 12-nation free trade pact called the Trans-Pacific Partnership |date=September 5, 2016 |work=CBS News |access-date=September 5, 2016}}</ref>
+
+====Environmental policy====
+
+{{See also|Climate change policy of the United States|Energy policy of the Barack Obama administration}}
+[[File:Obama-venice-la.jpg|thumb|Obama at a 2010 briefing on the [[BP oil spill]] at the [[United States Coast Guard|Coast Guard]] Station Venice in [[Venice, Louisiana]]]]
+
+On April 20, 2010, an explosion destroyed an offshore [[drilling rig]] at the [[Macondo Prospect]] in the [[Gulf of Mexico]], causing a [[Deepwater Horizon oil spill|major sustained oil leak]]. Obama visited the Gulf, announced a federal investigation, and formed a bipartisan commission to recommend new safety standards, after a review by [[United States Secretary of the Interior|Secretary of the Interior]] [[Ken Salazar]] and concurrent Congressional hearings. He then announced a six-month moratorium on new [[deepwater drilling]] permits and leases, pending regulatory review.<ref>{{cite news |title = Obama Halts Drilling Projects, Defends Actions |publisher = NPR |date = May 27, 2010 |url=https://www.npr.org/templates/story/story.php?storyId=127205462&ps=rs }}</ref> As multiple efforts by BP failed, some in the media and public expressed confusion and criticism over various aspects of the incident, and stated a desire for more involvement by Obama and the federal government.<ref>{{cite news |first = Patrik |last = Jonsson |url=http://www.csmonitor.com/USA/Politics/2010/0529/Gulf-oil-spill-Obama-s-big-political-test |title = Gulf oil spill: Obama's big political test |work = [[The Christian Science Monitor]] |date = May 29, 2010 |access-date = June 6, 2010 |archive-url=https://web.archive.org/web/20100601094118/http://www.csmonitor.com/USA/Politics/2010/0529/Gulf-oil-spill-Obama-s-big-political-test |archive-date = June 1, 2010 |url-status=live }}</ref> Prior to the oil spill, on March 31, 2010, Obama ended a ban on oil and gas drilling along the majority of the [[East Coast of the United States]] and along the coast of [[Arctic Alaska|northern Alaska]] in an effort to win support for an energy and climate bill and to reduce foreign imports of oil and gas.<ref>{{Cite news|last=Neuman|first=Scott|date=March 31, 2010|title=Obama Ends Ban On East Coast Offshore Drilling|language=en|work=NPR|url=https://www.npr.org/templates/story/story.php?storyId=125378223|access-date=October 30, 2021}}</ref>
+
+In July 2013, Obama expressed reservations and said he "would reject the [[Keystone XL pipeline]] if it increased carbon pollution [or] greenhouse emissions."<ref>{{cite news |last=Goldenberg |first=Suzanne |date=July 28, 2013 |url=https://www.theguardian.com/environment/2013/jul/28/obama-reservations-keystone-pipeline-project |title=Barack Obama expresses reservations about Keystone XL pipeline project |work=The Guardian |location=London }}</ref><ref>{{cite news |last=Stein |first=Sam |date=June 25, 2013 |url=https://www.huffpost.com/entry/obama-keystone_n_3497292 |title=Obama: Keystone XL Should Not Be Approved If It Will Increase Greenhouse Gas Emissions |work=The Huffington Post }}</ref> On February 24, 2015, Obama vetoed a bill that would have authorized the pipeline.<ref>{{cite news |url=https://www.npr.org/sections/thetwo-way/2015/02/24/388738159/obama-to-veto-keystone-xl-pipeline-today-without-drama-or-fanfare-or-delay |title=Obama Vetoes Keystone XL Pipeline Bill |date = February 24, 2015 |access-date = February 24, 2015 |publisher=NPR |first=Krishnadev |last=Calamur }}</ref> It was the third veto of Obama's presidency and his first major veto.<ref>{{cite news |url=http://thehill.com/policy/energy-environment/234615-senate-fails-to-override-obama-keystone-veto |title = Keystone veto override fails |date = March 4, 2015 |first = Laura |last = Barron-Lopez |website = [[The Hill (newspaper)|The Hill]] |publisher = Capitol Hill Publishing |access-date = July 2, 2015 }}</ref>
+
+In December 2016, Obama permanently banned new offshore oil and gas drilling in most United States-owned waters in the [[Atlantic Ocean|Atlantic]] and [[Arctic Ocean]]s using the 1953 Outer Continental Shelf Act.<ref>{{Cite news|date=December 21, 2016|title=Obama bans oil drilling 'permanently' in millions of acres of ocean|language=en-GB|publisher=BBC News|url=https://www.bbc.com/news/world-us-canada-38387525|access-date=October 30, 2021}}</ref><ref>{{Cite news|last=Smith|first=David|date=December 20, 2016|title=This article is more than 4 years old Barack Obama bans oil and gas drilling in most of Arctic and Atlantic oceans|work=The Guardian|url=https://www.theguardian.com/us-news/2016/dec/20/barack-obama-bans-oil-gas-drilling-arctic-atlantic|access-date=October 30, 2021}}</ref><ref>{{Cite news|last1=Volcovici|first1=Valerie|last2=Gardner|first2=Timothy|date=December 20, 2016|title=Obama bans new oil, gas drilling off Alaska, part of Atlantic coast|language=en|work=Reuters|url=https://www.reuters.com/article/us-usa-obama-drilling-idUSKBN1492KU|access-date=October 30, 2021}}</ref>
+
+Obama emphasized the [[Conservation movement|conservation]] of [[federal lands]] during his term in office. He used his power under the [[Antiquities Act]] to create 25 new [[National monument (United States)|national monuments]] during his presidency and expand four others, protecting a total of {{convert|553000000|acre|ha}} of federal lands and waters, more than any other U.S. president.<ref name="Monuments">{{cite news |first1=Juliet |last1=Eilperin |first2=Brady |last2=Dennis |url=https://www.washingtonpost.com/national/health-science/with-new-monuments-in-nevada-utah-obama-adds-to-his-environmental-legacy/2016/12/28/e9833f62-c471-11e6-8422-eac61c0ef74d_story.html |title=With new monuments in Nevada, Utah, Obama adds to his environmental legacy |newspaper=The Washington Post |date=December 28, 2016 }}</ref><ref>{{cite news |url=https://www.nytimes.com/2016/12/31/opinion/sunday/monuments-man.html |archive-url=https://web.archive.org/web/20170101053919/http://www.nytimes.com/2016/12/31/opinion/sunday/monuments-man.html |archive-date=January 1, 2017 |url-access=subscription |url-status=live |title=Monuments Man |newspaper=The New York Times |date=December 31, 2016 }}</ref><ref>{{cite news |url=https://www.npr.org/2016/12/29/507436648/obama-s-newly-designated-national-monuments-upset-some-lawmakers-and-constituent |title=Obama's Newly Designated National Monuments Upset Some Lawmakers |publisher=NPR |work=[[All Things Considered]] |date=December 29, 2016 }}</ref><ref>{{cite news |first=Amy R. |last=Connolly |url=https://www.upi.com/Top_News/US/2016/02/13/Obama-expands-public-lands-more-than-any-US-president/1161455298784/ |title=Obama expands public lands more than any U.S. president |work=[[United Press International]] |date=February 13, 2016 }}</ref>
+
+====Health care reform====
+
+{{Main|Healthcare reform in the United States}}
+[[File:Obama signs health care-20100323.jpg|thumb|alt=Photograph|Obama signs the Patient Protection and Affordable Care Act at the White House, March 23, 2010.]]
+
+Obama called for [[United States Congress|Congress]] to pass legislation reforming [[health care in the United States]], a key campaign promise and a top legislative goal.<ref name="health reform" /> He proposed an expansion of health insurance coverage to cover the uninsured, cap premium increases, and allow people to retain their coverage when they leave or change jobs. His proposal was to spend $900{{nbs}}billion over ten years and include a government insurance plan, also known as the [[public health insurance option|public option]], to compete with the corporate insurance sector as a main component to lowering costs and improving quality of health care. It would also make it illegal for insurers to drop sick people or deny them coverage for [[pre-existing condition]]s, and require every American to carry health coverage. The plan also includes medical spending cuts and taxes on insurance companies that offer expensive plans.<ref>{{cite news |url=https://www.nytimes.com/2009/09/10/us/politics/10obama.html |archive-url=https://web.archive.org/web/20090912093912/http://www.nytimes.com/2009/09/10/us/politics/10obama.html |archive-date=September 12, 2009 |url-access=subscription |url-status=live |title = Obama, Armed With Details, Says Health Plan Is Necessary |last1 = Stolberg |first1 = Sheryl Gay |last2 = Zeleny |first2 = Jeff |date = September 9, 2009 |newspaper = The New York Times |access-date = July 5, 2015 }}</ref><ref>{{cite news |first = Mike |last = Allen |url=http://www.politico.com/news/stories/0909/26907.html |title = Barack Obama will hedge on public option |work = [[Politico]] |access-date = July 5, 2015 |date = September 9, 2009 }}</ref>
+
+[[File:PPACA Premium Chart.jpg|thumb|upright=1.35|left|Maximum Out-of-Pocket Premium as Percentage of Family Income and [[federal poverty level]], under [[Patient Protection and Affordable Care Act]], starting in 2014 (Source: [[Congressional Research Service|CRS]])<ref>{{cite web |url=https://www.fas.org/sgp/crs/misc/R41137.pdf |title = Health Insurance Premium Credits in the PPACA |publisher = Congressional Research Service |access-date = May 17, 2015 }}</ref>]]
+
+On July 14, 2009, House Democratic leaders introduced a 1,017-page plan for overhauling the U.S. health care system, which Obama wanted Congress to approve by the end of 2009.<ref name="health reform">{{cite news|url=http://blogs.suntimes.com/sweet/2009/07/obama_july_22_2009_press_confe.html |title=Obama July 22, 2009 press conference. Transcript |work=[[Chicago Sun-Times]] |date=July 22, 2009 |access-date=July 5, 2015 |first=Lynn |last=Sweet |url-status=dead |archive-url=https://web.archive.org/web/20150416063154/http://blogs.suntimes.com/sweet/2009/07/obama_july_22_2009_press_confe.html |archive-date=April 16, 2015 }}</ref> After public debate during the Congressional summer recess of 2009, Obama delivered [[Barack Obama speech to joint session of Congress, September 2009|a speech to a joint session of Congress]] on September 9 where he addressed concerns over the proposals.<ref>{{cite news |url=http://www.cnn.com/2009/POLITICS/09/09/obama.speech/index.html |title = Obama calls for Congress to face health care challenge |date = September 9, 2009 |access-date = September 9, 2009 |publisher = CNN |archive-url=https://web.archive.org/web/20090910083332/http://www.cnn.com/2009/POLITICS/09/09/obama.speech/index.html |archive-date = September 10, 2009 |url-status=live }}</ref> In March 2009, Obama lifted a ban on using federal funds for stem cell research.<ref>{{Cite news |url=https://www.theguardian.com/world/2009/mar/10/obama-stem-cell-research |title = Stem cell |first = Daniel |last = Nasaw |newspaper = The Guardian |access-date = September 13, 2014 |date = March 10, 2009 }}</ref>
+
+On November 7, 2009, a health care bill featuring the public option was passed in the House.<ref name="nyt1">{{cite news |url=https://www.nytimes.com/2009/11/08/health/policy/08health.html |title = Sweeping Health Care Plan Passes House |last1 = Hulse |first1 = Carl |first2 = Robert |last2 = Pear |date = November 7, 2009 |work = The New York Times |access-date = November 8, 2009 |archive-url=https://web.archive.org/web/20110331033230/http://www.nytimes.com/2009/11/08/health/policy/08health.html|archive-date=March 31, 2011 |url-status=live }}</ref><ref name="nyt">{{cite news |url=https://www.nytimes.com/2009/11/08/health/policy/08scene.html |title = Abortion Was at Heart of Wrangling |last1 = Herszenhorn |first1 = David M. |first2 = Jackie |last2 = Calmes |date = December 7, 2009 |work = The New York Times |access-date = December 6, 2009 |archive-url=https://web.archive.org/web/20110331073732/http://www.nytimes.com/2009/11/08/health/policy/08scene.html|archive-date=March 31, 2011 |url-status=live }}</ref> On December 24, 2009, the Senate passed its own bill—without a public option—on a party-line vote of 60–39.<ref>{{cite news |url=https://www.npr.org/templates/story/story.php?storyId=121854289 |title = Senate Says Yes To Landmark Health Bill |author = Hensley, Scott |date = December 24, 2009 |access-date = December 24, 2009 |publisher = [[NPR]] |archive-url=https://web.archive.org/web/20100121191700/http://www.npr.org/templates/story/story.php?storyId=121854289 |archive-date = January 21, 2010 |url-status=live }}</ref> On March 21, 2010, the [[Patient Protection and Affordable Care Act]] (ACA) passed by the Senate in December was passed in the House by a vote of 219 to 212.<ref>{{cite news |url=https://www.nytimes.com/2010/03/22/opinion/22mon5.html |title = Health Care Reform, at Last |newspaper = The New York Times |date = March 21, 2010 |access-date = March 22, 2010 |archive-url=https://web.archive.org/web/20100326095847/http://www.nytimes.com/2010/03/22/opinion/22mon5.html |archive-date = March 26, 2010 }}</ref> Obama signed the bill into law on March 23, 2010.<ref>{{cite news |url=https://www.nytimes.com/2010/03/24/health/policy/24health.html |title = Obama Signs Landmark Health Care Bill |date = March 23, 2010 |access-date = March 23, 2010 |newspaper = The New York Times |author = Gay Stolberg, Sheryl |archive-url=https://web.archive.org/web/20100325033529/http://www.nytimes.com/2010/03/24/health/policy/24health.html |archive-date = March 25, 2010 }}</ref>
+
+The ACA includes [[Provisions of the Patient Protection and Affordable Care Act|health-related provisions]], most of which took effect in 2014, including expanding [[Medicaid]] eligibility for people making up to 133 percent{{nbs}}of the [[federal poverty level]] (FPL) starting in 2014,<ref name="cnn_ref1">{{cite news |last = Rice |first = Sabriya |url=http://www.cnn.com/2010/HEALTH/03/25/health.care.law.basics/index.html |title = 5 key things to remember about health care reform |publisher = CNN |date = March 25, 2010 |access-date = January 6, 2013 }}</ref> subsidizing insurance premiums for people making up to 400 percent{{nbs}}of the FPL ($88,000 for family of four in 2010) so their maximum "out-of-pocket" payment for annual premiums will be from 2 percent to 9.5 percent of income,<ref name="whitehouse" /><ref>{{cite news |last = Grier |first = Peter |url=http://www.csmonitor.com/USA/Politics/2010/0320/Health-care-reform-bill-101-Who-gets-subsidized-insurance |date = March 20, 2010 |title = Health Care Reform Bill 101 |newspaper = [[The Christian Science Monitor]] |access-date = July 5, 2015 }}</ref> providing incentives for businesses to provide health care benefits, prohibiting denial of coverage and denial of claims based on pre-existing conditions, establishing [[health insurance exchange]]s, prohibiting annual coverage caps, and support for medical research. According to White House and CBO figures, the maximum share of income that enrollees would have to pay would vary depending on their income relative to the federal poverty level.<ref name="whitehouse">{{cite web |url=https://obamawhitehouse.archives.gov/health-care-meeting/proposal/whatsnew/affordability |work= [[whitehouse.gov]] |title = Policies to Improve Affordability and Accountability |via= [[NARA|National Archives]] |access-date = January 6, 2013}}</ref><ref name="cbo_est">{{cite web |last = Elmendorf |first = Douglas W. |url=http://www.cbo.gov/sites/default/files/cbofiles/ftpdocs/107xx/doc10781/11-30-premiums.pdf |title = An Analysis of Health Insurance Premiums Under the Patient Protection and Affordable Care Act |publisher = Congressional Budget Office |date = November 30, 2009 |access-date = April 9, 2012 }}</ref>
+
+[[File:Percentage of Individuals in the United States Without Health Insurance, 1963-2015.png|thumb|Percentage of Individuals in the United States without Health Insurance, 1963–2015 (Source: [[JAMA (journal)|JAMA]])<ref>{{cite journal|last1=Obama|first1=Barack|title=United States Health Care Reform|journal=JAMA|date=August 2, 2016|volume=316|issue=5|pages=525–532|doi=10.1001/jama.2016.9797|pmid=27400401|issn=0098-7484|pmc=5069435}}</ref>]]
+
+The costs of these provisions are offset by taxes, fees, and cost-saving measures, such as new Medicare taxes for those in high-income [[tax bracket|brackets]], taxes on [[indoor tanning]], cuts to the [[Medicare Advantage]] program in favor of traditional Medicare, and fees on medical devices and pharmaceutical companies;<ref>{{Cite journal |last = Grier |first = Peter |date = March 21, 2010 |url=http://www.csmonitor.com/USA/Politics/2010/0321/Health-care-reform-bill-101-Who-will-pay-for-reform |title = Health care reform bill 101: Who will pay for reform? |journal = Christian Science Monitor |access-date = July 5, 2015 }}</ref> there is also a tax penalty for those who do not obtain health insurance, unless they are exempt due to low income or other reasons.<ref>{{cite news |url=http://www.csmonitor.com/USA/Politics/2010/0319/Health-care-reform-bill-101-Who-must-buy-insurance |title = Health care reform bill 101: Who must buy insurance? |last = Grier |first = Peter |date = March 19, 2010 |work = [[The Christian Science Monitor]] |access-date = April 7, 2010 |archive-url=https://web.archive.org/web/20100405075157/http://www.csmonitor.com/USA/Politics/2010/0319/Health-care-reform-bill-101-Who-must-buy-insurance |archive-date = April 5, 2010 }}</ref> In March 2010, the CBO estimated that the net effect of both laws will be a reduction in the federal deficit by $143{{nbs}}billion over the first decade.<ref>{{cite web |last = Elmendorf |first = Douglas W. |title = H.R. 4872, Reconciliation Act of 2010 (Final Health Care Legislation) |date = March 20, 2010 |url=http://www.cbo.gov/publication/21351 |publisher = Congressional Budget Office |access-date = January 6, 2013 }}</ref>
+
+The law faced several legal challenges, primarily based on the argument that an individual mandate requiring Americans to buy health insurance was unconstitutional. On June 28, 2012, the Supreme Court ruled by a 5–4 vote in ''[[National Federation of Independent Business v. Sebelius]]'' that the mandate was constitutional under the U.S. Congress's taxing authority.<ref name="WP-uphold">{{cite news |first = Robert |last = Barnes |url=https://www.washingtonpost.com/politics/supreme-court-to-rule-thursday-on-health-care-law/2012/06/28/gJQAarRm8V_story.html |title = Supreme Court upholds Obama health care overhaul by 5–4 vote, approving insurance requirement |date = June 28, 2012 |newspaper = The Washington Post |agency = Associated Press |access-date = June 29, 2012 }}</ref> In ''[[Burwell v. Hobby Lobby Stores, Inc.|Burwell v. Hobby Lobby]]'' the Court ruled that "closely-held" for-profit corporations could be exempt on religious grounds under the [[Religious Freedom Restoration Act]] from regulations adopted under the ACA that would have required them to pay for insurance that covered certain contraceptives. In June 2015, the Court ruled 6–3 in ''[[King v. Burwell]]'' that subsidies to help individuals and families purchase health insurance were authorized for those doing so on both the federal exchange and state exchanges, not only those purchasing plans "established by the State", as the statute reads.<ref>{{cite news|url=https://www.usnews.com/news/articles/2015/06/25/supreme-court-upholds-obamacare-subsidies-in-king-v-burwell |title=Supreme Court Upholds Obamacare Subsidies |first=Kimberly |last=Leonard |work=[[U.S. News & World Report]] |access-date=November 25, 2015 |url-status=dead |archive-url=https://web.archive.org/web/20160116072123/http://www.usnews.com/news/articles/2015/06/25/supreme-court-upholds-obamacare-subsidies-in-king-v-burwell |archive-date=January 16, 2016 }}</ref>
+
+===Foreign policy===
+
+{{Main|Foreign policy of the Barack Obama administration}}
+[[File:P06409PS-0571 (3594694537).jpg|June 4, 2009 − after his speech ''[[A New Beginning (speech)|A New Beginning]]'' at [[Cairo University]], U.S. President Obama participates in a roundtable interview in 2009 with among others [[Jamal Khashoggi]], [[Bambang Harymurti]] and [[Nahum Barnea]].|thumb|right]]
+ [[File:Barack Obama meets Stephen Harper.jpg|thumb|left|Obama meets with Canadian Prime Minister [[Stephen Harper]] in Ottawa, February 19, 2009.]]
+In February and March 2009, Vice President Joe Biden and [[United States Secretary of State|Secretary of State]] Hillary Clinton made separate overseas trips to announce a "new era" in U.S. foreign relations with Russia and Europe, using the terms "break" and "[[Russian reset|reset]]" to signal major changes from the policies of the preceding administration.<ref name="preceding administration" /> Obama attempted to reach out to Arab leaders by granting his first interview to an Arab satellite TV network, [[Al Arabiya]].<ref>{{cite news |title = Obama reaches out to Muslim world on TV |work = NBC News |url=https://www.nbcnews.com/id/28869185 |access-date = June 15, 2009 |date = January 27, 2009 }}</ref> On March 19, Obama continued his outreach to the Muslim world, releasing a New Year's video message to the people and government of Iran.<ref>{{cite news |url=https://www.theguardian.com/world/2009/mar/20/barack-obama-usa |title = Barack Obama's address to Iran: Full text of Barack Obama's videotaped message to the people and leaders of Iran as they celebrate their New Year's holiday, Nowruz |date = March 20, 2013 |access-date = July 14, 2013 |work = [[The Guardian]] |location = London }}</ref><ref>{{cite news |first = Karen |last = DeYoung |title = Nation U.S. to Join Talks on Iran's Nuclear Program |date = April 9, 2009 |newspaper = The Washington Post |url=https://www.washingtonpost.com/wp-dyn/content/article/2009/04/08/AR2009040802254.html |access-date = June 15, 2009 }}</ref> On June 4, 2009, Obama delivered a speech at [[Cairo University]] in Egypt calling for "[[A New Beginning (speech)|A New Beginning]]" in relations between the Islamic world and the United States and promoting Middle East peace.<ref name="middleeast" /> On June 26, 2009, Obama condemned the Iranian government's actions towards protesters following [[2009 Iranian presidential election|Iran's 2009 presidential election]].<ref>{{cite news |url=http://www.washingtontimes.com/news/2009/jun/26/obama-dismisses-ahmadinejad-apology-request/ |title = Obama dismisses Ahmadinejad apology request |work = The Washington Times |date = June 26, 2009 |access-date = July 2, 2015 |first1 = Joseph |last1 = Weber |first2 = Stephen |last2 = Dinan }}</ref>
+
+In 2011, Obama ordered a drone strike in Yemen which targeted and killed [[Anwar al-Awlaki]]. Awlaki was an American imam suspected of being an [[Al-Qaeda]] organizer and supporter. Awlaki became the first [[Citizenship of the United States|U.S. citizen]] to be targeted and killed by a [[Drone strike|U.S. drone strike]] without the rights of [[due process]] being afforded. The killing led to significant controversy and may have increased Awlaki's influence. His [[Abdulrahman al-Awlaki|teenage son]] and [[Death of Nawar al-Awlaki|young daughter]], also Americans, were later killed in separate [[Raid on Yakla|US military actions]], although they were not targeted specifically.<ref>{{Cite news|last=Shane|first=Scott|date=August 27, 2015|title=The Lessons of Anwar al-Awlaki|language=en-US|work=The New York Times|url=https://www.nytimes.com/2015/08/30/magazine/the-lessons-of-anwar-al-awlaki.html |archive-url=https://web.archive.org/web/20150827141921/http://www.nytimes.com/2015/08/30/magazine/the-lessons-of-anwar-al-awlaki.html |archive-date=August 27, 2015 |url-access=subscription |url-status=live|access-date=December 7, 2021|issn=0362-4331}}</ref><ref>{{Cite web|last=Lauter|first=David|date=June 24, 2014|title=Memo justifying drone killing of American Al Qaeda leader is released|url=https://www.latimes.com/nation/nationnow/la-na-nn-drone-memo-awlaki-20140623-story.html|access-date=December 7, 2021|website=Los Angeles Times|language=en-US}}</ref>
+
+[[File:Barack Obama and Matteo Renzi October 2016, 1.jpg|thumb|Obama meets with Italian Prime Minister [[Matteo Renzi]] at the [[White House]], October 2016.]]In March 2015, Obama declared that he had authorized U.S. forces to provide logistical and intelligence support to the Saudis in their [[Saudi Arabian-led intervention in Yemen|military intervention in Yemen]], establishing a "Joint Planning Cell" with Saudi Arabia.<ref>{{cite news|url=https://www.washingtonpost.com/world/middle_east/report-yemens-embattled-president-flees-stronghold-as-rebels-advance/2015/03/25/e0913ae2-d2d5-11e4-a62f-ee745911a4ff_story.html|title= Saudi Arabia launces air attacks in Yemen| newspaper=The Washington Post|date=March 25, 2015}}</ref><ref>{{cite news |title=Yemen conflict: US 'could be implicated in war crimes' |url=https://www.bbc.com/news/world-middle-east-37607248 |publisher=BBC News |date=October 10, 2016}}</ref> In 2016, the Obama administration proposed a series of [[Saudi Arabia–United States relations|arms deals with Saudi Arabia]] worth $115{{nbs}}billion.<ref>{{Cite news | last=Bayoumy | first=Yara | title=Obama administration arms sales offers to Saudi top $115 billion: ... | work=Reuters | date=September 7, 2016 |url=https://www.reuters.com/article/us-usa-saudi-security/obama-administration-arms-sales-offers-to-saudi-top-115-billion-report-idUSKCN11D2JQ }}</ref> Obama halted the sale of guided munition technology to [[Saudi Arabia]] after Saudi warplanes [[2016 Sana'a funeral airstrike|targeted a funeral]] in Yemen's capital Sanaa, killing more than 140 people.<ref>{{cite news |url=https://www.independent.co.uk/news/world/americas/us-saudi-arabia-yemen-war-support-military-houthis-bombing-campaign-crisis-a7472546.html |title=America 'agrees to stop selling some arms' to Saudi Arabia |work=The Independent |date=December 13, 2016 |archive-url=https://web.archive.org/web/20190401180257/https://www.independent.co.uk/news/world/americas/us-saudi-arabia-yemen-war-support-military-houthis-bombing-campaign-crisis-a7472546.html|archive-date=April 1, 2019 |first1=Phil |last1=Stewart |first2=Warren |last2=Strobel }}</ref>
+
+====War in Iraq====
+
+{{Main|Iraq War|American-led intervention in Iraq (2014–present)}}
+
+On February 27, 2009, Obama announced that combat operations in Iraq would end within 18 months.<ref>{{cite news |agency = [[Associated Press]] |first = Ben |last = Feller |url = http://gazette.com/obama-sets-firm-withdrawal-timetable-for-iraq/article/49026 |title = Obama sets firm withdrawal timetable for Iraq |work = [[The Gazette (Colorado Springs)|The Gazette]] |date = February 27, 2009 |access-date = March 3, 2009 |archive-date = February 7, 2017 |archive-url = https://web.archive.org/web/20170207113330/http://gazette.com/obama-sets-firm-withdrawal-timetable-for-iraq/article/49026 |url-status = dead }}</ref> The Obama administration scheduled the withdrawal of combat troops to be completed by August 2010, decreasing troop's levels from 142,000 while leaving a transitional force of about 50,000 in Iraq until the end of 2011. On August 19, 2010, the last U.S. combat brigade exited Iraq. Remaining troops transitioned from combat operations to [[counter-terrorism]] and the training, equipping, and advising of Iraqi security forces.<ref>{{cite news |last = Jones |first = Athena |date = February 27, 2009 |url=http://firstread.nbcnews.com/_news/2009/02/27/4428005-obama-announces-iraq-plan |title = Obama announces Iraq plan |publisher = MSNBC |access-date = July 2, 2015 }}</ref><ref>{{cite news |author = Sykes, Hugh |url=https://www.bbc.co.uk/news/world-middle-east-11020270 |title = Last US combat brigade exits Iraq |publisher = BBC News |date = August 19, 2010 |access-date = December 25, 2012 }}</ref> On August 31, 2010, Obama announced that the United States combat mission in Iraq was over.<ref>{{cite news |url=https://www.theguardian.com/world/2010/sep/01/obama-formally-ends-iraq-war |place = London |work = The Guardian |title = Barack Obama ends the war in Iraq. 'Now it's time to turn the page' |first = Ewen |last = MacAskill |date = September 1, 2010 }}</ref> On October 21, 2011, President Obama announced that all U.S. troops would leave Iraq in time to be "home for the holidays."<ref>{{cite news |url=https://www.nbcnews.com/id/44990594 |title = All U.S. troops out of Iraq by end of year |work = NBC News |date = October 21, 2011 |access-date = December 25, 2012 }}</ref>
+
+[[File:David Cameron and Barack Obama at the G20 Summit in Toronto.jpg|thumb|Meeting with UK Prime Minister [[David Cameron]] during the [[2010 G20 Toronto summit]]|alt=US President Barack Obama and British Prime Minister David Cameron trade bottles of beer to settle a bet they made on the U.S. vs. England World Cup Soccer game (which ended in a tie), during a bilateral meeting at the G20 Summit in Toronto, Canada, Saturday, June 26, 2010.]]
+
+In June 2014, following the [[Northern Iraq offensive (June 2014)#Fall of Mosul and push into Kirkuk|capture of Mosul]] by [[Islamic State of Iraq and the Levant|ISIS]], Obama sent 275 troops to provide support and security for U.S. personnel and the U.S. Embassy in Baghdad. ISIS continued to gain ground and to commit [[Islamic State of Iraq and the Levant#Human rights abuse and war crime findings|widespread massacres and ethnic cleansing]].<ref>{{cite news |url=http://www.businessinsider.com/obama-is-sending-275-us-troops-to-iraq-2014-6 |title = Obama Is Sending 275 US Troops To Iraq |work = Business Insider |access-date = June 19, 2014 }}</ref><ref>{{Cite news |url=https://www.reuters.com/article/us-un-rights-idUSKBN0H30KB20140908 |title = New U.N. rights boss warns of 'house of blood' in Iraq, Syria |access-date = July 11, 2015 |last = Nebehay |first = Stephanie |work = Reuters |date = September 8, 2014 }}</ref> In August 2014, during the [[Sinjar massacre]], Obama ordered a [[American-led intervention in Iraq (2014–present)#United States airstrikes|campaign of U.S. airstrikes against ISIS]].<ref name="def31-10-14">{{cite web |url=http://www.defense.gov/news/newsarticle.aspx?id=123542 |title = DoD Authorizes War on Terror Award for Inherent Resolve Ops |date = October 31, 2014 |publisher = Defense.gov |access-date = November 22, 2014 }}</ref> By the end of 2014, 3,100 American ground troops were committed to the conflict<ref>{{Cite news |url=https://www.bbc.com/news/world-middle-east-30388718 |title = Islamic State: Coalition 'pledges more troops' for Iraq |publisher = BBC News |access-date = August 23, 2015 |date = December 8, 2014 }}</ref> and 16,000 sorties were flown over the battlefield, primarily by U.S. Air Force and Navy pilots.<ref>{{cite news |url=http://www.defensenews.com/story/defense/2015/01/19/a10-strikes-isis-11-percent/21875911/ |title = A-10 Performing 11 Percent of Anti-ISIS Sorties |last = Mehta |first = Aaron |date = January 19, 2015 |work = [[Defense News]] |access-date = August 23, 2015 }}</ref> In early 2015, with the addition of the "Panther Brigade" of the [[82nd Airborne Division]] the number of U.S. ground troops in Iraq increased to 4,400,<ref>{{cite news |url=http://www.stripes.com/news/us/1-000-soldiers-from-the-82nd-airborne-headed-to-iraq-1.320194 |title = 1,000 soldiers from the 82nd Airborne headed to Iraq |work=[[Stars and Stripes (newspaper)|Stars and Stripes]] |access-date = August 23, 2015 }}</ref> and by July American-led coalition air forces counted 44,000 sorties over the battlefield.<ref>{{cite news|url=https://www.usnews.com/news/politics/articles/2015/07/21/stealthy-jet-ensures-other-war-fighting-aircraft-survive |title=Stealthy Jet Ensures Other War-Fighting Aircraft Survive |work=[[U.S. News & World Report]] |access-date=August 23, 2015 |url-status=dead |archive-url=https://web.archive.org/web/20150813053355/http://www.usnews.com/news/politics/articles/2015/07/21/stealthy-jet-ensures-other-war-fighting-aircraft-survive |archive-date=August 13, 2015 }}</ref>
+
+====War in Afghanistan====
+{{Main|War in Afghanistan (2001–2021)}}
+[[File:Barack Obama, Hamid Karzai & Asif Ali Zardari after trilateral meeting 5-6-09 1.jpg|thumb|Obama after a trilateral meeting with Afghan President [[Hamid Karzai]] (left) and Pakistani President [[Asif Ali Zardari]] (right), White House Cabinet Room, May 2009]]
+Early in his presidency, Obama moved to bolster U.S. troop strength in Afghanistan.<ref name="autogenerated1">{{cite news |work = NewsHour with Jim Lehrer |url=https://www.pbs.org/newshour/bb/politics/july-dec08/obama_07-15.html |title = Obama Calls for U.S. Military to Renew Focus on Afghanistan |publisher = PBS |date = July 15, 2008 |access-date = April 18, 2010 |archive-url=https://web.archive.org/web/20100327094906/http://www.pbs.org/newshour/bb/politics/july-dec08/obama_07-15.html |archive-date = March 27, 2010 }}</ref> He announced an increase in U.S. troop levels to 17,000 military personnel in February 2009 to "stabilize a deteriorating situation in Afghanistan", an area he said had not received the "strategic attention, direction and resources it urgently requires".<ref>{{cite news |first = Amanda |last = Hodge |title = Obama launches Afghanistan Surge |date = February 19, 2009 |work = The Australian |location = Sydney |url=http://www.theaustralian.com.au/archive/news/obama-launches-afghanistan-surge/story-e6frg6t6-1111118893671 }}</ref> He replaced the military commander in Afghanistan, General [[David D. McKiernan]], with former [[Special Forces (United States Army)|Special Forces]] commander Lt. Gen. [[Stanley A. McChrystal]] in May 2009, indicating that McChrystal's Special Forces experience would facilitate the use of counterinsurgency tactics in the war.<ref name="counterinsurgency tactics" /> On December 1, 2009, Obama announced the deployment of an additional 30,000 military personnel to Afghanistan and proposed to begin troop withdrawals 18 months from that date;<ref>{{cite news |agency=Associated Press |date=December 1, 2009 |url=https://www.nbcnews.com/id/34218604 |title=Obama details Afghan war plan, troop increases |work=NBC News }}</ref> this took place in July 2011. [[David Petraeus]] replaced McChrystal in June 2010, after McChrystal's staff criticized White House personnel in a magazine article.<ref>{{cite news |url=http://www.cnn.com/2010/POLITICS/06/24/mcchrystal.gates.support/ |title = Gates says he agrees with Obama decision on McChrystal |publisher = CNN |date = June 24, 2010 |access-date = September 18, 2010 }}</ref> In February 2013, Obama said the U.S. military would reduce the troop level in Afghanistan from 68,000 to 34,000 U.S. troops by February 2014.<ref>{{cite news |last = Chandrasekaran |first = Rajiv |title = Obama wants to cut troop level in Afghanistan in half over next year |url=https://www.washingtonpost.com/world/national-security/official-obama-to-cut-troop-level-in-afghanistan-in-half-by-next-year/2013/02/12/63a044c8-7536-11e2-8f84-3e4b513b1a13_story.html |access-date = February 14, 2013 |newspaper = The Washington Post |date = February 12, 2013 }}</ref> In October 2015, the White House announced a plan to keep U.S. Forces in Afghanistan indefinitely in light of the deteriorating security situation.<ref>{{Cite news |url=https://www.bbc.com/news/world-us-canada-34536833 |title = US troops in Afghanistan: Taliban resurgence sees rethink |publisher = BBC News |date = October 15, 2015 |access-date = October 15, 2015 |last = Marcus |first = Jonathan }}</ref>
+
+====Israel====
+
+[[File:Barack Obama welcomes Shimon Peres in the Oval Office.jpg|thumb|Obama meeting with Israeli President [[Shimon Peres]] in the [[Oval Office]], May 2009|alt=President Barack Obama, at left, shakes hands with Israeli President Shimon Peres, at right, in the Oval Office on Tuesday, May 5, 2009. Standing at right looking on is U.S. Vice President Joe Biden.]]
+
+During the initial years of the Obama administration, the U.S. increased military cooperation with Israel, including increased military aid, re-establishment of the [[Joint Political Military Group|U.S.-Israeli Joint Political Military Group]] and the Defense Policy Advisory Group, and an increase in visits among high-level military officials of both countries.<ref>{{cite news |last=Levinson |first=Charles |date=August 14, 2010 |url=https://www.wsj.com/articles/SB10001424052748703321004575427272550050504 |title=U.S., Israel Build Military Cooperation |newspaper=[[The Wall Street Journal]] |location=New York |access-date=March 1, 2011 }}</ref> The Obama administration asked Congress to allocate money toward funding the [[Iron Dome]] program in response to the waves of [[Palestinian rocket attacks on Israel]].<ref>{{cite news |last=Kampeas |first=Ron |date=October 26, 2012 |url=http://www.jewishjournal.com/nation/article/for_obama_campaign_trying_to_put_to_rest_persistent_questions_about_kishkes |title=For Obama campaign, trying to put to rest persistent questions about 'kishkes' |newspaper=Jewish Journal}}</ref> In March 2010, Obama took a public stance against plans by the government of Israeli Prime Minister [[Benjamin Netanyahu]] to continue building Jewish housing projects in predominantly Arab neighborhoods of [[East Jerusalem]].<ref>{{cite news |url=http://www1.voanews.com/english/news/Netanyahus-Office-No-Change-on-East-Jerusalem-Plans-89258402.html |title = Israel Refuses to Halt Construction in East Jerusalem |publisher = [[Voice of America]] |date = March 25, 2010 |access-date = July 2, 2015 |first = Robert |last = Berger }}</ref><ref>{{cite news |url=https://www.nytimes.com/2010/03/25/world/middleeast/25jerusalem.html |title = Israel Confirms New Building in East Jerusalem |work = The New York Times |date = March 24, 2010 |first = Isabel |last = Kershner |access-date = April 26, 2010 |archive-url=https://web.archive.org/web/20100329231159/http://www.nytimes.com/2010/03/25/world/middleeast/25jerusalem.html |archive-date = March 29, 2010 |url-status=live }}</ref> In 2011, the United States vetoed a Security Council resolution condemning [[Israeli settlement]]s, with the United States being the only nation to do so.<ref>{{cite web |url=https://www.un.org/apps/news/story.asp?NewsID=37572&Cr=palestin&Cr1 |title = United States vetoes Security Council resolution on Israeli settlements |date = February 18, 2011 |website = UN News Service Section |access-date = September 13, 2014 }}</ref> Obama supports the [[two-state solution]] to the [[Arab–Israeli conflict]] based on the 1967 borders with land swaps.<ref>{{cite news |last=Levy |first=Elior |date=May 22, 2011 |url=https://www.ynetnews.com/articles/0,7340,L-4072210,00.html |title=PA challenges Netanyahu to accept 1967 lines |work=Ynetnews |access-date=May 22, 2011 }}</ref>
+
+In 2013, [[Jeffrey Goldberg]] reported that, in Obama's view, "with each new settlement announcement, Netanyahu is moving his country down a path toward near-total isolation."<ref name="Bloomberg">{{cite news |last = Goldberg |first = Jeffrey |title = Obama: 'Israel Doesn't Know What Its Best Interests Are' |url=https://www.bloomberg.com/news/2013-01-14/what-obama-thinks-israelis-don-t-understand-.html |access-date = January 23, 2013 |work = Bloomberg |date = January 14, 2013 }}</ref> In 2014, Obama likened the [[Zionist movement]] to the [[civil rights movement]] in the United States. He said both movements seek to bring justice and equal rights to historically persecuted peoples, explaining: "To me, being pro-Israel and pro-Jewish is part and parcel with the values that I've been fighting for since I was politically conscious and started getting involved in politics."<ref>{{cite news |last=Goldberg |first=Jeffrey |url=https://www.theatlantic.com/international/archive/2015/09/obama-netanyahu-and-the-future-of-israel/405082/ |title=After the Iran Deal: Obama, Netanyahu, and the Future of the Jewish State |work=The Atlantic |date=September 13, 2015 |access-date=September 13, 2015 }}</ref> Obama expressed support for Israel's right to defend itself during the [[2014 Israel–Gaza conflict]].<ref>{{cite news |title = Obama reaffirms Israel's right to defend itself |first=Herb|last=Keinon|url=http://www.jpost.com/Operation-Protective-Edge/Netanyahu-speaks-with-UN-chief-over-phone-363479 |date = July 19, 2014 | work= [[The Times of Israel]] }}</ref> In 2015, Obama was harshly criticized by Israel for advocating and signing the [[Joint Comprehensive Plan of Action|Iran Nuclear Deal]]; Israeli Prime Minister [[Benjamin Netanyahu]], who had advocated the U.S. congress to oppose it, said the deal was "dangerous" and "bad".<ref>{{Cite news | title=Netanyahu: Iran nuclear deal makes world much more dangerous, Israel not bound by it | newspaper=[[Haaretz]] | date=July 14, 2015 |url=https://www.haaretz.com/news/diplomacy-defense/1.665821 | access-date=January 3, 2018}}</ref>
+
+On December 23, 2016, under the Obama Administration, the United States abstained from [[United Nations Security Council Resolution 2334]], which condemned [[Israeli settlement]] building in the occupied [[Palestinian territories]] as a violation of international law, effectively allowing it to pass.<ref>{{cite news | last1=Collinson | first1=Stephen | last2=Wright | first2=David | last3=Labott | first3=Elise | title=US Abstains as UN Demands End to Israeli Settlements |url=http://www.cnn.com/2016/12/23/politics/israel-official-rips-obama-un-settlements/ | date=December 24, 2016 | work=CNN | access-date=January 7, 2017}}</ref> Netanyahu strongly criticized the Obama administration's actions,<ref>{{Cite news | last1=Barak | first1=Ravid | title=Netanyahu on UN Settlement Vote: Israel Will Not Turn the Other Cheek |url=http://www.haaretz.com/israel-news/1.761470 | date=December 26, 2016 | newspaper=[[Haaretz]] | access-date=January 7, 2017}}</ref><ref>{{Cite news | title=Israel-Palestinians: Netanyahu Condemns John Kerry Speech |url=https://www.bbc.com/news/world-us-canada-38455753 | date=December 29, 2016 | publisher=BBC News | access-date=January 7, 2017 }}</ref> and the Israeli government withdrew its annual dues from the organization, which totaled $6{{nbs}}million, on January 6, 2017.<ref>{{cite web | title=Israel Halts $6{{nbs}}million to UN to Protest UN Settlements Vote |url=http://www.foxnews.com/world/2017/01/06/israel-halts-6-million-to-un-to-protest-un-settlements-vote.html | date=January 6, 2017 | publisher=[[Fox News]] (from the [[Associated Press]]) | access-date=January 7, 2017}}</ref> On January 5, 2017, the [[United States House of Representatives]] voted 342–80 to condemn the UN Resolution.<ref>{{cite news | title=House Overwhelmingly Votes to Condemn UN Resolution on Israel Settlements |url=http://www.foxnews.com/politics/2017/01/05/house-overwhelmingly-votes-to-condemn-un-resolution-on-israel-settlements.html | date=January 5, 2017 | publisher=[[Fox News]] | access-date=January 7, 2017}}</ref><ref>{{cite news | last1=Cortellessa | first1=Eric | title=US House Passes Motion Repudiating UN Resolution on Israel |url=http://www.timesofisrael.com/us-house-passes-repudiation-of-un-security-council-resolution-on-israel/ | date=January 6, 2017 | work=[[The Times of Israel]] | access-date=January 17, 2017}}</ref>
+
+====Libya====
+
+{{Main|2011 military intervention in Libya}}
+[[File:Vladimir Putin and Barack Obama (2015-09-29) 04.jpg|thumb|President Obama meets with Russian President [[Vladimir Putin]] to discuss Syria and ISIS, September 29, 2015.]]
+
+In February 2011, protests in Libya began against long-time dictator [[Muammar Gaddafi]] as part of the [[Arab Spring]]. They soon turned violent. In March, as forces loyal to Gaddafi advanced on rebels across Libya, calls for a no-fly zone came from around the world, including Europe, the [[Arab League]], and a resolution<ref>{{cite web |url=http://mccain.senate.gov/public/index.cfm?FuseAction=PressOffice.FloorStatements&ContentRecord_id=b63b7b6f-a466-ba23-dea8-7bc024f54655 |title = Floor Statement by Senator McCain Introducing the Senate Resolution Calling for a No-Fly Zone in Libya |publisher = Senate.gov |date = March 14, 2011 |access-date = March 28, 2011 }}</ref> passed unanimously by the U.S. Senate.<ref>{{cite news |url=http://nationaljournal.com/congress/senate-passes-resolution-calling-for-no-fly-zone-over-libya-20110301?page=1 |title = Senate Passes Resolution Calling for No-Fly Zone Over Libya |work = [[National Journal]] |date = March 1, 2011 |archive-url=https://web.archive.org/web/20110511121418/http://nationaljournal.com/congress/senate-passes-resolution-calling-for-no-fly-zone-over-libya-20110301?page=1 |archive-date = May 11, 2011 }}</ref> In response to the unanimous passage of [[United Nations Security Council Resolution 1973]] on March 17, Gaddafi—who had previously vowed to "show no mercy" to the rebels of Benghazi<ref>{{cite news |last = Winnett |first = Robert |url=https://www.telegraph.co.uk/news/worldnews/africaandindianocean/libya/8389565/Libya-UN-approves-no-fly-zone-as-British-troops-prepare-for-action.html |title = Libya: UN approves no-fly zone as British troops prepare for action |work = The Daily Telegraph |place = London |date = March 17, 2011 |archive-url=https://web.archive.org/web/20110428102507/http://www.telegraph.co.uk/news/worldnews/africaandindianocean/libya/8389565/Libya-UN-approves-no-fly-zone-as-British-troops-prepare-for-action.html |archive-date = April 28, 2011 }}</ref>—announced an immediate cessation of military activities.<ref>{{cite news |url=http://www.newstatesman.com/blogs/the-staggers/2011/03/fly-zone-ceasefire-libya |author = Shackle, Samira |title = Libya declares ceasefire |work = New Statesman blog |location = London |date = March 18, 2011 |access-date = July 16, 2011 }}</ref>
+
+The next day, on Obama's orders, the U.S. military took part in air strikes to destroy the Libyan government's air defense capabilities to protect civilians and enforce a no-fly-zone,<ref>{{cite news |url=http://www.rttnews.com/Content/GeneralNews.aspx?Id=1580433&SM=1 |title = Obama: US to Transfer Lead Role in Libya |publisher = RTT Newswire |access-date = March 22, 2011 }}</ref> including the use of [[Tomahawk (missile)|Tomahawk missiles]], [[Northrop Grumman B-2 Spirit|B-2 Spirits]], and fighter jets.<ref>{{cite news|url=http://www.vcstar.com/news/2011/mar/23/ap-news-in-brief/ |title=Obama says US efforts in Libya have saved lives, control of operation can be turned over soon |work=[[Ventura County Star]] |agency=Associated Press |access-date=March 22, 2011 |url-status=dead |archive-url=https://web.archive.org/web/20110828104819/http://www.vcstar.com/news/2011/mar/23/ap-news-in-brief/ |archive-date=August 28, 2011 }}</ref><ref>{{cite news |author = Pannell, Ian |url=https://www.bbc.co.uk/news/world-africa-12813757 |title = Gaddafi 'not targeted' by allied strikes |publisher = BBC News |date = March 21, 2011 |access-date = July 3, 2011 |archive-url=https://web.archive.org/web/20110623012338/http://www.bbc.co.uk/news/world-africa-12813757 |archive-date = June 23, 2011 }}</ref><ref>{{cite news |url=https://www.theguardian.com/world/2011/mar/22/f15-fighter-crash-libya |title = F-15 fighter jet crashes in Libya |work = The Guardian |location = London |date = March 22, 2011 |access-date = March 23, 2011 |first = Sam |last = Jones |archive-url=https://web.archive.org/web/20110322190309/http://www.guardian.co.uk/world/2011/mar/22/f15-fighter-crash-libya |archive-date = March 22, 2011 |url-status=live }}</ref> Six days later, on March 25, by unanimous vote of all its 28 members, [[NATO]] took over leadership of the effort, dubbed [[Operation Unified Protector]].<ref name="NATOPressRelease">{{cite web |url=http://www.nato.int/nato_static/assets/pdf/pdf_2011_03/20110325_110325-unified-protector-no-fly-zone.pdf |title = NATO No-Fly Zone over Libya Operation UNIFIED PROTECTOR |publisher = NATO |date = March 25, 2011 }}</ref> Some Representatives<ref name="LibyaOffensive">{{cite news |url=https://www.cbsnews.com/news/is-obamas-libya-offensive-constitutional/ |title = Is Obama's Libya offensive constitutional? |work = CBS News |date = March 22, 2011 |access-date = March 22, 2011 |first = Brian |last = Montopoli }}</ref> questioned whether Obama had the constitutional authority to order military action in addition to questioning its cost, structure and aftermath.<ref>{{cite news |title = Obama's Libya Policy Makes Strange Bedfellows of Congressional Critics |url=https://www.huffingtonpost.com/2011/03/20/obama-libya_n_838219.html |work = The Huffington Post |access-date = March 26, 2011 |date = March 21, 2011 |first = Sam |last = Stein |archive-url=https://web.archive.org/web/20110323083100/http://www.huffingtonpost.com/2011/03/20/obama-libya_n_838219.html |archive-date = March 23, 2011 |url-status=live }}</ref><ref>{{cite news |title = Obama juggles Libya promises, realities |url=http://www.cnn.com/2011/POLITICS/03/25/obama.libya/index.html |publisher = CNN |access-date = March 26, 2011 |date = March 25, 2011 }}</ref> Obama later expressed regret for playing a leading role in the destabilization of Libya, calling the certain situation there "a mess."<ref>{{Cite web|first1=Allie|last1=Malloy|first2=Catherine|last2=Treyz|date=April 10, 2016|title=Obama admits worst mistake of his presidency&nbsp;— CNN Politics|url=https://www.cnn.com/2016/04/10/politics/obama-libya-biggest-mistake/index.html|access-date=April 24, 2021|website=CNN|language=en}}</ref> He has stated that the lack of preparation surrounding the days following the government's overthrow was the "worst mistake" of his presidency.<ref>{{Cite news|date=April 11, 2016|title=President Obama: Libya aftermath 'worst mistake' of presidency|language=en-GB|publisher=BBC News|url=https://www.bbc.com/news/world-us-canada-36013703|access-date=April 24, 2021}}</ref>
+
+====Syrian Civil War====
+
+{{See also|Foreign involvement in the Syrian Civil War#United States|American-led intervention in the Syrian Civil War}}
+
+On August 18, 2011, several months after the start of the [[Syrian Civil War]], Obama issued a written statement that said: "The time has come for [[Bashar al-Assad|President Assad]] to step aside."<ref name=mustgo>{{cite news|title=Assad must go, Obama says|url=https://www.washingtonpost.com/politics/assad-must-go-obama-says/2011/08/18/gIQAelheOJ_story.html |access-date=November 23, 2015|newspaper=The Washington Post|date=August 18, 2011}}</ref><ref name=whstatem>{{cite web |url=https://obamawhitehouse.archives.gov/blog/2011/08/18/president-obama-future-syria-must-be-determined-its-people-president-bashar-al-assad |work=[[whitehouse.gov]] |title=President Obama: 'The future of Syria must be determined by its people, but President Bashar al-Assad is standing in their way.' |via=[[NARA|National Archives]] |date=August 18, 2011 }}</ref> This stance was reaffirmed in November 2015.<ref>{{cite news|url=https://www.wsj.com/articles/obama-says-syrian-leader-bashar-al-assad-must-go-1447925671|title=Obama Says Syrian Leader Bashar al-Assad Must Go|author=Nelson, Colleen}}</ref> In 2012, Obama authorized multiple [[Timber Sycamore|programs run by the CIA]] and the Pentagon to train anti-Assad rebels.<ref>{{Cite news|url=https://www.reuters.com/article/us-usa-syria-obama-order-idUSBRE8701OK20120802|author=Hosenball, Mark|title=Obama authorizes secret support for Syrian rebels|access-date=February 19, 2016|work=Reuters|date=August 2, 2012}}</ref> The Pentagon-run program was later found to have failed and was formally abandoned in October 2015.<ref>{{cite news|url=https://www.nytimes.com/2015/10/10/world/middleeast/pentagon-program-islamic-state-syria.html |archive-url=https://web.archive.org/web/20151009144157/http://www.nytimes.com/2015/10/10/world/middleeast/pentagon-program-islamic-state-syria.html |archive-date=October 9, 2015 |url-access=subscription |url-status=live|title=Obama Administration Ends Effort to Train Syrians to Combat ISIS|first1=Michael D. |last1=Shear |first2=Helene |last2=Cooper |first3=Eric |last3=Schmitt |access-date=February 20, 2016}}</ref><ref>{{Cite news|url=https://www.reuters.com/article/us-mideast-crisis-syria-usa-idUSKCN0S31BR20151009|title=U.S. pulls plug on Syria rebel training effort; will focus on weapons supply|first1=Phil |last1=Stewart |first2=Kate|last2=Holton|access-date=February 20, 2016|work=Reuters|date=October 9, 2015}}</ref>
+
+In the wake of a [[Ghouta chemical attack|chemical weapons attack]] in Syria, [[U.S. Government Assessment of the Syrian Government's Use of Chemical Weapons on August 21, 2013|formally blamed]] by the Obama administration on the Assad government, Obama chose not to enforce the "red line" he had pledged<ref name="redline">{{cite news|url=http://www.washingtontimes.com/news/2015/may/17/obama-red-line-erased-as-assad-chemical-weapons-us/?page=all|title=Obama 'red line' erased as Bashar Assad's chemical weapons use goes unchecked by U.S. military|work=The Washington Times |date=May 17, 2015 |access-date=November 23, 2015}}</ref> and, rather than authorize the promised military action against Assad, went along with the Russia-brokered deal that led to Assad [[Destruction of Syria's chemical weapons|giving up chemical weapons]]; however attacks with [[chlorine gas]] continued.<ref>{{cite news|url=https://www.nytimes.com/2013/09/15/world/middleeast/syria-talks.html |archive-url=https://web.archive.org/web/20130914154144/http://www.nytimes.com/2013/09/15/world/middleeast/syria-talks.html |archive-date=September 14, 2013 |url-access=subscription |url-status=live|title=U.S. and Russia Reach Deal to Destroy Syria's Chemical Arms|author=Gordon, Michael|access-date=February 19, 2016}}</ref><ref>{{cite news|url=https://www.pbs.org/wgbh/frontline/article/syria-got-rid-of-its-chemical-weapons-but-reports-of-attacks-continue/|title=Syria Got Rid of Its Chemical Weapons—But Reports of Attacks Continue|author=Boghani, Priyanka|access-date=February 19, 2016}}</ref> In 2014, Obama authorized an [[Military intervention against ISIL|air campaign aimed primarily at ISIL]].<ref>{{cite news|url=http://www.aljazeera.com/news/middleeast/2014/09/obama-strike-wherever-it-exists-2014910223935601193.html|title=Obama outlines plan to target IS fighters|publisher=[[Al Jazeera]]|date=September 11, 2014|access-date=September 24, 2014}}</ref>
+
+====Death of Osama bin Laden====
+
+{{Main|Killing of Osama bin Laden}}
+[[File:President Obama on Death of Osama bin Laden no watermark.webm|thumb|President Obama's address (9:28){{break}}''Also available:'' [[:File:050111 Osama Bin Laden Death Statement audioonly.ogg|Audio only]]; {{Cws |title=Full text |link=Remarks by the President on Osama bin Laden |nobullet=yes}}]]
+[[File:Obama and Biden await updates on bin Laden.jpg|left|thumb|Obama and members of the national security team receive an update on [[Operation Neptune's Spear]] in the [[White House Situation Room]], May 1, 2011. See also: [[Situation Room (photograph)|''Situation Room'']]|alt=President Barack Obama and Vice President Joe Biden, along with members of the national security team, receive an update on Operation Neptune's Spear, a mission against Osama bin Laden, in one of the conference rooms of the Situation Room of the White House, on May 1, 2011. They are watching the live feed from drones operating over the bin Laden complex.]]
+
+Starting with information received from Central Intelligence Agency operatives in July 2010, the CIA developed intelligence over the next several months that determined what they believed to be the hideout of [[Osama bin Laden]]. He was living in seclusion in [[Osama bin Laden's compound in Abbottabad|a large compound]] in [[Abbottabad]], Pakistan, a suburban area {{convert|35|mi|km}} from [[Islamabad]].<ref name="NYT-clues">{{cite news |url=https://www.nytimes.com/2011/05/03/world/asia/03intel.html |title = Clues Gradually Led to the Location of Osama bin Laden |last1 = Mazzetti |first1 = Mark |first2 = Helene |last2 = Cooper |first3 = Peter |last3 = Baker |date = May 3, 2011 |work = The New York Times |access-date = May 4, 2011 |archive-url=https://web.archive.org/web/20110503190900/http://www.nytimes.com/2011/05/03/world/asia/03intel.html |archive-date = May 3, 2011 |url-status=live }}</ref> CIA head [[Leon Panetta]] reported this intelligence to President Obama in March 2011.<ref name="NYT-clues" /> Meeting with his national security advisers over the course of the next six weeks, Obama rejected a plan to bomb the compound, and authorized a "surgical raid" to be conducted by [[United States Navy SEALs]].<ref name="NYT-clues" /> The operation took place on May 1, 2011, and resulted in the shooting death of bin Laden and the seizure of papers, computer drives and disks from the compound.<ref name="WP-binLaden">{{cite news |url=https://www.washingtonpost.com/politics/osama-bin-laden-is-killed-by-us-forces-in-pakistan/2011/05/01/AFXMZyVF_story.html |title = Osama bin Laden is killed by U.S. forces in Pakistan |newspaper = The Washington Post |access-date = September 13, 2014 |date = May 2, 2011 |first1 = Philip |last1 = Rucker |first2 = Scott |last2 = Wilson |first3 = Anne E. |last3 = Kornblut }}</ref><ref name="ND-binLaden">{{cite web |url=http://www.newsday.com/news/breaking/official-offers-details-of-bin-laden-raid-1.2853079 |title = Official offers details of bin Laden raid |website = Newsday |access-date = September 13, 2014 |date = May 2, 2011 }}</ref> DNA testing was one of five methods used to positively identify bin Laden's corpse,<ref name="ABC-binLaden">{{cite news |url=https://abcnews.go.com/Blotter/osama-bin-laden-killed/story?id=13505703 |title = Osama bin Laden Killed by U.S. Forces in Pakistan |last1 = Schabner |first1 = Dean |first2 = Karen |last2 = Travers |date = May 1, 2011 |work = ABC News |access-date = May 3, 2011 |archive-url=https://web.archive.org/web/20110504021523/http://abcnews.go.com/Blotter/osama-bin-laden-killed/story?id=13505703 |archive-date = May 4, 2011 }}</ref> which was buried at sea several hours later.<ref name="NYT-ObamaAnnounce">{{cite news|url=https://www.nytimes.com/2011/05/02/world/asia/osama-bin-laden-is-killed.html |title=Bin Laden Is Dead, Obama Says |last1=Baker |first1=Peter |first2=Helene |last2=Cooper |first3=Mark |last3=Mazzetti |date=May 2, 2011 |work=The New York Times |access-date=May 3, 2011 |archive-url=https://web.archive.org/web/20110505195308/http://www.nytimes.com/2011/05/02/world/asia/osama-bin-laden-is-killed.html |archive-date=May 5, 2011 |url-status=dead }}</ref> Within minutes of the President's announcement from Washington, DC, late in the evening on May 1, there were spontaneous celebrations around the country as crowds gathered outside the White House, and at New York City's [[World Trade Center site|Ground Zero]] and [[Times Square]].<ref name="WP-binLaden" /><ref name="Guard-ObamaAnnounce">{{cite news |last1 = Walsh |first1 = Declan |first2 = Richard |last2 = Adams |first3 = Ewen |last3 = MacAskill |url=https://www.theguardian.com/world/2011/may/02/osama-bin-laden-dead-obama |title = Osama bin Laden is dead, Obama announces |date = May 2, 2011 |work = The Guardian |place = London |access-date = May 3, 2011 |archive-url=https://web.archive.org/web/20110503154000/http://www.guardian.co.uk/world/2011/may/02/osama-bin-laden-dead-obama |archive-date = May 3, 2011 |url-status=live }}</ref> [[Reactions to the death of Osama bin Laden|Reaction to the announcement]] was positive across party lines, including from former presidents Bill Clinton and George W. Bush.<ref name="Bloom-binLaden">{{cite news |url=https://www.bloomberg.com/news/2011-05-02/death-of-bin-laden-may-strengthen-obama-s-hand-in-domestic-foreign-policy.html |title = Death of Bin Laden May Strengthen Obama's Hand in Domestic, Foreign Policy |last = Dorning |first = Mike |date = May 2, 2011 |agency = [[Bloomberg News]] |access-date = May 4, 2011 |archive-url=https://web.archive.org/web/20110503203539/http://www.bloomberg.com/news/2011-05-02/death-of-bin-laden-may-strengthen-obama-s-hand-in-domestic-foreign-policy.html |archive-date = May 3, 2011 }}</ref>
+{{clear}}
+
+====Iran nuclear talks====
+
+{{Main|Joint Comprehensive Plan of Action}}
+[[File:Barack Obama talks with Benjamin Netanyahu (8637772147).jpg|thumb|Obama talks with Benjamin Netanyahu, March 2013.]]
+
+On October 1, 2009, the Obama administration went ahead with a Bush administration program, increasing nuclear weapons production. The "Complex Modernization" initiative expanded two existing nuclear sites to produce new bomb parts. The administration built new plutonium pits at the Los Alamos lab in New Mexico and expanded enriched uranium processing at the Y-12 facility in Oak Ridge, Tennessee.<ref>{{Cite web|url=https://www.democracynow.org/2009/10/1/headlines|title=Headlines for October 01, 2009|website=Democracy Now!}}</ref> In November 2013, the Obama administration opened [[Negotiations leading to the Joint Comprehensive Plan of Action|negotiations]] with Iran to prevent it from acquiring [[nuclear weapon]]s, which included an [[Joint Plan of Action|interim agreement]]. Negotiations took two years with numerous delays, with a deal being announced on July 14, 2015. The deal titled the "Joint Comprehensive Plan of Action" saw sanctions removed in exchange for measures that would prevent Iran from producing nuclear weapons. While Obama hailed the agreement as being a step towards a more hopeful world, the deal drew strong criticism from Republican and conservative quarters, and from Israeli Prime Minister [[Benjamin Netanyahu]].<ref>{{Cite news |title = Iran deal reached, Obama hails step toward 'more hopeful world' |url=https://www.reuters.com/article/us-iran-nuclear-idUSKCN0PM0CE20150714 |date = July 14, 2015 |access-date = July 14, 2015 |work = Reuters }}</ref><ref>{{Cite news |title = Iran, World Powers Prepare to Sign Nuclear Accord |url=https://www.wsj.com/articles/embargo-on-arms-clouds-iran-nuclear-deal-1436831280 |date = July 14, 2015 |access-date = July 14, 2015 |newspaper = The Wall Street Journal |last1 = Solomon |first1 = Jay |last2 = Norman |first2 = Laurence |last3 = Lee |first3 = Carol E. }}</ref><ref>{{cite news |title = Landmark deal reached on Iran nuclear program |url=http://edition.cnn.com/2015/07/14/politics/iran-nuclear-deal/ |date = July 14, 2015 |access-date = July 14, 2015 |publisher = CNN }}</ref> In addition, the transfer of $1.7{{nbs}}billion in cash to Iran shortly after the deal was announced was criticized by the republican party. The Obama administration said that the payment in cash was because of the "effectiveness of U.S. and international sanctions."<ref>{{cite news|url=https://www.latimes.com/nation/nationnow/la-na-iran-payment-cash-20160907-snap-story.html|title=$1.7-billion payment to Iran was all in cash due to effectiveness of sanctions, White House says|date=September 7, 2016|work=Los Angeles Times|access-date=October 30, 2019}}</ref> In order to advance the deal, the Obama administration shielded [[Hezbollah]] from the [[Drug Enforcement Administration]]'s [[Project Cassandra]] investigation regarding drug smuggling and from the [[Central Intelligence Agency]].<ref>{{cite news |url=https://www.haaretz.com/us-news/1.829686 |title=Obama Administration Reportedly Shielded Hezbollah From DEA and CIA to Save Iran Nuclear Deal |work=Haaretz |date=December 18, 2017 }}</ref><ref>{{cite news |url=https://www.politico.com/interactives/2017/obama-hezbollah-drug-trafficking-investigation/ |title=A Global Threat Emerges |work=Politico |date=December 18, 2017 |first=Josh |last=Meyer }}</ref>
+On a side note, the very same year, in December 2015, Obama started a $348{{nbs}}billion worth program to back the biggest U.S. buildup of nuclear arms since Ronald Reagan left the White House.<ref>{{Cite web|url=https://www.forbes.com/sites/lorenthompson/2015/12/15/obama-backs-biggest-nuclear-arms-buildup-since-cold-war/|title=Obama Backs Biggest Nuclear Arms Buildup Since Cold War|first=Loren|last=Thompson|website=Forbes}}</ref>
+
+====Relations with Cuba====
+
+{{Main|Cuban thaw}}
+[[File:Handshake between the President and Cuban President Raúl Castro.jpg|thumb|left|President Obama meeting with Cuban President [[Raúl Castro]] in Panama, April 2015]]
+
+Since the spring of 2013, secret meetings were conducted between the United States and Cuba in the neutral locations of Canada and [[Vatican City]].<ref>{{cite news |last1 = Warren |first1 = Strobel |title = Secret talks in Canada, Vatican City led to Cuba breakthrough |url=https://www.reuters.com/article/us-cuba-usa-reconstruction-idUSKBN0JV2DM20141217 |work = Reuters |access-date = December 21, 2014 }}</ref> The Vatican first became involved in 2013 when [[Pope Francis]] advised the U.S. and Cuba to [[prisoner exchange|exchange prisoners]] as a gesture of goodwill.<ref>{{cite news |last1 = Morello |first1 = Carol |last2 = DeYoung |first2 = Karen |title = Secret U.S.-Cuba diplomacy ended in landmark deal on prisoners, future ties |url=https://www.washingtonpost.com/world/national-security/secret-diplomacy-with-cuba-ended-in-breakthrough-deal/2014/12/17/c51b3ed8-8614-11e4-a702-fa31ff4ae98e_story.html |newspaper = The Washington Post |access-date = December 21, 2014 }}</ref> On December 10, 2013, Cuban President [[Raúl Castro]], in a significant public moment, greeted and shook hands with Obama at the [[Death of Nelson Mandela|Nelson Mandela memorial service]] in [[Johannesburg]].<ref>{{Cite news | last1=Roberts | first1=Dan | last2=Luscombe | first2=Richard | title=Obama shakes hands with Raúl Castro for first time at Mandela memorial | newspaper=The Guardian | date=December 10, 2013 |url=https://www.theguardian.com/world/2013/dec/10/obama-shakes-hands-raul-castro-mandela-memorial | access-date=February 15, 2017}}</ref>
+
+In December 2014, after the secret meetings, it was announced that Obama, with [[Pope Francis]] as an intermediary, had negotiated a restoration of relations with Cuba, after nearly sixty years of détente.<ref>{{cite news |first = Barbie Latza |last = Nadeau |url=http://www.thedailybeast.com/articles/2014/12/17/the-pope-s-diplomatic-miracle-ending-the-u-s-cuba-cold-war.html |title = The Pope's Diplomatic Miracle: Ending the U.S.–Cuba Cold War |work = The Daily Beast |date = December 17, 2014 |access-date = December 18, 2014 }}</ref> Popularly dubbed the [[Cuban Thaw]], ''[[The New Republic]]'' deemed the Cuban Thaw to be "Obama's finest foreign policy achievement."<ref>{{cite news |magazine=[[The New Republic]] |url=https://newrepublic.com/article/121522/cuba-obamas-biggest-foreign-policy-success |title=The Cuban Thaw Is Obama's Finest Foreign Policy Achievement to Date |first=Joel |last=Gillin |date=April 13, 2015 }}</ref> On July 1, 2015, President Obama announced that formal diplomatic relations between Cuba and the United States would resume, and embassies would be opened in Washington and [[Havana]].<ref>{{cite news |title = Obama announces re-establishment of U.S.-Cuba diplomatic ties |url=http://www.cnn.com/2015/07/01/politics/obama-note-to-castro-reestablish-ties/ |publisher = CNN |access-date = July 1, 2015 }}</ref> The countries' respective "interests sections" in one another's capitals were upgraded to embassies on July 20 and August 13, 2015, respectively.<ref>{{cite news |url=http://www.miamiherald.com/news/nation-world/world/americas/cuba/article27862504.html |title = United States and Cuba reestablish diplomatic relations |first = Mimi |last = Whitefield |work = The Miami Herald |date = July 20, 2015 |access-date = July 19, 2015 }}</ref> Obama visited Havana, Cuba for two days in March 2016, becoming the first sitting U.S. president to arrive since [[Calvin Coolidge]] in 1928.<ref>{{cite news |author1=Julie Hirschfeld Davis |first2=Damien |last2=Cave |date = March 21, 2016 |title = Obama Arrives in Cuba, Heralding New Era After Decades of Hostility |work = The New York Times |page = A1 |url=https://www.nytimes.com/2016/03/21/world/americas/obama-arrives-in-cuba.html |archive-url=https://web.archive.org/web/20160320203029/http://www.nytimes.com/2016/03/21/world/americas/obama-arrives-in-cuba.html |archive-date=March 20, 2016 |url-access=subscription |url-status=live }}</ref>
+
+====Africa====
+
+Obama spoke in front of the [[African Union]] in [[Addis Ababa]], Ethiopia, on July 29, 2015, the first sitting U.S. president to do so. He gave a speech encouraging the world to increase economic ties via investments and trade with the continent, and lauded the progress made in [[Education in Africa|education]], infrastructure, and [[Economy of Africa|economy]]. He also criticized the lack of democracy and leaders who refuse to step aside, discrimination against minorities ([[LGBT]] people, religious groups and ethnicities), and corruption. He suggested an intensified [[democratization]] and free trade, to significantly improve the quality of life for Africans.<ref>{{Cite news |last1 = Lee |first1 = Carol E. |title = Obama Becomes First U.S. President to Address African Union |url=https://www.wsj.com/articles/obama-becomes-first-u-s-president-to-address-african-union-1438090849 |newspaper = The Wall Street Journal |access-date = July 29, 2015 |date = July 28, 2015 }}</ref><ref>{{cite web |title = Remarks by President Obama to the People of Africa |url=https://obamawhitehouse.archives.gov/the-press-office/2015/07/28/remarks-president-obama-people-africa |access-date = July 29, 2015 |via = [[NARA|National Archives]] |work = [[whitehouse.gov]] |date = July 28, 2015 }}</ref> During his July 2015 trip, Obama also was the first U.S. president ever to [[United States presidential visits to Sub-Saharan Africa|visit]] Kenya, which is the homeland of his father.<ref>{{cite news |last1 = Ferris |first1 = Sarah |title = Obama: Proud to be first U.S. president to visit Kenya |url=http://thehill.com/homenews/administration/249189-obama-proud-to-be-first-us-president-to-visit-kenya |work = [[The Hill (newspaper)|The Hill]] |access-date = July 30, 2015 |date = July 25, 2015 }}</ref>
+
+====Hiroshima speech====
+
+On May 27, 2016, Obama became the first sitting American president to visit [[Hiroshima]], Japan, 71 years after the [[Atomic bombings of Hiroshima and Nagasaki|U.S. atomic bombing of Hiroshima]] towards the end of [[World War II]]. Accompanied by Japanese Prime Minister [[Shinzō Abe]], Obama paid tribute to the victims of the bombing at the [[Hiroshima Peace Memorial Museum]].<ref>{{cite news|url=https://www.bbc.co.uk/news/world-us-canada-36395350|title=President Obama visits Hiroshima|publisher=BBC News|access-date=June 19, 2016}}</ref> Although he was pressured to by atomic bomb survivor groups, he did not apologize for the decision to drop the bomb.<ref>{{cite news|url=https://www.usatoday.com/story/news/world/2016/05/27/obama-visit-hiroshima-bomb-site-pledges-no-apology/85022938/|title=Sympathy for victims but no apology as Obama makes historic Hiroshima visit|work=USA Today|access-date=July 13, 2021}}</ref>
+
+====Russia====
+
+{{See also|Russia–United States relations#From Obama's first term to election of Trump (2009–16)}}
+[[File:Vladimir Putin and Barack Obama (2015-09-29) 01.jpg|thumb|Obama meets Russian President [[Vladimir Putin]] in September 2015.]]
+
+In March 2010, an agreement was reached with the administration of Russian President [[Dmitry Medvedev]] to replace the [[START I|1991 Strategic Arms Reduction Treaty]] with a new pact reducing the number of long-range nuclear weapons in the arsenals of both countries by about a third.<ref>{{cite news |last=Baker |first=Peter |date=March 26, 2010 |url=https://www.nytimes.com/2010/03/27/world/europe/27start.html |archive-url=https://web.archive.org/web/20100328142730/http://www.nytimes.com/2010/03/27/world/europe/27start.html |archive-date=March 28, 2010 |url-access=subscription |url-status=live |title=Obama Seals Arms Control Deal With Russia |work=The New York Times }}</ref> Obama and Medvedev signed the [[New START]] treaty in April 2010, and the [[United States Senate|U.S. Senate]] ratified it in December 2010.<ref>{{cite news |url=https://www.nytimes.com/2010/12/23/world/europe/23treaty.html |archive-url=https://web.archive.org/web/20101223044444/http://www.nytimes.com/2010/12/23/world/europe/23treaty.html |archive-date=December 23, 2010 |url-access=subscription |url-status=live |work = The New York Times |first = Peter |last = Baker |title = Senate Passes Arms Control Treaty With Russia, 71–26 |date = December 22, 2010 }}</ref> In December 2011, Obama instructed agencies to consider [[LGBT rights by country or territory|LGBT rights]] when issuing financial aid to foreign countries.<ref>{{cite news |last = McVeigh |first = Karen |url=https://www.theguardian.com/world/2011/dec/07/gay-rights-us-aid-criteria |title = Gay rights must be criterion for US aid allocations, instructs Obama |newspaper = The Guardian |location = London |date = December 6, 2011 |access-date = January 4, 2013 }}</ref> In August 2013, he criticized Russia's law that discriminates against gays,<ref name="LAT80713">{{cite news |url=https://articles.latimes.com/2013/aug/07/nation/la-na-pn-obama-leno-russia-snowden-20130807 |title = Obama criticizes Russia's new anti-gay law in Leno interview |last = Parsons |first = Christi |date = August 7, 2013 |work = [[Los Angeles Times]] |access-date = August 27, 2014 }}</ref> but he stopped short of advocating a boycott of the upcoming [[2014 Winter Olympics]] in [[Sochi]], Russia.<ref name="Huffpo80913">{{cite news |url=https://www.huffingtonpost.com/2013/08/09/obama-olympic-boycott_n_3733275.html |title = Obama Opposes Olympic Boycott, Criticizes Russian Anti-Gay Law |last = Johnson |first = Luke |date = August 9, 2013 |work = [[The Huffington Post]] |access-date = August 27, 2014 }}</ref>
+
+After [[Annexation of Crimea by the Russian Federation|Russia's invasion of Crimea]] in 2014, [[Russian military intervention in Syria|military intervention]] in Syria in 2015, and the [[2016 United States election interference by Russia|interference]] in the [[2016 United States presidential election|2016 U.S. presidential election]],<ref name="ftelect">{{cite news|url=https://www.ft.com/content/c596c0a8-a278-11e6-82c3-4351ce86813f | newspaper=[[Financial Times]] | title=US election: The Russia factor: Officials say Moscow's interference is unprecedented. Has the Kremlin achieved its goal? | date=November 4, 2016 |url-access=subscription |archive-url=https://archive.today/20170207141246/https://www.ft.com/content/c596c0a8-a278-11e6-82c3-4351ce86813f |archive-date=February 7, 2017 |url-status=live}}</ref> Obama's Russia policy was widely seen as a failure.<ref name="friedmnyt">{{cite news|first= Thomas L. |last=Friedman|url=https://www.nytimes.com/2016/10/05/opinion/lets-get-putins-attention.html |archive-url=https://web.archive.org/web/20161005073745/http://www.nytimes.com/2016/10/05/opinion/lets-get-putins-attention.html |archive-date=October 5, 2016 |url-access=subscription |url-status=live| newspaper=The New York Times| title=Let's Get Putin's Attention | date=October 5, 2016}}</ref> [[George Robertson, Baron Robertson of Port Ellen|George Robertson]], a former UK defense secretary and NATO secretary-general, said Obama had "allowed Putin to jump back on the world stage and test the resolve of the West", adding that the legacy of this disaster would last.<ref name="obexit">{{cite news|url=https://www.nytimes.com/2016/11/07/world/europe/europeans-view-obamas-exit-with-a-mix-of-admiration-and-regret.html |archive-url=https://web.archive.org/web/20161107030307/http://www.nytimes.com/2016/11/07/world/europe/europeans-view-obamas-exit-with-a-mix-of-admiration-and-regret.html |archive-date=November 7, 2016 |url-access=subscription |url-status=live | newspaper=The New York Times| title=Europeans View Obama's Exit With a Mix of Admiration and Regret | date=November 6, 2016}}</ref>
+
+===Cultural and political image===
+
+{{Main|Public image of Barack Obama}}
+{{See also|International reactions to the 2012 United States presidential election}}
+
+Obama's family history, upbringing, and [[Ivy League]] education differ markedly from those of African-American politicians who launched their careers in the 1960s through participation in the [[civil rights movement]].<ref>{{cite news|last=Wallace-Wells |first=Benjamin |title=The Great Black Hope: What's Riding on Barack Obama? |date=November 2004 |work=Washington Monthly |url=http://www.washingtonmonthly.com/features/2004/0411.wallace-wells.html |access-date=April 7, 2008 |archive-url=https://web.archive.org/web/20080513153556/http://www.washingtonmonthly.com/features/2004/0411.wallace-wells.html |archive-date=May 13, 2008 |url-status=dead }} See also: {{cite news|first=Janny |last=Scott |title=A Member of a New Generation, Obama Walks a Fine Line |date=December 28, 2007 |url=http://www.iht.com/articles/2007/12/28/america/obama.php |work=International Herald Tribune |access-date=April 7, 2008 |archive-url=https://web.archive.org/web/20080117005009/http://www.iht.com/articles/2007/12/28/america/obama.php |archive-date=January 17, 2008 }}</ref> Expressing puzzlement over questions about whether he is "black enough", Obama told an August 2007 meeting of the [[National Association of Black Journalists]] that "we're still locked in this notion that if you appeal to white folks then there must be something wrong."<ref>{{cite news |first = Les |last = Payne |title = In One Country, a Dual Audience |format = paid archive |date = August 19, 2007 |url = https://pqasb.pqarchiver.com/newsday/access/1322008241.html?dids=1322008241:1322008241&FMT=ABS&FMTS=ABS:FT |work = Newsday |place = New York |access-date = April 7, 2008 |archive-date = September 15, 2008 |archive-url = https://web.archive.org/web/20080915033412/http://pqasb.pqarchiver.com/newsday/access/1322008241.html?dids=1322008241:1322008241&FMT=ABS&FMTS=ABS:FT |url-status = dead }}</ref> Obama acknowledged his youthful image in an October 2007 campaign speech, saying: "I wouldn't be here if, time and again, the torch had not been passed to a new generation."<ref>{{cite news |first = Mike |last = Dorning |title = Obama Reaches Across Decades to JFK |format = paid archive |date = October 4, 2007 |url = https://pqasb.pqarchiver.com/chicagotribune/access/1353513781.html?dids=1353513781:1353513781&FMT=ABS&FMTS=ABS:FT&type=current&date=Oct+4%2C+2007&author=Mike+Dorning |work = Chicago Tribune |access-date = April 7, 2008 |archive-date = June 17, 2008 |archive-url = https://web.archive.org/web/20080617150439/http://pqasb.pqarchiver.com/chicagotribune/access/1353513781.html?dids=1353513781:1353513781&FMT=ABS&FMTS=ABS:FT&type=current&date=Oct+4%2C+2007&author=Mike+Dorning |url-status = dead }} See also: {{cite news |first = Toby |last = Harnden |title = Barack Obama is JFK Heir, Says Kennedy Aide |date = October 15, 2007 |url = https://www.telegraph.co.uk/news/worldnews/1565992/Barack-Obama-is-JFK-heir-says-Kennedy-aide.html |url-access = subscription |work = The Daily Telegraph |place = London |access-date = April 7, 2008 |archive-url = https://web.archive.org/web/20080515071852/http://www.telegraph.co.uk/news/worldnews/1565992/Barack-Obama-is-JFK-heir%2C-says-Kennedy-aide.html |archive-date = May 15, 2008 |url-status = live }}</ref>
+
+Obama is frequently referred to as an exceptional orator.<ref name="exceptional orator" /> During his pre-inauguration transition period and continuing into his presidency, Obama delivered a series of weekly Internet video addresses.<ref>{{cite web |url=https://www.youtube.com/user/ChangeDotGov |title = YouTube—ChangeDotGov's Channel |via = YouTube |access-date = April 18, 2010 |archive-url=https://web.archive.org/web/20100220004338/http://www.youtube.com/user/ChangeDotGov|archive-date=February 20, 2010 }}</ref> In his speeches as president, Obama did not make more overt references to race relations than his predecessors,<ref>Dyson, Michael Eric. (2016). The Black Presidency: Barack Obama and the Politics of Race in America. New York: Houghton Mifflin Harcourt. p. 275. {{ISBN|978-0-544-38766-9}}.</ref><ref>{{Cite book|url=https://www.cambridge.org/core/books/governing-with-words/5D4F713A016401E3FC3922C66D371FF2|title=Governing with Words|last=Gillion|first=Daniel Q.|date=2016|website=Cambridge Core|access-date=June 5, 2019|doi=10.1017/CBO9781316412299|isbn=978-1-316-41229-9}}</ref> but according to one study, he implemented stronger policy action on behalf of African-Americans than any president since the Nixon era.<ref>{{Cite journal|last1=Butler|first1=Bennett|last2=Mendelberg|first2=Tali|last3=Haines|first3=Pavielle E.|date=2019|title="I'm Not the President of Black America": Rhetorical versus Policy Representation|journal=Perspectives on Politics|volume=17|issue=4|pages=1038–1058|doi=10.1017/S1537592719000963|issn=1537-5927|doi-access=free}}</ref>
+
+[[File:Gallup Poll-Approval Rating-Barack Obama.svg|thumb|left|Presidential approval ratings]]
+
+According to the [[Gallup Organization]], Obama began his presidency with a 68 percent approval rating<ref>{{cite web |url=http://www.gallup.com/poll/113962/obama-starts-job-approval.aspx |title = Obama Starts With 68% Job Approval |publisher = Gallup.com |date = January 24, 2009 |access-date = June 19, 2011 |archive-url=https://web.archive.org/web/20110616021142/http://www.gallup.com/poll/113962/Obama-Starts-Job-Approval.aspx |archive-date = June 16, 2011 }}</ref> before gradually declining for the rest of the year, and eventually bottoming out at 41 percent in August 2010,<ref>{{cite news |url=http://content.usatoday.com/communities/theoval/post/2011/04/obama-hits-low-point-in-gallup-poll/1 |title = Obama hits low point in Gallup Poll—41% |work = USA Today |date = April 15, 2011 |access-date = June 19, 2011 }}</ref> a trend similar to [[Ronald Reagan]]'s and [[Bill Clinton]]'s first years in office.<ref>{{cite web |first = Jon |last = Terbush |url=http://tpmdc.talkingpointsmemo.com/2010/12/approval-by-numbers-how-obama-compares-to-past-presidents.php |title = Approval By Numbers: How Obama Compares To Past Presidents |publisher = Tpmdc.talkingpointsmemo.com |date = December 9, 2010 |access-date = June 19, 2011 }}</ref> He experienced a small poll bounce shortly after the [[death of Osama bin Laden]] on May 2, 2011. This bounce lasted until around June 2011, when his approval numbers dropped back to where they were previously.<ref>{{cite news |last = Oliphant |first = James |date = May 11, 2011 |url=https://articles.latimes.com/2011/may/11/news/la-pn-obama-bounce-20110511 |title = Bin Laden bounce? New poll shows jump in Obama approval |work = [[Los Angeles Times]] |access-date = June 7, 2011 }}</ref><ref>{{cite news |last1 = Balz |first1 = Dan |last2 = Cohen |first2 = John |date = June 6, 2011 |url=https://www.washingtonpost.com/politics/obama-loses-bin-laden-bounce-romney-on-the-move-among-gop-contenders/2011/06/06/AGT5wiKH_story.html |title = Obama loses bin Laden bounce; Romney on the move among GOP contenders |newspaper = The Washington Post |publisher = Nash Holdings LLC |access-date = June 7, 2011 }}</ref> His approval ratings rebounded around the same time as his reelection in 2012, with polls showing an average job approval of 52 percent shortly after his second inauguration.<ref>{{cite web |url=http://www.gallup.com/poll/124922/Presidential-Job-Approval-Center.aspx |title = Presidential Job Approval Center |publisher = Gallup.com |access-date = June 23, 2015 }}</ref> Despite approval ratings dropping to 39 percent in late-2013 due to the ACA roll-out, they climbed to 50 percent in January 2015 according to Gallup.<ref>{{cite web |url=http://www.gallup.com/poll/113980/Gallup-Daily-Obama-Job-Approval.aspx |title = Gallup Daily: Obama Job Approval |date = January 22, 2015 |access-date = March 23, 2015 |website = Gallup Polling }}</ref>
+
+Polls showed strong support for Obama in other countries both before and during his presidency.<ref>{{cite news |url=http://www.abc.net.au/news/stories/2008/09/09/2360240.htm |title = World wants Obama as president: poll |agency = Reuters |date = September 9, 2008 |work = [[ABC News (Australia)|ABC News]] }}</ref><ref>{{cite web|last1=Wike|first1=Richard|last2=Poushter|first2=Jacob|last3=Zainulbhai|first3=Hani|title=As Obama Years Draw to Close, President and U.S. Seen Favorably in Europe and Asia|url=http://www.pewglobal.org/2016/06/29/as-obama-years-draw-to-close-president-and-u-s-seen-favorably-in-europe-and-asia/|website=Global Attitudes & Trends|publisher=Pew Research Center|access-date=February 23, 2017|date=June 29, 2016}}</ref><ref>{{cite news|last1=Wan|first1=William|last2=Clement|first2=Scott|date=November 18, 2016|title=Most of the world doesn't actually see America the way Trump said it did|newspaper=[[The Washington Post]]|url=https://www.washingtonpost.com/graphics/national/obama-legacy/global-approval-rating.html|access-date=February 8, 2021}}</ref> In a February 2009 poll conducted in Western Europe and the U.S. by [[Harris Insights & Analytics|Harris Interactive]] for [[France 24]] and the ''[[International Herald Tribune]]'', Obama was rated as the most respected world leader, as well as the most powerful.<ref>{{cite news |url=https://www.nytimes.com/2009/02/06/world/americas/06iht-poll.4.19983290.html |archive-url=https://web.archive.org/web/20090927104642/http://www.nytimes.com/2009/02/06/world/americas/06iht-poll.4.19983290.html |archive-date=September 27, 2009 |url-access=subscription |url-status=live |title = Poll shows Obama atop list of most respected |last = Freed |first = John C. |date = February 6, 2009 |work = The New York Times |access-date = January 22, 2012 }}</ref> In a similar poll conducted by Harris in May 2009, Obama was rated as the most popular world leader, as well as the one figure most people would pin their hopes on for pulling the world out of the economic downturn.<ref>{{cite news |url=https://www.nytimes.com/2009/05/29/world/europe/29iht-poll.html |archive-url=https://web.archive.org/web/20090601104537/http://www.nytimes.com/2009/05/29/world/europe/29iht-poll.html |archive-date=June 1, 2009 |url-access=subscription |url-status=live |title = Obama Most Popular Leader, Poll Finds |date = May 29, 2009 |work = The New York Times |access-date = January 22, 2012 }}</ref><ref>{{cite news |title = Obama remains a popular symbol of hope |url=http://www.france24.com/en/20090529-obama-remains-popular-symbol-hope-harris-interactive-poll-world-leaders |date = June 2, 2009 |publisher = [[France 24]] |archive-url=https://web.archive.org/web/20110513050036/http://www.france24.com/en/20090529-obama-remains-popular-symbol-hope-harris-interactive-poll-world-leaders |archive-date = May 13, 2011 |access-date = January 22, 2012 }}</ref>
+
+[[File:G8 leaders watching football.jpg|thumb|G8 leaders watching the [[2012 UEFA Champions League Final]]|alt=Prime Minister David Cameron of the United Kingdom, President Barack Obama, Chancellor Angela Merkel of Germany, José Manuel Barroso, President of the European Commission, President François Hollande of France and others react emotionally while watching the overtime shootout of the Chelsea vs. Bayern Munich [[2012 UEFA Champions League Final|Champions League final]], in the Laurel Cabin conference room during the G8 Summit at Camp David, Maryland, May 19, 2012. Cameron raises his arms triumphantly as the Chelsea team wins their first Champions League title in the overtime shootout.]]
+
+Obama won [[Grammy Award for Best Spoken Word Album|Best Spoken Word Album]] [[Grammy Award]]s for abridged [[audiobook]] versions of ''[[Dreams from My Father]]'' in February 2006 and for ''[[The Audacity of Hope]]'' in February 2008.<ref>{{cite news |author = Goodman, Dean |date = February 10, 2008 |title = Obama or Clinton? Grammys go for Obama |work = Reuters |url=https://www.reuters.com/article/musicNews/idUSN0852813420080210 |access-date = November 24, 2008 |archive-url=https://web.archive.org/web/20081219070404/https://www.reuters.com/article/musicNews/idUSN0852813420080210 |archive-date = December 19, 2008 |url-status=live }}</ref> His [[Barack Obama presidential primary campaign, 2008#New Hampshire|concession speech]] after the New Hampshire primary was set to music by independent artists as the music video "[[Yes We Can (will.i.am song)|Yes We Can]]", which was viewed ten million times on YouTube in its first month<ref>{{cite news |url=http://entertainment.timesonline.co.uk/tol/arts_and_entertainment/film/article3491460.ece |title = Celebrities join YouTube revolution |last = Strange |first = Hannah |date = March 5, 2008 |work = The Times |place = London |access-date = December 18, 2008 }} {{subscription required}}</ref> and received a [[Daytime Emmy Award]].<ref>{{cite news |url=http://latimesblogs.latimes.com/soundboard/2008/06/emmys-give-knuc.html |title = Emmys give knuckle bump to will.i.am; more videos on the way |last = Wappler |first = Margaret |date = June 20, 2008 |work = Los Angeles Times blogs |access-date = January 26, 2012 |archive-url=https://web.archive.org/web/20110516090327/http://latimesblogs.latimes.com/soundboard/2008/06/emmys-give-knuc.html |archive-date = May 16, 2011 }}</ref> In December 2008 and in 2012, ''[[Time (magazine)|Time]]'' magazine named Obama as its [[Time Person of the Year|Person of the Year]].<ref>{{Cite magazine |last = Scherer |first = Michael |url=http://poy.time.com/2012/12/19/person-of-the-year-barack-obama/ |title = 2012 Person of the Year: Barack Obama, the President |magazine = Time |date = December 19, 2012 |access-date = December 19, 2012 }}</ref> The 2008 awarding was for his historic candidacy and election, which ''Time'' described as "the steady march of seemingly impossible accomplishments."<ref>{{cite news|last=Von Drehle |first=David |title=Why History Can't Wait |url=http://www.time.com/time/specials/2008/personoftheyear/article/0,31682,1861543_1865068,00.html |magazine=Time |date=December 16, 2008 |access-date=December 17, 2008 |archive-url=https://web.archive.org/web/20081217223841/http://www.time.com/time/specials/2008/personoftheyear/article/0%2C31682%2C1861543_1865068%2C00.html |archive-date=December 17, 2008 |url-status=dead }}</ref> On May 25, 2011, Obama became the first president of the United States to address both houses of the [[Parliament of the United Kingdom|UK Parliament]] in [[Westminster Hall]], London. This was only the fifth occurrence since the start of the 20th century of a head of state's being extended this invitation, following [[Charles de Gaulle]] in 1960, [[Nelson Mandela]] in 1996, [[Elizabeth II|Queen Elizabeth II]] in 2002 and [[Pope Benedict XVI]] in 2010.<ref>{{cite web |first = Barack |last = Obama |url=http://www.newstatesman.com/2011/05/nations-rights-world-united |title = Full transcript—Speech to UK Parliament |via = [[New Statesman]] |date = May 25, 2011 |access-date = June 14, 2014 }}</ref><ref>{{cite web |url=http://www.parliament.uk/about/living-heritage/building/palace/westminsterhall/key-dates-wesminster-hall/keydates20th-topresent/ |title = 20th century to the present day |publisher = Parliament of the United Kingdom |date = April 21, 2010 |access-date = June 14, 2014 }}</ref>
+
+<!--Please read the talk page to note the ongoing discussion, and also please use citation templates or expanded footnoting when citing. Raw URLs are less desirable. Thanks-->
+On October 9, 2009, the [[Norwegian Nobel Committee]] announced that Obama had won the [[2009 Nobel Peace Prize]] "for his extraordinary efforts to strengthen international diplomacy and cooperation between peoples."<!--See [[WP:EGG]] before attempting to hide this link!--><ref name="nobel peace prize">{{cite web |url=http://nobelprize.org/nobel_prizes/peace/laureates/2009/ |title = The Nobel Peace Prize 2009 |publisher = Nobel Foundation |access-date = October 9, 2009 |archive-url=https://web.archive.org/web/20091010170600/http://nobelprize.org/nobel_prizes/peace/laureates/2009/ |archive-date = October 10, 2009 |url-status=live }}</ref> Obama accepted this award in [[Oslo]], Norway on December 10, 2009, with "deep gratitude and great humility."<ref name="CNN: Obama acceptance transcript">{{cite news |url=http://www.cnn.com/2009/POLITICS/12/10/obama.transcript/index.html |title = Obama: 'Peace requires responsibility' |publisher = CNN |date = December 10, 2009 |access-date = May 21, 2011 }}</ref> The award drew a mixture of praise and criticism from world leaders and media figures.<ref>{{Cite news|last=Philp|first=Catherine|date=October 10, 2009|title=Barack Obama's peace prize starts a fight|language=en|work=[[The Times]]|url=https://www.thetimes.co.uk/article/barack-obamas-peace-prize-starts-a-fight-nltk0qdq65d|access-date=December 15, 2021|issn=0140-0460}}</ref><ref>{{Cite news |first = Sharon|last= Otterman |title = World Reaction to a Nobel Surprise |newspaper = The New York Times |date = October 9, 2009 |url=http://thelede.blogs.nytimes.com/2009/10/09/world-reaction-to-a-nobel-surprise/?hp#bozoanchor |access-date = October 9, 2009 }}</ref><ref>{{cite news |url=https://www.reuters.com/article/GCA-BarackObama/idUKTRE5983AM20091009?virtualBrandChannel=11621&sp=true |title = Obama Peace Prize win has Americans asking why? |work = Reuters |access-date = October 9, 2009 |date = October 9, 2009 }}</ref><ref>{{cite news |url=https://www.nbcnews.com/id/33237202 |title = Obama: Nobel Peace Prize 'a call to action'—Politics—White House |work = NBC News |access-date = September 13, 2014 |date = October 9, 2009 }}</ref> Obama's peace prize was called a "stunning surprise" by ''[[The New York Times]]''.<ref>{{cite news |url=https://www.nytimes.com/2009/10/10/world/10nobel.html |archive-url=https://web.archive.org/web/20110501012645/http://www.nytimes.com/2009/10/10/world/10nobel.html |archive-date=May 1, 2011 |url-access=subscription |url-status=live |work = The New York Times |title = Surprise Nobel for Obama Stirs Praise and Doubts |first = Steven |last = Erlanger |date = October 10, 2009 |access-date = May 20, 2010 }}</ref> Some [[Neoconservatism|neoconservatives]] praised his speech for what they viewed as pro-American content.<ref>{{Cite news|last=Kagan|first=Robert|date=December 13, 2009|title=Robert Kagan—Obama shows he has learned from the early world resistance|newspaper=[[The Washington Post]]|url=http://www.washingtonpost.com/wp-dyn/content/article/2009/12/11/AR2009121103517.html|access-date=November 2, 2020|issn=0190-8286}}</ref><ref>{{Cite news|last=Ricks|first=Thomas E.|title=Friends like these (II): Neocons embracing Obama|url=https://foreignpolicy.com/2009/12/14/friends-like-these-ii-neocons-embracing-obama/|access-date=November 2, 2020|work=[[Foreign Policy]]}}</ref> He became the fourth U.S. president to be awarded the Nobel Peace Prize and the third to become a Nobel laureate while in office.<ref>{{cite news |url=http://www.cnn.com/2009/POLITICS/10/09/us.nobel.presidents/ |title = Obama's win unique among presidents |publisher = CNN |date = October 9, 2009 }}</ref> Obama's Nobel Prize was viewed skeptically in subsequent years, especially after the director of the Nobel Institute, [[Geir Lundestad]], said that Obama's Peace Prize did not have the desired effect of encouraging the President.<ref>{{cite news |last1 = Taylor |first1 = Adam |title = Obama's Nobel peace prize didn't have the desired effect, former Nobel official reveals |url=https://www.washingtonpost.com/news/worldviews/wp/2015/09/17/obamas-nobel-peace-prize-didnt-have-the-desired-effect-former-nobel-official-reveals/ |date=September 17, 2015 |newspaper = The Washington Post |access-date = February 4, 2016 }}</ref>
+
+==Post-presidency (2017–present)==
+[[File:58th Presidential Inaugural Ceremony 170120-D-BP749-1327.jpg|thumb|Obama with his then-new successor [[Donald Trump]] and his later successor [[Joe Biden]], at the former's [[Inauguration of Donald Trump|inauguration]] on January 20, 2017]]
+[[File:Barack Obama and Donald Trump.jpg|thumb|Obama and [[Donald Trump]], January 20, 2017]]
+
+Obama's presidency ended on January 20, 2017, upon the [[Inauguration of Donald Trump|inauguration]] of his successor, [[Donald Trump]].<ref>{{Cite news|title=How Obama felt after Trump's inauguration|language=en-GB|publisher=BBC News|url=https://www.bbc.co.uk/news/av/world-us-canada-42491779|access-date=March 6, 2021}}</ref><ref>{{Cite web|last=Panetta|first=Grace|title=Michelle Obama said attending Trump's inauguration as one of few people of color was 'a lot emotionally'|url=https://www.businessinsider.com/michelle-obama-trump-inauguration-a-lot-emotionally-2019-7|access-date=March 6, 2021|website=Business Insider}}</ref> The family currently rents a house in [[Kalorama, Washington, D.C.]]<ref>{{cite news|url=https://edition.cnn.com/2016/05/25/politics/obama-kalorama-washington-dc-leases-house/ |title=Peek inside Obama's post-presidential pad|last1=Kosinski|first1=Michelle |first2=Daniella |last2=Diaz |date=May 27, 2016|work=CNN|access-date=January 22, 2017}}</ref> On March 2, 2017, the [[John F. Kennedy Presidential Library and Museum]] awarded the [[Profile in Courage Award]] to Obama "for his enduring commitment to democratic ideals and elevating the standard of political courage."<ref>{{cite web|title=Former President Barack H. Obama Announced as Recipient of 2017 John F. Kennedy Profile in Courage Award|url=https://www.jfklibrary.org/About-Us/News-and-Press/Press-Releases/2017-Profile-in-Courage-Award.aspx|website=John F. Kennedy Presidential Library & Museum|publisher=John F. Kennedy Presidential Library & Museum|access-date=April 8, 2017|archive-url=https://web.archive.org/web/20170408015950/https://www.jfklibrary.org/About-Us/News-and-Press/Press-Releases/2017-Profile-in-Courage-Award.aspx|archive-date=April 8, 2017|date=March 2, 2017 |url-status=live }}</ref> His first public appearance since leaving the office was a seminar at the [[University of Chicago]] on April 24, where he appealed for a new generation to participate in politics.<ref>{{cite news|url=https://www.nytimes.com/2017/04/24/us/politics/obama-chicago.html |archive-url=https://web.archive.org/web/20170424225327/https://www.nytimes.com/2017/04/24/us/politics/obama-chicago.html |archive-date=April 24, 2017 |url-access=subscription |url-status=live|title=Obama Steps Back into Public Life, Trying to Avoid One Word: Trump|date=April 24, 2017|work=The New York Times|first=Michael D.|last=Shear}}</ref>
+
+[[File:Obama Macri October 2017.jpg|thumb|Obama playing golf with the President of Argentina [[Mauricio Macri]], October 2017]] When Trump announced his withdrawal of the United States from the [[Paris Agreement]] on June 1, Obama released a statement disagreeing with the choice.<ref>{{cite news|url=https://edition.cnn.com/2017/06/01/politics/obama-paris-climate/ |title=Obama pans Trump withdrawal from climate deal|first=MJ|last=Lee|date=June 1, 2017|work=CNN}}</ref> After Senate Republicans revealed the [[Better Care Reconciliation Act of 2017]], their discussion draft of a health care bill to replace the Affordable Care Act, Obama released a Facebook post on June 22 calling the bill "a massive transfer of wealth from middle-class and poor families to the richest people in America."<ref>{{cite news|url=https://thehill.com/policy/healthcare/339035-obama-slams-fundamental-meanness-at-the-core-of-senate-healthcare-bill |title=Obama slams 'fundamental meanness' of Senate healthcare bill|date=June 22, 2017|first=Max|last=Greenwood|newspaper=The Hill}}</ref> On September 19, while delivering the keynote address at Goalkeepers, Obama admitted his frustration with Republicans backing "a bill that will raise costs, reduce coverage, and roll back protections for older Americans and people with pre-existing conditions."<ref>{{cite news|url=https://time.com/4949837/obamacare-repeal-barack-obama-graham-cassidy/ |title=Barack Obama Criticizes '50th or 60th' Attempt to Repeal the Affordable Care Act|date=September 20, 2017|first=Alana|last=Abramson|magazine=Time}}</ref> After Attorney General [[Jeff Sessions]] announced the termination of the [[Deferred Action for Childhood Arrivals]] (DACA) program on September 5, Obama released a Facebook post criticizing the decision.<ref>{{cite news|url=https://edition.cnn.com/2017/09/05/politics/obama-daca/index.html |title=Obama slams Trump for rescinding DACA, calls move 'cruel'|first=Kevin|last=Liptak|work=CNN|date=September 5, 2017}}</ref> Two days later, Obama partnered with former presidents Jimmy Carter, George H. W. Bush, Bill Clinton, and George W. Bush to work with [[One America Appeal]] to help the victims of [[Hurricane Harvey]] and [[Hurricane Irma]] in the [[Gulf Coast of the United States|Gulf Coast]] and [[Texas]] communities.<ref>{{cite news|url=https://thehill.com/blogs/blog-briefing-room/349993-former-presidents-add-irma-recovery-to-fundraising-appeal |title=Former presidents fundraise for Irma disaster relief|last=Shelbourne|first=Mallory|date=September 10, 2017|work=The Hill|access-date=September 11, 2017}}</ref>
+
+Obama hosted the inaugural summit of the [[Obama Foundation]] in Chicago from October 31 to November 1, 2017.<ref>{{Cite news|last=Hope|first=Leah|date=September 14, 2017|title=Obama Foundation holds public meeting about presidential library project|url=https://abc7chicago.com/2411976/|access-date=November 17, 2020|publisher=[[WLS-TV]]}}</ref> He intends for the foundation to be the central focus of his post-presidency and part of his ambitions for his subsequent activities following his presidency to be more consequential than his time in office.<ref>{{cite news |first=Edward-Isaac |last=Dovere |url=https://www.politico.com/story/2017/10/31/barack-obama-foundation-summit-244393|title=Obama, opening his foundation's first summit, calls for fixing civic culture|work=Politico|date=October 31, 2017}}</ref>
+
+In May 2018, Obama criticized President Trump's decision to withdraw from the nuclear deal with Iran under the Joint Comprehensive Plan of Action saying "the deal was working and it was in U.S. interests."<ref>{{Cite web|url=https://www.facebook.com/barackobama/posts/10155854913976749|archive-url=https://web.archive.org/web/20180511183521/https://www.facebook.com/barackobama/posts/10155854913976749|url-status=dead|title=Barack Obama|archive-date=May 11, 2018|via=Facebook}}</ref> Barack and Michelle Obama signed a deal on May 22, 2018, to produce docu-series, documentaries and features for [[Netflix]] under the Obamas' newly formed production company, [[Higher Ground Productions]].<ref>{{cite news |title=Obamas Sign Deal With Netflix, Form 'Higher Ground Productions' |first=Scott |last=Neuman |date=May 22, 2018 |url=https://www.npr.org/sections/thetwo-way/2018/05/22/613246456/obamas-sign-content-deal-with-netlfix-form-higher-ground-productions |publisher=NPR |access-date=September 17, 2018 }}</ref><ref>{{cite web |last1=Harris |first1=Hunter |title=The Obamas Will Produce Movies and Shows for Netflix |url=https://www.vulture.com/2018/05/the-obamas-will-produce-movies-and-shows-for-netflix.html |website=Vulture |access-date=September 17, 2018 |date=May 21, 2018 }}</ref> Higher Ground's first film, ''[[American Factory]],'' won the [[Academy Award for Best Documentary Feature]] in 2020.<ref>{{cite news|url=https://www.cnn.com/2020/01/13/entertainment/barack-and-michelle-obama-oscars/index.html|title=Barack and Michelle Obama's production company scores first Oscar nomination|last=Gonzalez|first=Sandra|date=January 13, 2020|work=CNN|access-date=January 21, 2020}}</ref>
+[[File:210120-D-WD757-1249 (50861341397).jpg|thumb|right|Obama and his wife [[Michelle Obama|Michelle]] at the [[inauguration of Joe Biden]]]]
+
+He received a 63% approval rating in Gallup's 2018 job approval poll for the past 10 U.S. presidents.<ref>{{Cite news|last=Jones|first=Jeffrey M.|date=February 15, 2018|title=Obama's First Retrospective Job Approval Rating Is 63%|publisher=[[Gallup (company)|Gallup]]|url=https://news.gallup.com/poll/226994/obama-first-retrospective-job-approval-rating.aspx|access-date=March 26, 2022}}</ref>
+
+A pipe bomb addressed to Obama was intercepted by the Secret Service on October 24, 2018. It was one of several pipe-bombs that had been [[October 2018 United States mail bombing attempts|mailed out to Democratic lawmakers and officials]].<ref name="auto2">{{cite news|last=Pitofsky|first=Marina|title=Suspicious packages sent to Clintons, Obamas, CNN: What we know so far|url=https://www.usatoday.com/story/news/2018/10/24/suspicious-packages-delivered-clintons-obamas-cnn-what-we-know/1749205002/|newspaper=USA Today|date=October 24, 2018|language=en|archive-url=https://web.archive.org/web/20181024161609/https://www.usatoday.com/story/news/2018/10/24/suspicious-packages-delivered-clintons-obamas-cnn-what-we-know/1749205002/|archive-date=October 24, 2018|url-status=live}}</ref>
+
+In 2019, Barack and Michelle Obama bought a home on [[Martha's Vineyard]] from [[Wyc Grousbeck]].<ref>{{cite news |last=Lukpat |first=Alyssa |date=December 5, 2019 |title=Obamas reportedly buy Martha's Vineyard waterfront estate for $11.75 million |url=https://www.bostonglobe.com/metro/2019/12/05/obamas-reportedly-buy-martha-vineyard-waterfront-estate-for-million/LeCI83nodDf735zneVfYKM/story.html |work=The Boston Globe}}</ref><ref>{{cite news |last=Howley |first=Kathleen |date=September 1, 2019 |title=Barack And Michelle Obama Are Buying Martha's Vineyard Estate From Boston Celtics Owner |url=https://www.forbes.com/sites/kathleenhowley/2019/09/01/obamas-buying-marthas-vineyard-estate-from-boston-celtics-owner/ |work=Forbes}}</ref> On October 29, 2019, Obama criticized "[[woke]]ness" and [[Cancel culture|call-out culture]] at the Obama Foundation's annual summit.<ref>{{Cite news|date=October 30, 2019|title=Barack Obama challenges 'woke' culture|language=en-GB|publisher=BBC News|url=https://www.bbc.com/news/world-us-canada-50239261|access-date=October 4, 2021}}</ref><ref>{{Cite news|last1=Rueb|first1=Emily S.|last2=Taylor|first2=Derrick Bryson|date=October 31, 2019|title=Obama on Call-Out Culture: 'That's Not Activism'|language=en-US|work=The New York Times|url=https://www.nytimes.com/2019/10/31/us/politics/obama-woke-cancel-culture.html |archive-url=https://web.archive.org/web/20191031174003/https://www.nytimes.com/2019/10/31/us/politics/obama-woke-cancel-culture.html |archive-date=October 31, 2019 |url-access=subscription |url-status=live|access-date=October 4, 2021|issn=0362-4331}}</ref>
+
+Obama was reluctant to make an endorsement in the [[2020 Democratic presidential primaries]] because he wanted to position himself to unify the party, no matter who the nominee was.<ref>{{cite web |last1=Jackson |first1=John Fritze and David |title='Voters themselves must pick': Why Barack Obama isn't endorsing Joe Biden or anyone else for president |url=https://www.usatoday.com/story/news/politics/elections/2020/02/27/why-obama-wont-endorse-biden-south-carolina-super-tuesday-nears/4890693002/ |website=USA TODAY |access-date=March 18, 2022}}</ref> On April 14, 2020, Obama endorsed his former vice president [[Joe Biden]], the presumptive Democratic nominee, for president in the [[2020 United States presidential election|2020 election]], stating that he has "all the qualities we need in a president right now."<ref>{{cite news |last1=Astor |first1=Maggie |last2=Glueck |first2=Katie |title=Barack Obama Endorses Joe Biden for President |url=https://www.nytimes.com/2020/04/14/us/politics/obama-endorses-biden.html |archive-url=https://web.archive.org/web/20200414145003/https://www.nytimes.com/2020/04/14/us/politics/obama-endorses-biden.html |archive-date=April 14, 2020 |url-access=subscription |url-status=live |work=The New York Times |date=April 14, 2020}}</ref><ref>{{Cite news|title=Obama endorses Joe Biden for president|language=en-GB|publisher=BBC News|url=https://www.bbc.co.uk/news/av/world-us-canada-52287456|access-date=March 6, 2021}}</ref> In May 2020, Obama criticized President Trump for [[Trump administration communication during the COVID-19 pandemic|his handling]] of the [[COVID-19 pandemic in the United States|COVID-19 pandemic]], calling his response to the crisis "an absolute chaotic disaster", and stating that the consequences of [[Presidency of Donald Trump|the Trump presidency]] have been "our worst impulses unleashed, our proud reputation around the world badly diminished, and our democratic institutions threatened like never before."<ref>{{Cite news|date=August 20, 2020|title=DNC 2020: Obama blasts Trump's 'reality show' presidency|language=en-GB|publisher=BBC News|url=https://www.bbc.com/news/election-us-2020-53844037|access-date=March 6, 2021}}</ref> Trump retaliated by accusing Obama of having committed "the biggest political crime in American history", although he refused to say what he was talking about, telling reporters: "You know what the crime is, the crime is very obvious to everybody."<ref>{{Cite web|title=Trump Accuses Obama Of A Crime In White House Press Briefing|url=https://www.forbes.com/sites/andrewsolender/2020/05/11/trump-accuses-obama-of-a-crime-in-white-house-press-briefing/|last=Solender|first=Andrew|work=Forbes|access-date=May 12, 2020}}</ref>
+
+Obama wrote a presidential memoir, in a $65{{nbs}}million deal with [[Penguin Random House]].<ref name="nymag">{{cite magazine |url=https://nymag.com/intelligencer/2018/06/where-is-barack-obama.html |title=Where Is Barack Obama? |first=Gabriel |last=Debenedetti |magazine=[[New York (magazine)|New York]] |date=June 24, 2018}}</ref> The book, ''[[A Promised Land]]'', was released on November 17, 2020.<ref>{{Cite news |last1=Harris |first1=Elizabeth A. |title=Obama's Memoir 'A Promised Land' Coming in November |work=[[The New York Times]] |date=September 17, 2020 |url=https://www.nytimes.com/2020/09/17/books/obama-memoir-a-promised-land.html |archive-url=https://web.archive.org/web/20200917101005/https://www.nytimes.com/2020/09/17/books/obama-memoir-a-promised-land.html |archive-date=September 17, 2020 |url-access=subscription |url-status=live |issn=0362-4331 }}</ref><ref>{{Cite news|last=Adichie|first=Chimamanda Ngozi|date=November 12, 2020|title=Chimamanda Ngozi Adichie on Barack Obama's 'A Promised Land'|work=The New York Times|url=https://www.nytimes.com/2020/11/12/books/review/barack-obama-a-promised-land.html |archive-url=https://web.archive.org/web/20201112144007/https://www.nytimes.com/2020/11/12/books/review/barack-obama-a-promised-land.html |archive-date=November 12, 2020 |url-access=subscription |url-status=live|access-date=November 17, 2020|issn=0362-4331}}</ref><ref>{{Cite news|last=Carras|first=Christi|date=September 17, 2020|title=Barack Obama's new memoir will arrive right after the presidential election|url=https://www.latimes.com/entertainment-arts/books/story/2020-09-17/barack-obama-book-memoir-a-promised-land|access-date=November 17, 2020|work=Los Angeles Times}}</ref>
+
+In February 2021, Obama and musician [[Bruce Springsteen]] started a podcast called ''[[Renegades: Born in the USA]]'' where the two talk about "their backgrounds, music and their 'enduring love of America.{{'"}}<ref>{{cite web |last1=Gabbatt |first1=Adam |title=Barack Obama and Bruce Springsteen team up for new podcast |url=https://www.theguardian.com/us-news/2021/feb/22/barack-obama-bruce-springsteen-podcast-renegades-born-usa |website=[[The Guardian]] |access-date=March 24, 2021 |date=February 22, 2021}}</ref><ref>{{cite news |last1=Sisario |first1=Ben |title=Barack Obama and Bruce Springsteen: The Latest Podcast Duo |url=https://www.nytimes.com/2021/02/22/arts/obama-springsteen-podcast-spotify.html |archive-url=https://ghostarchive.org/archive/20211228/https://www.nytimes.com/2021/02/22/arts/obama-springsteen-podcast-spotify.html |archive-date=December 28, 2021 |url-access=limited |access-date=March 24, 2021 |work=The New York Times |date=February 22, 2021}}{{cbignore}}</ref> In late 2021, Regina Hicks had signed a deal with [[Netflix]], in a venture with his and [[Michelle Obama|Michelle]]'s [[Higher Ground Productions|Higher Ground]] to develop comedy projects.<ref>{{Cite web|last=Otterson|first=Joe|date=December 8, 2021|title='Upshaws' Co-Creator Regina Hicks Sets Netflix Overall Deal, to Develop Comedy Series With Obamas' Higher Ground|url=https://variety.com/2021/tv/news/upshaws-regina-hicks-netflix-overall-deal-obamas-higher-ground-1235129305/|access-date=December 9, 2021|website=Variety|language=en-US}}</ref> On March 4, 2022, Obama won an Audio Publishers Association (APA) Award in the best narration by the author category for the narration of his memoir ''[[A Promised Land]]''.<ref>{{Cite magazine|last=Perez|first=Lexy|title=Barack Obama, Lin-Manuel Miranda Among 2022 Audie Awards Winners|url=https://www.billboard.com/music/awards/audie-awards-2022-winners-lin-manuel-miranda-1235040071/|date=March 5, 2022|access-date=March 6, 2022|magazine=Billboard}}</ref>
+
+On April 5, 2022, Obama visited the White House for the first time since leaving office, in an event celebrating the 12th annual anniversary of the signing of the Affordable Care Act.<ref>{{Cite web |date=April 5, 2022 |title=Remarks by President Biden, Vice President Harris, and Former President Obama on the Affordable Care Act |url=https://www.whitehouse.gov/briefing-room/speeches-remarks/2022/04/05/remarks-by-president-biden-vice-president-harris-and-former-president-obama-on-the-affordable-care-act/ |access-date=April 6, 2022 |website=The White House |language=en-US}}</ref><ref>{{Cite web |last=Benson |first=Samuel |title=Obama returns to White House for first time since leaving office |url=https://www.politico.com/news/2022/04/05/obama-returns-white-house-00023148 |access-date=April 6, 2022 |website=POLITICO |language=en}}</ref><ref>{{Cite web |date=April 5, 2022 |title=Obama's back — for a day — in White House health bill push |url=https://apnews.com/article/biden-health-business-donald-trump-john-mccain-2cbb6353329fcb541b4c8399a5981cf5 |access-date=April 6, 2022 |website=AP NEWS |language=en}}</ref>
+
+In 2022, he narrated the Netflix documentary series ''[[Our Great National Parks]]''.<ref>{{Cite news |title=5 lessons from Obama's national parks show on Netflix |language=en-US |newspaper=Washington Post |url=https://www.washingtonpost.com/travel/2022/04/13/obama-national-parks-show-netflix/ |access-date=May 26, 2022 |issn=0190-8286}}</ref>
+
+In June of 2022, it was announced that the Obamas and their podcast production company, [[Higher Ground Productions|Higher Ground]], signed a multi-year deal with [[Audible (service)|Audible]]. The move followed Higher Ground's exit from [[Spotify]], where the company previously had a multi-year deal to create podcasts exclusively for the platform.<ref>{{Cite web |title=Barack and Michelle Obama sign with Amazon after Spotify declines to renew audio deal |url=https://fortune.com/2022/06/21/barack-michelle-obama-amazon-audible-audio-deal-spotify/ |access-date=2022-06-22 |website=Fortune |language=en}}</ref><ref>{{Cite web |last1=Chan |first1=J. Clara |date=2022-06-21 |title=The Obamas' Higher Ground Leaves Spotify for Audible Multiyear Deal |url=https://www.hollywoodreporter.com/business/digital/obama-higher-ground-audible-1235169084/ |access-date=2022-06-22 |website=The Hollywood Reporter |language=en-US}}</ref>
+
+==Legacy==
+
+[[File:Job Growth by U.S. President - v1.png|thumb|upright=1.7|Job growth during the presidency of Obama compared to other presidents, as measured as a cumulative percentage change from month after inauguration to end of his term]]
+
+Obama's most significant accomplishment is generally considered to be the [[Affordable Care Act]] (ACA), provisions of which went into effect from 2010 to 2020. Many attempts by Senate Republicans to repeal the ACA, including a "skinny repeal", have thus far failed.<ref name="legacy">{{cite news|url=https://abcnews.go.com/Politics/video/obama-legacy-recovery-recession-affordable-care-act-44927003 |title=Obama Legacy Will Be Recovery from Recession, Affordable Care Act|date=January 20, 2017|work=ABC News|access-date=March 15, 2017}}</ref> However, in 2017, the penalty for violating the individual mandate was repealed effective 2019.<ref name="auto">{{Cite report |title=The Effect of Eliminating the Individual Mandate Penalty and the Role of Behavioral Factors|year=2018|work=[[Commonwealth Fund]]|doi=10.26099/SWQZ-5G92 |doi-access=free |last1=Eibner|first1=Christine|last2=Nowak|first2=Sarah}}</ref> Together with the [[Health Care and Education Reconciliation Act]] amendment, it represents the [[Health care in the United States|U.S. healthcare system]]'s most significant regulatory overhaul and expansion of coverage since the passage of [[Medicare (United States)|Medicare]] and [[Medicaid]] in 1965.<ref name="Oberlander2010">{{cite journal|last1=Oberlander|first1=Jonathan|title=Long Time Coming: Why Health Reform Finally Passed|journal=Health Affairs|date=June 1, 2010|volume=29|issue=6|pages=1112–1116|doi=10.1377/hlthaff.2010.0447|pmid=20530339|issn=0278-2715|doi-access=free}}</ref><ref name="Blumenthal2015">{{cite journal |last1=Blumenthal|first1=David|last2=Abrams|first2=Melinda|last3=Nuzum|first3=Rachel|s2cid=28486139|title=The Affordable Care Act at 5 Years |journal=New England Journal of Medicine |date=June 18, 2015 | volume=372 |issue=25 |pages=2451–2458|doi=10.1056/NEJMhpr1503614|pmid=25946142| issn=0028-4793}}</ref><ref name="CohenEtAl">{{cite book|last1=Cohen|first1=Alan B.|last2=Colby|first2=David C.|last3=Wailoo|first3=Keith A.|last4=Zelizer|first4=Julian E. | title=Medicare and Medicaid at 50: America's Entitlement Programs in the Age of Affordable Care|date=June 1, 2015|publisher=Oxford University Press|isbn=978-0-19-023156-9|url=https://books.google.com/books?id=H9DGBwAAQBAJ }}</ref><ref name="NYTsigning">{{cite news|last1=Stolberg|first1=Sheryl Gay|last2=Pear|first2=Robert | title=Obama Signs Health Care Overhaul into Law|url=https://www.nytimes.com/2010/03/24/health/policy/24health.html| work=The New York Times|date=March 23, 2010}}</ref>
+
+Many commentators credit Obama with averting a threatened [[Depression (economics)|depression]] and pulling the economy back from the [[Great Recession]].<ref name="legacy" /> According to the [[U.S. Bureau of Labor Statistics]], the [[Obama administration]] created 11.3&nbsp;million jobs from the month after [[first inauguration of Barack Obama|his first inauguration]] to the end of his term.<ref>{{cite news|last1=Long|first1=Heather|title=Final tally: Obama created 11.3 million jobs|url=https://money.cnn.com/2017/01/06/news/economy/obama-over-11-million-jobs/ |work=CNN|date=January 6, 2017}}</ref> In 2010, Obama signed into effect the [[Dodd–Frank Wall Street Reform and Consumer Protection Act]]. Passed as a response to the [[financial crisis of 2007–08]], it brought the most significant changes to [[financial regulation]] in the United States since the regulatory reform that followed the [[Great Depression]] under Democratic President [[Franklin D. Roosevelt]].<ref>{{cite news|url=https://www.cbsnews.com/pictures/barack-obama-legacy/12/ |title=Barack Obama's Legacy: Dodd-Frank Wall Street reform|work=CBS News|access-date=March 15, 2017}}</ref>
+
+In 2009, Obama signed into law the [[National Defense Authorization Act for Fiscal Year 2010]], which contained in it the [[Matthew Shepard and James Byrd Jr. Hate Crimes Prevention Act]], the first addition to existing federal hate crime law in the United States since Democratic President [[Bill Clinton]] signed into law the Church Arson Prevention Act of 1996. The Matthew Shepard and James Byrd Jr. Hate Crimes Prevention Act expanded [[Hate crime laws in the United States|existing federal hate crime laws in the United States]] to apply to crimes motivated by a victim's actual or perceived gender, sexual orientation, gender identity, or disability, and dropped the prerequisite that the victim be engaged in a federally protected activity.{{citation needed|date=December 2021}}
+
+As president, Obama advanced LGBT rights.<ref>{{cite news |last=Crary |first=David |date=January 4, 2017 |url=https://apnews.com/b94c8697ab2148199ca3d1b6137a9c20/lgbt-activists-view-obama-staunch-champion-their-cause |title=LGBT activists view Obama as staunch champion of their cause |work=[[Associated Press]] }}</ref> In 2010, he signed the [[Don't Ask, Don't Tell Repeal Act of 2010|Don't Ask, Don't Tell Repeal Act]], which brought an end to "[[don't ask, don't tell]]" policy in the U.S. armed forces that banned open service from [[Lesbian, gay and bisexual|LGB]] people; the law went into effect the following year.<ref>{{cite news |last=Bumiller |first=Elisabeth |date=July 22, 2011 |url=https://www.nytimes.com/2011/07/23/us/23military.html |archive-url=https://web.archive.org/web/20110723235727/http://www.nytimes.com/2011/07/23/us/23military.html |archive-date=July 23, 2011 |url-access=subscription |url-status=live |title=Obama Ends 'Don't Ask, Don't Tell' Policy |newspaper=[[The New York Times]] }}</ref> In 2016, his administration brought an end to the ban on [[transgender]] people serving openly in the U.S. armed forces.<ref>{{cite news|title=Pentagon Says Transgender Troops Can Now Serve Openly|url=https://www.npr.org/sections/thetwo-way/2016/06/30/484192442/pentagon-says-transgender-troops-can-now-serve-openly|date=June 30, 2016|last=Kennedy|first=Kennedy|work=The Two-Way|publisher=[[NPR]]}}</ref><ref name=TransBan1 /> A [[Gallup poll]], taken in the final days of Obama's term, showed that 68 percent of Americans believed the U.S. had made progress on LGBT rights during Obama's eight years in office.<ref>{{cite news |first1=Michael |last1=Smith |first2=Frank |last2=Newport |url=https://news.gallup.com/poll/201683/americans-assess-progress-obama.aspx |title=Americans Assess Progress Under Obama |publisher=The Gallup Organization |date=January 9, 2017 }}</ref>
+
+Obama substantially escalated the use of [[drone strikes]] against suspected militants and terrorists associated with [[al-Qaeda]] and the [[Taliban]].<ref>{{cite news |last=Zenko|first=Micah |date=January 12, 2016 |title= Obama's Embrace of Drone Strikes Will Be a Lasting Legacy|url=https://www.nytimes.com/roomfordebate/2016/01/12/reflecting-on-obamas-presidency/obamas-embrace-of-drone-strikes-will-be-a-lasting-legacy|work=[[The New York Times]] |access-date= March 2, 2019}}</ref><ref>{{cite web|url=https://www.cfr.org/backgrounder/targeted-killings|title=Targeted Killings|publisher=[[Council on Foreign Relations]]}}</ref> In 2016, the last year of his presidency, the U.S. dropped 26,171 bombs on seven different countries.<ref>{{cite news |last=Grandin|first=Greg |date=January 15, 2017 |title= Why Did the US Drop 26,171 Bombs on the World Last Year?|url=https://www.thenation.com/article/archive/why-did-the-us-dropped-26171-bombs-on-the-world-last-year/tnamp/|work=[[The Nation]] |author-link=Greg Grandin|access-date= January 11, 2018}}</ref><ref>{{cite news |last=Agerholm|first=Harriet |date=January 19, 2017 |title=Map shows where President Barack Obama dropped his 20,000 bombs|url=https://www.independent.co.uk/news/world/americas/us-president-barack-obama-bomb-map-drone-wars-strikes-20000-pakistan-middle-east-afghanistan-a7534851.html|work=The Independent |access-date=January 11, 2018}}</ref> Obama left about 8,400 U.S. troops in [[Afghanistan]], 5,262 in Iraq, 503 in Syria, 133 in Pakistan, 106 in Somalia, seven in Yemen, and two in Libya at the end of his presidency.<ref>{{cite news|last1=Parsons|first1=Christi|last2=Hennigan|first2=W. J.|title=President Obama, who hoped to sow peace, instead led the nation in war|url=https://www.latimes.com/projects/la-na-pol-obama-at-war/ |work=Los Angeles Times|date=January 13, 2017}}</ref><ref>{{cite web|url=https://www.dmdc.osd.mil/appj/dwp/dwp_reports.jsp|title=DoD Personnel, Workforce Reports & Publications|website=www.dmdc.osd.mil |access-date=January 16, 2020 }}</ref>
+
+According to [[Pew Research Center]] and [[United States Bureau of Justice Statistics]], from December 31, 2009, to December 31, 2015, inmates sentenced in U.S. federal custody declined by five percent. This is the largest decline in sentenced inmates in U.S. federal custody since Democratic President [[Jimmy Carter]]. By contrast, the federal prison population increased significantly under presidents [[Ronald Reagan]], [[George H. W. Bush]], [[Bill Clinton]], and [[George W. Bush]].<ref>{{cite web|last1=Gramlich|first1=John|title=Federal prison population fell during Obama's term, reversing recent trend|url=https://www.pewresearch.org/fact-tank/2017/01/05/federal-prison-population-fell-during-obamas-term-reversing-recent-trend/ |publisher=Pew Research Center|date=January 5, 2017}}</ref>
+
+According to [[Julian E. Zelizer|Julian Zelizer]]'s ''The Presidency of Barack Obama'', under Obama's presidency, the "Democrats lost more than one thousand seats in state legislatures, governors' mansions, and Congress during his time in office." adding that Obama "turned out to be a very effective policymaker but not a tremendously successful party builder."<ref>{{Cite web|last=Kamarck|first=Elaine|date=April 6, 2018|title=The fragile legacy of Barack Obama|url=https://www.brookings.edu/blog/fixgov/2018/04/06/the-fragile-legacy-of-barack-obama/|url-status=live|access-date=October 30, 2021|website=[[Brookings Institution|Brookings]]|language=en-US|archive-url=https://web.archive.org/web/20180406205333/https://www.brookings.edu/blog/fixgov/2018/04/06/the-fragile-legacy-of-barack-obama/ |archive-date=April 6, 2018 }}</ref>
+
+During Obama's presidency, a record 3.2 million people [[Deportation and removal from the United States|were deported from the United States]].<ref name="nydn_Obama">{{Cite web|author=|date=September 1, 2016|title=Obama deported record number of immigrants, despite Trump's claim|url=http://www.nydailynews.com/news/politics/obama-deported-record-number-immigrants-trump-claim-article-1.2774180|work=[[New York Daily News]]|quote=|access-date=November 15, 2016}}</ref> His record deportations earned Obama the nickname "Deporter in Chief".<ref>{{cite news|last=Golash-Boza|first=Tanya|date=November 1, 2014|title='Deporter in chief' Obama has alienated Latino voters|newspaper=[[Al Jazeera America]]|url=http://america.aljazeera.com/opinions/2014/11/obama-deportationimmigrationreformmidtermelections.html|access-date=November 30, 2020}}</ref> In February 2020, Biden called the deportation of hundreds of thousands of people without criminal records under the Obama administration a "big mistake".<ref>{{Cite web|last=Barrow|first=Bill|date=February 15, 2020|title=For first time, Biden calls Obama deportations 'big mistake'|url=https://abcnews.go.com/Politics/wireStory/time-biden-calls-obama-deportations-big-mistake-69010125|url-status=live|access-date=October 30, 2021|website=ABC News|publisher=Associated Press|language=en|archive-url=https://web.archive.org/web/20200216145238/https://abcnews.go.com/Politics/wireStory/time-biden-calls-obama-deportations-big-mistake-69010125 |archive-date=February 16, 2020 }}</ref>
+
+[[Human Rights Watch]] (HRW) called Obama's human rights record "mixed", adding that "he has often treated human rights as a secondary interest — nice to support when the cost was not too high, but nothing like a top priority he championed."<ref name=":0" />
+
+Obama left office in January 2017 with a 60 percent approval rating.<ref>{{Cite news|url=https://www.upi.com/Top_News/US/2017/01/18/Obama-leaving-office-at-60-approval-rating/4481484744398/ |first=Allen |last=Cone |date=January 18, 2017 |title=Obama leaving office at 60 percent approval rating|work=United Press International|access-date=February 26, 2017}}</ref><ref>{{cite news |url=https://www.cnn.com/2017/01/18/politics/obama-approval-rating-cnn-orc-poll/index.html|title=Obama approval hits 60 percent as end of term approaches|last=Agiesta |date=January 18, 2017 |first=Jennifer |access-date=February 26, 2017|work=CNN}}</ref> A 2018 survey of historians by the [[American Political Science Association]] ranked Obama the [[Historical rankings of presidents of the United States|8th-greatest American president]].<ref name="How Does Trump Stack Up Against the Best—and Worst—Presidents?">{{cite news|last1=Rottinghaus|first1=Brandon|last2=Vaughn|first2=Justin S.|date=February 19, 2018|title=Opinion {{!}} How Does Trump Stack Up Against the Best—and Worst—Presidents?|work=[[The New York Times]]|url=https://www.nytimes.com/interactive/2018/02/19/opinion/how-does-trump-stack-up-against-the-best-and-worst-presidents.html|access-date=February 8, 2021}}</ref> Obama gained 10 spots from the same survey in 2015 from the [[Brookings Institution]] that ranked him the 18th-greatest American president.<ref>{{cite web|url=https://www.brookings.edu/blog/fixgov/2015/02/13/measuring-obama-against-the-great-presidents/|title=Measuring Obama against the great presidents|last1= Rottinghaus|first1=Brandon|last2=Vaughn|first2=Justin S.|date=February 13, 2015|publisher=[[Brookings Institution]]}}</ref>
+
+===Presidential library===
+
+{{Main|Barack Obama Presidential Center}}
+
+The Barack Obama Presidential Center is Obama's planned [[presidential library]]. It will be hosted by the [[University of Chicago]] and located in [[Jackson Park (Chicago)|Jackson Park]] on the [[South Side, Chicago|South Side of Chicago]].<ref>{{cite web|url=https://www.obama.org/about-the-foundation/|title=Obama Foundation FAQs|publisher=Barack Obama Foundation |access-date=January 16, 2020 }}</ref>
+
+==Bibliography==
+{{Main| Bibliography of Barack Obama}}
+{{refbegin}}
+
+===Books===
+* {{Cite book |last=Obama |first=Barack |date=July 18, 1995 |title=[[Dreams from My Father]] |edition=1st |location=New York |publisher=[[Times Books]] |isbn=0-8129-2343-X}}
+* {{Cite book |last=Obama |first=Barack |author-mask=7 |date=October 17, 2006 |title=[[The Audacity of Hope]] |edition=1st |location=New York |publisher=[[Crown Publishing Group]] |isbn=978-0-307-23769-9}}
+* {{Cite book |last=Obama |first=Barack |author-mask=7 |date=November 16, 2010 |title=[[Of Thee I Sing (book)|Of Thee I Sing]] |edition=1st |location=New York |publisher=[[Knopf Books for Young Readers|Alfred A. Knopf]] |isbn=978-0-375-83527-8}}
+* {{Cite book |last=Obama |first=Barack |author-mask=7 |date=November 17, 2020 |title=[[A Promised Land]] |edition=1st |location=New York |publisher=[[Crown Publishing Group]] |isbn=978-1-5247-6316-9}}<ref>{{Cite web|title=Former President Barack Obama's third book starts shipping today|url=https://www.nbcnews.com/shopping/books/barack-obama-book-promised-land-n1246845|access-date=September 22, 2021|website=NBC News|language=en}}</ref>
+
+===Audiobooks===
+* 2006: ''The Audacity of Hope: Thoughts on Reclaiming the American Dream'' (read by the author), [[Random House Audio]], {{ISBN|978-0-7393-6641-7}}
+* 2020: ''A Promised Land'' (read by the author)
+
+===Articles===
+* {{Cite journal|last=Obama|first=Barack|date=1988|title=Why organize? Problems in the inner city|url=https://www.lib.niu.edu/1988/ii880840.html|journal=Illinois Issues|volume=XIV|issue=8 & 9|pages=40–42|issn=0738-9663}}
+* {{Cite journal|last=Obama|first=Barack|author-mask=7|date=1990|title=Tort Law. Prenatal Injuries. Supreme Court of Illinois Refuses to Recognize Cause of Action Brought by Fetus Against Its Mother for Unintentional Infliction of Prenatal Injuries. ''Stallman v. Youngquist'', 125 Ill. 2d 267, 531 N. E.2d 355 (1988)|journal=[[Harvard Law Review]]|volume=103|issue=3|pages=823–828|jstor=1341352|doi=10.2307/1341352}} Uncredited case comment.<ref>{{Cite news|last1=Ressner|first1=Jeffrey|last2=Smith|first2=Ben|date=August 22, 2008|title=Exclusive: Obama's Lost Law Review Article |url=https://www.politico.com/story/2008/08/exclusive-obamas-lost-law-review-article-012705|url-status=live|archive-url=https://web.archive.org/web/20210208150320/https://www.politico.com/story/2008/08/exclusive-obamas-lost-law-review-article-012705|archive-date=February 8, 2021|access-date=February 20, 2021|work=[[Politico]]}}</ref>
+* {{Cite journal|last=Obama|first=Barack|author-mask=7|date=2005|title=Bound to the Word|url=https://americanlibrariesmagazine.org/bound-to-the-word/|journal=[[American Libraries]]|volume=36|issue=7|pages=48–52|jstor=25649652}}
+*{{Cite journal|last1=Obama|first1=Barack|author-mask=7|date=May 25, 2006|title=Making Patient Safety the Centerpiece of Medical Liability Reform|journal=[[The New England Journal of Medicine]]|volume=354|issue=21|pages=2205–2208|doi=10.1056/NEJMp068100|last2=Clinton|first2=Hillary|pmid=16723612|author-link2=Hillary Clinton}}
+* {{Cite journal|last=Obama|first=Barack|author-mask=7|date=2007|title=Renewing American Leadership|url=https://www.foreignaffairs.com/articles/2007-07-01/renewing-american-leadership|journal=[[Foreign Affairs]]|volume=86|pages=2–16|jstor=20032411|issue=4}}
+* {{Cite journal|last=Obama|first=Barack|author-mask=7|date=2008|title=A More Perfect Union|url=https://www.tandfonline.com/doi/abs/10.1080/00064246.2008.11413431|journal=[[The Black Scholar]]|volume=38|pages=17–23|doi=10.1080/00064246.2008.11413431|jstor=41069296|issue=1|s2cid=219318643}}
+* {{Cite journal|last=Obama|first=Barack|author-mask=7|date=2009|title=What Science Can Do|url=https://issues.org/obama/|journal=[[Issues in Science and Technology]]|volume=25|pages=23–30|jstor=43314908|issue=4}}
+* {{Cite journal|last=Obama|first=Barack|author-mask=7|date=2009|title=A New Beginning|journal=Zeitschrift für Staats- und Europawissenschaften (ZSE)|volume=7|pages=173–186|jstor=26165626|issue=2|doi=10.5771/1610-7780-2009-2-173}}
+* {{Cite magazine|last=Obama|first=Barack|author-mask=7|date=January 8, 2016|title=Our Shared Responsibility|url=https://www.nytimes.com/2016/01/08/opinion/president-barack-obama-guns-are-our-shared-responsibility.html|magazine=[[The New York Times]]|page=23 (Section A)}}
+* {{Cite journal|last=Obama|first=Barack|author-mask=7|date=August 2, 2016|title=United States Health Care Reform: Progress to Date and Next Steps |journal=[[Journal of the American Medical Association]]|volume=130|issue=5|pages=811–866|doi=10.1001/jama.2016.9797 |doi-access=free |pmid=27400401|pmc=5069435}}
+* {{Cite journal|last=Obama|first=Barack|author-mask=7|date=January 5, 2017|title=The President's Role in Advancing Criminal Justice Reform|url=https://harvardlawreview.org/wp-content/uploads/2017/01/811-866-Online-Rev-vf.pdf|journal=[[Harvard Law Review]]|volume=130|issue=3|pages=811–866|jstor=44865604}}
+* {{Cite journal|last=Obama|first=Barack|author-mask=7|date=January 13, 2017|title=The Irreversible Momentum of Clean Energy|journal=[[Science (journal)|Science]]|volume=355|issue=6321|pages=126–129|doi=10.1126/science.aam6284|pmid=28069665|bibcode=2017Sci...355..126O|s2cid=30991274|doi-access=free}}
+* {{Cite journal|last=Obama|first=Barack|author-mask=7|date=May 2017|title=Repealing the ACA Without a Replacement—the Risks to American Health Care|journal=[[Obstetrical & Gynecological Survey]]|volume=72|issue=5|pages=263–264|doi=10.1097/OGX.0000000000000447|s2cid=80088566|url=https://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1493&context=publichealthresources}}
+{{refend}}
+
+==See also==
+
+{{Portal|Biography|United States|Chicago|Illinois|Hawaii|Politics|Law}}
+
+===Politics===
+* [[DREAM Act]]
+* [[Fraud Enforcement and Recovery Act of 2009]]
+* [[Immigration Reform and Control Act of 1986]]
+* [[IRS targeting controversy]]
+* [[Middle Class Tax Relief and Job Creation Act of 2012]]
+* [[National Broadband Plan (United States)]]
+* [[Office of Energy Efficiency and Renewable Energy]]
+* [[Social policy of the Barack Obama administration]]
+* [[SPEECH Act]]
+* [[Stay with It]]
+* [[White House Office of Energy and Climate Change Policy]]
+
+===Other===
+* [[Roberts Court]]
+* [[Speeches of Barack Obama]]
+
+===Lists===
+* [[Assassination threats against Barack Obama]]
+* [[List of African-American United States senators]]
+* [[List of Barack Obama 2008 presidential campaign endorsements]]
+* [[List of Barack Obama 2012 presidential campaign endorsements]]
+* [[List of federal political scandals in the United States#Barack Obama administrations (2009–2017)|List of federal political scandals, 2009–17]]
+* [[List of people granted executive clemency by Barack Obama]]
+* [[List of things named after Barack Obama]]
+
+==References==
+
+<references>
+<ref name="birth-certificate">{{cite web |date = April 27, 2011 |title = Certificate of Live Birth: Barack Hussein Obama II, August 4, 1961, 7:24 pm, Honolulu |url=https://obamawhitehouse.archives.gov/sites/default/files/rss_viewer/birth-certificate-long-form.pdf |access-date = March 11, 2017 |archive-url=https://web.archive.org/web/20170303062746/https://obamawhitehouse.archives.gov/sites/default/files/rss_viewer/birth-certificate-long-form.pdf |via = [[NARA|National Archives]] |work = [[whitehouse.gov]] |archive-date = March 3, 2017 }}</ref>
+<ref name="Christian">{{cite web |year=2009 |title=American President: Barack Obama |publisher=Miller Center of Public Affairs, University of Virginia |url=http://millercenter.org/academic/americanpresident/obama |access-date=January 23, 2009 |quote=Religion: Christian |archive-url=https://web.archive.org/web/20090123091100/http://millercenter.org/academic/americanpresident/obama |archive-date=January 23, 2009 |url-status=dead }}
+* {{cite web |title=The Truth about Barack's Faith |publisher=Obama for America |url=http://www.fightthesmears.com/file_download/2/baracksfaith.pdf |access-date=July 1, 2012 |archive-date=January 5, 2011 |archive-url=https://web.archive.org/web/20110105040018/http://www.fightthesmears.com/file_download/2/baracksfaith.pdf }}
+* {{cite news |last=Miller |first=Lisa |date=July 18, 2008 |title=Finding his faith |work=Newsweek |url=http://www.newsweek.com/id/145971 |access-date=February 4, 2010 |quote=He is now a Christian, having been baptized in the early 1990s at Trinity United Church of Christ in Chicago. |archive-url=https://web.archive.org/web/20100206163704/http://www.newsweek.com/id/145971 |archive-date=February 6, 2010 |url-status=live }}
+* {{cite news |last=Barakat |first=Matthew |agency=Associated Press |date=November 17, 2008 |title=Obama's church choice likely to be scrutinized; D.C. churches have started extending invitations to Obama and his family |work=NBC News |url=https://www.nbcnews.com/id/27775757 |access-date=January 20, 2009 |quote=The United Church of Christ, the denomination from which Obama resigned when he left Wright's church, issued a written invitation to join a UCC denomination in Washington and resume his connections to the church. }}
+* {{cite web |date=January 20, 2009 |title=Barack Obama, long time UCC member, inaugurated forty-fourth U.S. President |publisher=United Church of Christ |url=http://www.ucc.org/news/obama-inauguration.html |access-date=January 21, 2009 |quote=Barack Obama, who spent more than 20 years as a UCC member, is the forty-fourth President of the United States. |archive-url=https://web.archive.org/web/20090125002304/http://www.ucc.org/news/obama-inauguration.html |archive-date=January 25, 2009 |url-status=live }}
+* {{cite news |last=Sullivan |first=Amy |date=June 29, 2009 |title=The Obama's find a church home—away from home |magazine=Time |url=http://www.time.com/time/nation/article/0,8599,1907610,00.html |access-date=February 5, 2010 |quote=instead of joining a congregation in Washington, D.C., he will follow in George W. Bush's footsteps and make his primary place of worship Evergreen Chapel, the nondenominational church at Camp David. |archive-date=April 4, 2010 |archive-url=https://web.archive.org/web/20100404153523/http://www.time.com/time/nation/article/0,8599,1907610,00.html |url-status=dead }}
+* {{cite news |last=Kornblut |first=Anne E. |date=February 4, 2010 |title=Obama's spirituality is largely private, but it's influential, advisers say |newspaper=The Washington Post |page=A6 |url=https://www.washingtonpost.com/wp-dyn/content/article/2010/02/03/AR2010020303619.html |access-date=February 5, 2010 |quote=Obama prays privately{{nbs}}... And when he takes his family to Camp David on the weekends, a Navy chaplain ministers to them, with the daughters attending a form of Sunday school there. }}</ref>
+<ref name="Occidental">{{cite news|last=Gordon |first=Larry |date=January 29, 2007 |title=Occidental recalls 'Barry' Obama |newspaper=Los Angeles Times |page=B1 |url=https://articles.latimes.com/2007/jan/29/local/me-oxy29 |access-date=May 12, 2010 |archive-url=https://web.archive.org/web/20100524102944/http://articles.latimes.com/2007/jan/29/local/me-oxy29 |archive-date=May 24, 2010 }}
+* {{cite news|last=Possley |first=Maurice |date=March 30, 2007 |title=Activism blossomed in college |newspaper=Chicago Tribune |page=20 |url=https://www.chicagotribune.com/news/nationworld/chi-0703291042mar30-archive,0,1533921.story |access-date=May 12, 2010 |archive-url=https://web.archive.org/web/20101009204342/http://www.chicagotribune.com/news/nationworld/chi-0703291042mar30-archive%2C0%2C1533921.story |archive-date=October 9, 2010 |url-status=live }}
+* {{cite news|last=Kovaleski |first=Serge F. |date=February 9, 2008 |title=Old friends say drugs played bit part in Obama's young life |newspaper=The New York Times |page=A1 |url=https://www.nytimes.com/2008/02/09/us/politics/09obama.html |archive-url=https://web.archive.org/web/20080211095352/http://www.nytimes.com/2008/02/09/us/politics/09obama.html |archive-date=February 11, 2008 |url-access=subscription |url-status=live |access-date=May 12, 2010 }}
+* {{cite news|last=Rohter |first=Larry |date=April 10, 2008 |title=Obama says real-life experience trumps rivals' foreign policy credits |newspaper=The New York Times |page=A18 |url=https://www.nytimes.com/2008/04/10/us/politics/10obama.html |archive-url=https://web.archive.org/web/20080411041927/http://www.nytimes.com/2008/04/10/us/politics/10obama.html |archive-date=April 11, 2008 |url-access=subscription |url-status=live |access-date=May 12, 2010 }}
+* {{cite news|author= Goldman, Adam |first2=Robert |last2=Tanner |agency=Associated Press |date=May 15, 2008 |title=Old friends recall Obama's years in LA, NYC |work=USA Today |url=https://www.usatoday.com/news/politics/2008-05-15-3144401415_x.htm |access-date=May 12, 2010 }}
+* {{cite news|last=Helman |first=Scott |date=August 25, 2008 |title=Small college awakened future senator to service (subscription archive) |newspaper=The Boston Globe |page=1A |url=https://www.boston.com/news/politics/2008/articles/2008/08/25/small_college_awakened_future_senator_to_service/?page=full |access-date=May 12, 2010 }}
+* {{cite news|last=Jackson |first=Brooks |date=June 5, 2009 |title=More 'birther' nonsense: Obama's 1981 Pakistan trip |publisher=FactCheck.org |url=http://www.factcheck.org/2009/06/more-birther-nonsense-obamas-1981-pakistan-trip |access-date=May 12, 2010 }}
+* {{cite book |last = Remnick |first = David |year = 2010 |title = The Bridge: The Life and Rise of Barack Obama |place = New York |publisher = Alfred A. Knopf |pages = [https://archive.org/details/bridgelifeand00remn/page/98 98–112] |isbn = 978-1-4000-4360-6 |title-link = The Bridge: The Life and Rise of Barack Obama }}
+* Obama (1995, 2004), pp. 92–112.
+* Mendell (2007), pp. 55–62.</ref>
+<ref name="Juris Doctor">{{cite web |url=https://news.harvard.edu/gazette/story/2008/11/obama-joins-list-of-seven-presidents-with-harvard-degrees/ |title=Obama joins list of seven presidents with Harvard degrees |date=November 6, 2008 |website=news.harvard.edu |access-date=October 23, 2017}} {{cite news |last = Adams |first = Richard |date = May 9, 2007 |title = Barack Obama |newspaper = The Guardian |place = London |url=https://www.theguardian.com/world/2007/may/09/barackobama.uselections20081 |access-date = October 26, 2008 |archive-url=https://web.archive.org/web/20081013083027/http://www.guardian.co.uk/world/2007/may/09/barackobama.uselections20081 |archive-date = October 13, 2008 |url-status=live }}</ref>
+<ref name="Fellow">{{cite magazine |last = Merriner |first = James L. |date = June 2008 |title = The friends of O |magazine = Chicago |volume = 57 |issue = 6 |pages = 74–79, 97–99 |issn = 0362-4595 |url = http://www.chicagomag.com/Chicago-Magazine/June-2008/Obamas-Chicago-Posse/The-Friends-of-O/index.php?cp=2&si=1 |access-date = January 30, 2010 }}
+* {{cite news |last = Zengerle |first = Jason |date = July 30, 2008 |title = Con law; What the University of Chicago right thinks of Obama |magazine = The New Republic |volume = 239 |issue = 1 |pages = 7–8 |url = http://www.tnr.com/article/con-law?id=86dd0277-c6ee-4e3c-83e9-0bb468c5c40d&p=1 |access-date = January 30, 2010 }}
+* {{cite news |last = Kantor |first = Jodi |date = July 30, 2008 |title = Teaching law, testing ideas, Obama stood slightly apart |newspaper = The New York Times |page = A1 |url = https://www.nytimes.com/2008/07/30/us/politics/30law.html |access-date = January 30, 2010 }}
+* {{cite news |last = Gray |first = Steven |date = September 10, 2008 |title = Taking professor Obama's class |magazine = Time |url = http://www.time.com/time/politics/article/0,8599,1835238-2,00.html |access-date = January 30, 2010 |archive-date = May 12, 2009 |archive-url = https://web.archive.org/web/20090512195322/http://www.time.com/time/politics/article/0,8599,1835238-2,00.html |url-status = dead }}
+* {{cite news |last = Starr |first = Alexandra |date = September 21, 2008 |title = Case study |magazine = The New York Times Magazine |page = 76 |url = https://www.nytimes.com/2008/09/21/magazine/21obama-t.html |access-date = January 30, 2010 }}
+* {{cite news |last = Hundley |first = Tom |date = March 22, 2009 |title = Ivory tower of power |magazine = Chicago Tribune Magazine |page = 6 |url = http://articles.chicagotribune.com/2009-03-22/features/0903200725_1_barack-obama-story-chicago-school-harvard-law |access-date = January 30, 2010 }}</ref>
+<ref name="Forty">{{cite book |editor = White, Jesse |year = 2000 |title = Illinois Blue Book, 2000, Millennium ed |page = 83 |place = Springfield, IL |publisher = Illinois Secretary of State |url=http://www.sos.state.il.us/bb/toc.html |archive-date = April 16, 2004 |archive-url=https://web.archive.org/web/20040416120057/http://www.sos.state.il.us/bb/sec4_71_132.pdf |oclc = 43923973 |access-date = June 6, 2008 }}
+* {{cite news |last = Jarrett |first = Vernon |date = August 11, 1992 |title = 'Project Vote' brings power to the people |work = Chicago Sun-Times |page = 23 |format = paid archive |url=http://nl.newsbank.com/nl-search/we/Archives?p_product=CSTB&p_theme=cstb&p_action=search&p_maxdocs=200&s_dispstring=(Vernon%20Jarrett)%20AND%20date(8/11/1992%20to%208/11/1992)&p_field_date-0=YMD_date&p_params_date-0=date:B,E&p_text_date-0=8/11/1992%20to%208/11/1992)&p_field_advanced-0=&p_text_advanced-0=(Vernon%20Jarrett)Êl_numdocs=20&p_perpage=10&p_sort=YMD_date:DÊl_useweights=no |access-date = June 6, 2008 }}
+* {{cite news |last = Reynolds |first = Gretchen |date = January 1993 |title = Vote of confidence |work = Chicago Magazine |volume = 42 |issue = 1 |pages = 53–54 |issn = 0362-4595 |url=http://www.chicagomag.com/Chicago-Magazine/January-1993/Vote-of-Confidence |access-date = June 6, 2008 |archive-url=https://web.archive.org/web/20080514183643/http://www.chicagomag.com/Chicago-Magazine/January-1993/Vote-of-Confidence |archive-date = May 14, 2008 |url-status=live }}
+* {{cite news |last = Anderson |first = Veronica |date = October 3, 1993 |title = 40 under Forty: Barack Obama, Director, Illinois Project Vote |newspaper = Crain's Chicago Business |volume = 16 |issue = 39 |page = 43 |issn = 0149-6956 }}</ref>
+<ref name="DavisMiner">{{cite news |last=Robinson |first=Mike |agency=Associated Press |date=February 20, 2007 |title=Obama got start in civil rights practice |newspaper=The Boston Globe |url=https://www.boston.com/news/education/higher/articles/2007/02/20/obama_got_start_in_civil_rights_practice |access-date=June 15, 2008 }}
+* {{cite news |last=Pallasch |first=Abdon M. |date=December 17, 2007 |title=As lawyer, Obama was strong, silent type; He was 'smart, innovative, relentless,' and he mostly let other lawyers do the talking |newspaper=Chicago Sun-Times |page=4 |url=http://nl.newsbank.com/nl-search/we/Archives?p_product=CSTB&p_theme=cstb&p_action=search&p_maxdocs=200&s_dispstring=(Pallasch)_AND_date(12/17/2007_to_12/17/2007)&p_field_date-0=YMD_date&p_params_date-0=date:B,E&p_text_date-0=December_17,_2007_to_12/17/2007)&p_field_advanced-0=&p_text_advanced-0=(Pallasch)Êl_numdocs=20&p_perpage=10&p_sort=YMD_date:DÊl_useweights=no |access-date=June 15, 2008 }}{{subscription required}}
+* {{cite news |last=Morain |first=Dan |date=April 6, 2008 |title=Obama's law days effective but brief |newspaper=Los Angeles Times |page=A14 |url=https://articles.latimes.com/2008/apr/06/nation/na-obamalegal6 |access-date=February 14, 2010 }}
+* {{cite news |date=June 27, 1993 |title=Document |newspaper=Chicago Tribune |page=9 (Business) |url=https://pqasb.pqarchiver.com/chicagotribune/access/24302659.html?dids=24302659:24302659&FMT=ABS&FMTS=ABS:FT |access-date=June 15, 2008 |archive-url=https://web.archive.org/web/20131204190346/https://pqasb.pqarchiver.com/chicagotribune/doc/283584889.html?FMT=ABS&FMTS=ABS%3AFT&type=current&date=&author=&pub=&edition=&startpage=&desc= |archive-date=December 4, 2013 |url-status=dead }}{{subscription required}}
+* {{cite news |date=July 5, 1993 |title=Business appointments |newspaper=Chicago-Sun-Times |page=40 |url=http://nl.newsbank.com/nl-search/we/Archives?p_product=CSTB&p_theme=cstb&p_action=search&p_maxdocs=200&s_dispstring=(Business%20appointments)%20AND%20date(7/5/1993%20to%207/5/1993)&p_field_date-0=YMD_date&p_params_date-0=date:B,E&p_text_date-0=7/5/1993%20to%207/5/1993)&p_field_advanced-0=&p_text_advanced-0=(Business%20appointments)Êl_numdocs=20&p_perpage=10&p_sort=YMD_date:DÊl_useweights=no |access-date=June 15, 2008 }}{{subscription required}}
+* {{cite news |last=Ripley |first=Amanda |date=November 3, 2004 |title=Obama's ascent |magazine=Time |url=http://www.time.com/time/magazine/article/0,9171,750742,00.html |access-date=February 13, 2010 |archive-date=August 11, 2010 |archive-url=https://web.archive.org/web/20100811203732/http://www.time.com/time/magazine/article/0,9171,750742,00.html |url-status=dead }}
+* {{cite web |year=2008 |title=About us |url=http://www.lawmbg.com/index.cfm/PageID/2711 |publisher=Miner, Barnhill & Galland—Chicago, Illinois |access-date=June 15, 2008 |archive-url=https://web.archive.org/web/20080720182856/http://www.lawmbg.com/index.cfm/PageID/2711 |archive-date=July 20, 2008 |url-status=dead }}
+* {{cite news |last=Reardon |first=Patrick T. |date=June 25, 2008 |title=Obama's Chicago |newspaper=Chicago Tribune |page=1 (Tempo) |url=https://www.chicagotribune.com/travel/chi-obama-chicago-htmlstory,0,506256.htmlstory |access-date=February 13, 2010 }}
+* Obama (1995, 2004), pp. 438–439.
+* Mendell (2007), pp. 104–106.</ref>
+<ref name="Democratic primary">{{cite web|url=http://www.fec.gov/pubrec/fe2000/ilh.htm |title=Federal Elections 2000: U.S. House Results—Illinois |publisher=[[Federal Election Commission]] |access-date=April 24, 2008 |archive-url=https://web.archive.org/web/20080328011936/http://www.fec.gov/pubrec/fe2000/ilh.htm |archive-date=March 28, 2008 |url-status=live }}
+* {{cite news|url=https://www.npr.org/templates/story/story.php?storyId=14502364 |title=Obama's Loss May Have Aided White House Bid |last=Gonyea |first=Dan |date=September 19, 2007 |publisher=NPR |archive-url=https://web.archive.org/web/20110218211819/http://www.npr.org/templates/story/story.php?storyId=14502364 |archive-date=February 18, 2011 }}
+* {{cite news|first=Janny |last=Scott |title=A Streetwise Veteran Schooled Young Obama |date=September 9, 2007 |url=https://www.nytimes.com/2007/09/09/us/politics/09obama.html |work=The New York Times |access-date=April 20, 2008 |archive-url=https://web.archive.org/web/20080321122541/http://www.nytimes.com/2007/09/09/us/politics/09obama.html |archive-date=March 21, 2008 |url-status=live }}
+* {{cite news|first=Edward |last=McClelland |title=How Obama Learned to Be a Natural |date=February 12, 2007 |url=http://www.salon.com/news/feature/2007/02/12/obama_natural/ |work=Salon |access-date=April 20, 2008 |archive-url=https://web.archive.org/web/20080308133402/http://www.salon.com/news/feature/2007/02/12/obama_natural/ |archive-date=March 8, 2008 |url-status=live }}
+* {{cite news|first1=Richard |last1=Wolffe |last2=Briscoe |first2=Daren |title=Across the Divide |date=July 16, 2007 |work=Newsweek |url=http://www.newsweek.com/id/33156 |access-date=April 20, 2008 |archive-url=https://web.archive.org/web/20080418014600/http://www.newsweek.com/id/33156 |archive-date=April 18, 2008 |url-status=live }}
+* {{cite news|first=Scott |last=Helman |title=Early Defeat Launched a Rapid Political Climb |date=October 12, 2007 |url=https://www.boston.com/news/nation/articles/2007/10/12/early_defeat_launched_a_rapid_political_climb/ |work=The Boston Globe |access-date=April 20, 2008 }}
+* {{cite news|url=https://www.usatoday.com/news/politics/2007-10-24-3157940059_x.htm |title=Obama learned from failed Congress run |work=USA Today |last=Wills |first=Christopher |date=October 24, 2007 |access-date=November 15, 2010 }}</ref>
+<ref name="Rose Garden">{{cite web |author = Office of the Press Secretary |date = October 2, 2002 |title = President, House leadership agree on Iraq resolution |url=https://georgewbush-whitehouse.archives.gov/news/releases/2002/10/20021002-7.html |via = [[NARA|National Archives]] |work = [[whitehouse.gov]] |access-date = February 18, 2008 }}
+* {{cite news |last = Tackett |first = Michael |date = October 3, 2002 |title = Bush, House OK Iraq deal; Congress marches with Bush |newspaper = Chicago Tribune |page = 1 |url=https://pqasb.pqarchiver.com/chicagotribune/access/203569641.html?dids=203569641:203569641&FMT=ABS&FMTS=ABS:FT |access-date = February 3, 2008 }}{{subscription required}}</ref>
+<ref name="Federal Plaza">{{cite news |last = Glauber |first = Bill |date = October 3, 2003 |title = War protesters gentler, but passion still burns |newspaper = Chicago Tribune |page = 1 |url = https://pqasb.pqarchiver.com/chicagotribune/access/203569621.html?dids=203569621:203569621&FMT=ABS&FMTS=ABS:FT |access-date = February 3, 2008 |archive-date = June 17, 2008 |archive-url = https://web.archive.org/web/20080617150444/http://pqasb.pqarchiver.com/chicagotribune/access/203569621.html?dids=203569621:203569621&FMT=ABS&FMTS=ABS:FT |url-status = dead }}{{subscription required}}
+* {{cite news |last = Strausberg |first = Chinta |date = October 3, 2002 |title = War with Iraq undermines U.N |newspaper = Chicago Defender |page = 1 |url = http://www.highbeam.com/doc/1P3-220379051.html |quote = Photo caption: Left Photo: Sen. Barack Obama along with Rev. Jesse Jackson spoke to nearly 3,000 anti-war protestors (below) during a rally at Federal Plaza Wednesday. |access-date = October 28, 2008 |archive-url = https://web.archive.org/web/20091014211715/http://www.highbeam.com/doc/1P3-220379051.html |archive-date = October 14, 2009 |url-status = dead }}
+* {{cite web |last = Katz |first = Marilyn |date = October 2, 2007 |title = Five years since our first action |publisher = Chicagoans Against War & Injustice |url = http://www.noiraqwar-chicago.org/?p=127 |access-date = February 18, 2008 |archive-url = https://web.archive.org/web/20110721192331/http://www.noiraqwar-chicago.org/?p=127 |archive-date = July 21, 2011 }}
+* {{cite news |last1 = Bryant |first1 = Greg |last2 = Vaughn |first2 = Jane B. |date = October 3, 2002 |title = 300 attend rally against Iraq war |newspaper = Daily Herald |page = 8 |url = http://nl.newsbank.com/nl-search/we/Archives?p_product=ADHB&p_theme=adhb&p_action=search&p_maxdocs=200&p_text_search-0=300%20AND%20attend%20AND%20rally%20AND%20against%20AND%20Iraq%20AND%20war&s_dispstring=300%20attend%20rally%20against%20Iraq%20war%20AND%20date(10/3/2002%20to%2010/3/2002)&p_field_date-0=YMD_date&p_params_date-0=date:B,E&p_text_date-0=10/3/2002%20to%2010/3/2002)Êl_numdocs=20&p_perpage=10&p_sort=YMD_date:DÊl_useweights=no |access-date = October 28, 2008 }}{{subscription required}}
+* Mendell (2007), pp. 172–177.</ref>
+<ref name="spoke out">{{cite web |last = Obama |first = Barack |date = October 2, 2002 |title = Remarks of Illinois State Sen. Barack Obama against going to war with Iraq |url = http://www.barackobama.com/2002/10/02/remarks_of_illinois_state_sen.php |archive-url = https://web.archive.org/web/20080130204029/http://www.barackobama.com/2002/10/02/remarks_of_illinois_state_sen.php |archive-date = January 30, 2008 |publisher = Barack Obama |access-date = February 3, 2008 }}
+* {{cite news |last = McCormick |first = John |date = October 3, 2007 |title = Obama marks '02 war speech; Contender highlights his early opposition in an effort to distinguish him from his rivals |newspaper = Chicago Tribune |page = 7 |url = https://pqasb.pqarchiver.com/chicagotribune/access/1351610621.html?dids=1351610621:1351610621&FMT=ABS&FMTS=ABS:FT |quote = The top strategist for Sen. Barack Obama has just 14 seconds of video of what is one of the most pivotal moments of the presidential candidate's political career. The video, obtained from a Chicago TV station, is of Obama's 2002 speech in opposition to the impending Iraq invasion. |access-date = October 28, 2008 |archive-date = December 18, 2008 |archive-url = https://web.archive.org/web/20081218011609/http://pqasb.pqarchiver.com/chicagotribune/access/1351610621.html?dids=1351610621:1351610621&FMT=ABS&FMTS=ABS:FT |url-status = dead }}{{Subscription required}}
+* {{cite news |last = Pallasch |first = Abdon M. |date = October 3, 2007 |title = Obama touts anti-war cred; Kicks off tour 5 years after speech critical of going to Iraq |newspaper = Chicago Sun-Times |page = 26 |url = http://nl.newsbank.com/nl-search/we/Archives?p_product=CSTB&p_theme=cstb&p_action=search&p_maxdocs=200&s_dispstring=headline(Obama%20touts%20anti-war%20cred)%20AND%20date(all)&p_field_advanced-0=title&p_text_advanced-0=(Obama%20touts%20anti-war%20cred)Êl_numdocs=20&p_perpage=10&p_sort=YMD_date:DÊl_useweights=no |access-date = October 28, 2008 }}{{subscription required}}</ref>
+<ref name="stop the war">{{cite news |last = Ritter |first = Jim |date = March 17, 2003 |newspaper = Chicago Sun-Times |page = 3 |title = Anti-war rally here draws thousands |url=http://nl.newsbank.com/nl-search/we/Archives?p_product=CSTB&p_theme=cstb&p_action=search&p_maxdocs=200&s_dispstring=headline(Anti-war%20rally%20here%20draws%20thousands)%20AND%20date(all)&p_field_advanced-0=title&p_text_advanced-0=(Anti-war%20rally%20here%20draws%20thousands)Êl_numdocs=20&p_perpage=10&p_sort=YMD_date:DÊl_useweights=no |access-date = February 3, 2008 }} {{subscription required}}
+* {{cite press release |author = Office of the Press Secretary |date = March 16, 2003 |title = President Bush: Monday 'moment of truth' for world on Iraq |url=https://georgewbush-whitehouse.archives.gov/news/releases/2003/03/20030316-3.html |via = [[NARA|National Archives]] |work = [[whitehouse.gov]] |access-date = February 18, 2008 }}</ref>
+<ref name="future">{{cite news |last = Mendell |first = David |date = March 17, 2004 |title = Obama routs Democratic foes; Ryan tops crowded GOP field; Hynes, Hull fall far short across state |newspaper = Chicago Tribune |page = 1 |url=http://articles.chicagotribune.com/2004-03-17/news/0403170332_1_blair-hull-gery-chico-blacks-and-liberal-whites |access-date = March 1, 2009 }}
+* {{cite news |last = Davey |first = Monica |date = March 18, 2004 |title = As quickly as overnight, a Democratic star is born |newspaper = The New York Times |page = A20 |url=https://www.nytimes.com/2004/03/18/us/as-quickly-as-overnight-a-democratic-star-is-born.html |archive-url=https://web.archive.org/web/20090506195833/http://www.nytimes.com/2004/03/18/us/as-quickly-as-overnight-a-democratic-star-is-born.html |archive-date=May 6, 2009 |url-access=subscription |url-status=live |access-date = March 1, 2009 }}
+* {{cite news |last = Howlett |first = Debbie |date = March 19, 2004 |title = Dems see a rising star in Illinois Senate candidate |newspaper = USA Today |page = A04 |url=https://www.usatoday.com/news/politicselections/nation/2004-03-18-obama-usat_x.htm |access-date = March 1, 2009 }}
+* {{cite news |last = Scheiber |first = Noam |date = May 31, 2004 |title = Race against history. Barack Obama's miraculous campaign |magazine = The New Republic |volume = 230 |issue = 20 |pages = 21–22, 24–26 (cover story) |url=http://www.tnr.com/article/race-against-history-0 |access-date = March 24, 2009 }}
+* {{cite news |last = Finnegan |first = William |date = May 31, 2004 |title = The Candidate. How far can Barack Obama go? |magazine = The New Yorker |volume = 20 |issue = 14 |pages = 32–38 |url=https://www.newyorker.com/archive/2004/05/31/040531fa_fact1?currentPage=all |access-date = March 24, 2009 }}
+* {{cite news |last = Dionne |first = E.J. Jr. |date = June 25, 2004 |title = In Illinois, a star prepares |newspaper = The Washington Post |page = A29 |url=https://www.washingtonpost.com/wp-dyn/articles/A4062-2004Jun24.html |access-date = March 24, 2009 }}
+* {{cite news |last = Scott |first = Janny |date = May 18, 2008 |title = The story of Obama, written by Obama |newspaper = The New York Times |page = A1 |url=https://www.nytimes.com/2008/05/18/us/politics/18memoirs.html |access-date = January 9, 2010 }}
+* Mendell (2007), pp. 235–259.</ref>
+<ref name="status">{{cite news |date=August 2, 2004 |title=Star Power. Showtime: Some are on the rise; others have long been fixtures in the firmament. A galaxy of bright Democratic lights |work=Newsweek |pages=48–51 |url=http://www.newsweek.com/id/54728/output/print |access-date=November 15, 2008 |archive-url=https://web.archive.org/web/20081218014146/http://www.newsweek.com/id/54728/output/print |archive-date=December 18, 2008 |url-status=live }}
+* {{cite news |last=Samuel |first=Terence |date=August 2, 2004 |title=A shining star named Obama. How a most unlikely politician became a darling of the Democrats |work=U.S. News & World Report |page=25 |url=https://www.usnews.com/usnews/news/articles/040802/2obama.htm |access-date=November 15, 2008 |archive-url=https://web.archive.org/web/20081206100640/http://www.usnews.com/usnews/news/articles/040802/2obama.htm |archive-date=December 6, 2008 |url-status=dead}}
+* {{cite news |last=Lizza |first=Ryan |date=September 2004 |title=Why is Barack Obama generating more excitement among Democrats than John Kerry? |work=The Atlantic Monthly |pages=30, 33 |url=https://www.theatlantic.com/doc/200409/lizza |access-date=November 15, 2008 }}
+* {{cite news |last=Davey |first=Monica |date=July 26, 2004 |title=A surprise Senate contender reaches his biggest stage yet |newspaper=The New York Times |page=A1 |url=https://www.nytimes.com/2004/07/26/us/the-speaker-a-surprise-senate-contender-reaches-his-biggest-stage-yet.html |archive-url=https://web.archive.org/web/20090507095649/http://www.nytimes.com/2004/07/26/us/the-speaker-a-surprise-senate-contender-reaches-his-biggest-stage-yet.html |archive-date=May 7, 2009 |url-access=subscription |url-status=live |access-date=November 25, 2010 }}
+* {{cite news |last=Leibovich |first=Mark |date=July 27, 2004 |title=The other man of the hour |newspaper=The Washington Post |page=C1 |url=https://www.washingtonpost.com/wp-dyn/articles/A16606-2004Jul26.html |access-date=November 15, 2008 }}
+* {{cite news |last=Milligan |first=Susan |date=July 27, 2004 |title=In Obama, Democrats see their future |work=The Boston Globe |page=B8 |url=https://www.boston.com/news/local/articles/2004/07/27/in_obama_democrats_see_their_future/ |access-date=November 15, 2008 |archive-url=https://web.archive.org/web/20081218181835/http://www.boston.com/news/local/articles/2004/07/27/in_obama_democrats_see_their_future/ |archive-date=December 18, 2008 |url-status=live }}
+* {{cite news |last=Seelye |first=Katharine Q. |date=July 28, 2004 |title=Illinois Senate nominee speaks of encompassing unity |newspaper=The New York Times |page=A1 |url=https://www.nytimes.com/2004/07/28/politics/campaign/28blacks.html |archive-url=https://web.archive.org/web/20060624052131/http://www.nytimes.com/2004/07/28/politics/campaign/28blacks.html |archive-date=June 24, 2006}}
+* {{cite news |last=Broder |first=David S. |date=July 28, 2004 |title=Democrats focus on healing divisions; Addressing convention, newcomers set themes |newspaper=The Washington Post |page=A1 |url=https://www.washingtonpost.com/wp-dyn/articles/A17865-2004Jul27.html |access-date=November 15, 2008}}
+* {{cite news |last1=Bing |first1=Jonathan |last2=McClintock |first2=Pamela |date=July 29, 2004 |title=Auds resist charms of Dem stars |work=Variety |page=1 |url=https://www.variety.com/article/VR1117908388.html |access-date=November 15, 2008}}
+* Mendell (2007), pp. 272–285.</ref>
+<ref name="margin">{{cite news |year = 2005 |title = America Votes 2004: U.S. Senate / Illinois |publisher = CNN |url=http://www.cnn.com/ELECTION/2004/pages/results/states/IL/S/01/index.html |access-date = April 13, 2008 |archive-url=https://web.archive.org/web/20080416061340/http://www.cnn.com/ELECTION/2004//pages/results/states/IL/S/01/index.html |archive-date = April 16, 2008 |url-status=live }}
+* {{cite news |last = Slevin |first = Peter |date = November 13, 2007 |title = For Obama, a handsome payoff in political gambles |newspaper = The Washington Post |page = A3 |url=https://www.washingtonpost.com/wp-dyn/content/article/2007/11/12/AR2007111201945.html |access-date = April 13, 2008 }}
+* {{cite news |last1 = Chase |first1 = John |last2 = Mendell |first2 = David |date = November 3, 2004 |title = Obama scores a record landslide |newspaper = Chicago Tribune |page = 1 |url=http://www.noticiasdot.com/publicaciones/2004/1104/0311/noticias031104/presidenciales-usa/images/usa/chicago_tribune/chicago_tribune_031104.pdf |access-date = April 3, 2009 |url-status=dead |archive-url=https://web.archive.org/web/20110513095857/http://www.noticiasdot.com/publicaciones/2004/1104/0311/noticias031104/presidenciales-usa/images/usa/chicago_tribune/chicago_tribune_031104.pdf |archive-date = May 13, 2011 }}
+* {{cite news |last = Fornek |first = Scott |date = November 3, 2004 |title = Obama takes Senate seat in a landslide |newspaper = Chicago Sun-Times |page = 6 |url=http://www.highbeam.com/doc/1P2-1553596.html |access-date = April 3, 2009 |archive-url=https://web.archive.org/web/20130510061848/http://www.highbeam.com/doc/1P2-1553596.html |archive-date = May 10, 2013 |url-status=dead }}</ref>
+* {{cite news |first = Tom |last = Curry |title = What Obama's Senate Votes Reveal |date = February 21, 2008 |url=https://www.nbcnews.com/id/23276453 |work = NBC News |access-date = June 25, 2008 }}
+* {{cite news|url=http://nj.nationaljournal.com/voteratings/ |title=Obama: Most Liberal Senator In 2007 |work=National Journal |date=January 31, 2008 |access-date=June 25, 2008 |archive-url=https://web.archive.org/web/20080627040734/http://nj.nationaljournal.com/voteratings/ |archive-date=June 27, 2008 |url-status=dead }}
+<ref name="transition period">{{cite news |url=https://www.reuters.com/article/politicsNews/idUSTRE4AF1MJ20081116 |title = Obama resigns Senate seat, thanks Illinois |access-date = March 10, 2009 |date = November 16, 2008 |work = [[Reuters]] |last = Mason |first = Jeff }}</ref>
+* {{cite news |url=http://www.time.com/time/nation/article/0,8599,1859020,00.html |title=Obama to Resign Senate Seat on Sunday |access-date=November 22, 2008 |date=November 13, 2008 |magazine=Time |last=Sidoti |first=Liz |archive-url=https://web.archive.org/web/20081122143031/http://www.time.com/time/nation/article/0%2C8599%2C1859020%2C00.html |archive-date=November 22, 2008 |url-status=dead}}
+<ref name="nuclear terrorism">{{cite press release |title = Obama, Schiff Provision to Create Nuclear Threat Reduction Plan Approved |date = December 20, 2007 |url=http://obama.senate.gov/press/071220-obama_schiff_pr/ |publisher = Barack Obama U.S. Senate Office |archive-url=https://web.archive.org/web/20081218154751/http://obama.senate.gov/press/071220-obama_schiff_pr/ |archive-date = December 18, 2008 }}</ref>
+<ref name="Kenyan">{{cite news |first=Christina |last=Larson |title=Hoosier Daddy: What Rising Democratic Star Barack Obama Can Learn from an Old Lion of the GOP |date=September 2006 |url=http://www.washingtonmonthly.com/features/2006/0609.larson.html |work=Washington Monthly |access-date=April 27, 2008 |archive-url=https://web.archive.org/web/20080430232404/http://www.washingtonmonthly.com/features/2006/0609.larson.html |archive-date=April 30, 2008 |url-status=dead }}
+* {{cite news |first=Chuck |last=Goudie |title=Obama Meets with Arafat's Successor |date=January 12, 2006 |url=http://a.abclocal.go.com/wls/story?section=news/local&id=3806933 |publisher=[[WLS-TV]] |location=Chicago |access-date=April 27, 2008 |archive-url=https://web.archive.org/web/20141103231711/http://a.abclocal.go.com/wls/story?section=news%2Flocal&id=3806933 |archive-date=November 3, 2014 |url-status=dead }}
+* {{cite news |title=Obama Slates Kenya for Fraud |date=August 28, 2006 |url=http://www.news24.com/News24/Africa/News/0,,2-11-1447_1989646,00.html |archive-url=https://web.archive.org/web/20080605213213/http://www.news24.com/News24/Africa/News/0%2C%2C2-11-1447_1989646%2C00.html |archive-date=June 5, 2008 |publisher=News24 |location=Cape Town |access-date=April 27, 2008 |url-status=dead }}
+* {{cite news |first=Chris |last=Wamalwa |title=Envoy Hits at Obama Over Graft Remark |date=September 2, 2006 |url=http://www.eastandard.net/archives/cl/hm_news/news.php?articleid=1143957666 |archive-url=https://web.archive.org/web/20071010050740/http://www.eastandard.net/archives/cl/hm_news/news.php?articleid=1143957666 |archive-date=October 10, 2007 |work=The Standard (Nairobi) |access-date=April 27, 2008 }}
+* {{cite news |first1=Vincent |last1=Moracha |first2=Mangoa |last2=Mosota |title=Leaders Support Obama on Graft Claims |date=September 4, 2006 |url=http://www.eastandard.net/archives/cl/hm_news/news.php?articleid=1143957752 |archive-url=https://web.archive.org/web/20071007115436/http://www.eastandard.net/archives/cl/hm_news/news.php?articleid=1143957752 |archive-date=October 7, 2007 |work=The Standard |location=Nairobi }}</ref>
+<ref name="allocation">{{cite news|url=http://www.time.com/time/politics/article/0,8599,1738331,00.html |title=The Five Mistakes Clinton Made |author=Tumulty, Karen |author-link=Karen Tumulty |magazine=Time |date=May 8, 2008 |access-date=November 11, 2008 |archive-url=https://web.archive.org/web/20081211125310/http://www.time.com/time/politics/article/0%2C8599%2C1738331%2C00.html |archive-date=December 11, 2008 |url-status=dead }}
+* {{cite news|url=https://www.nytimes.com/2008/06/08/us/politics/08recon.html |title=The Long Road to a Clinton Exit |first1=Peter |last1=Baker |first2=Jim |last2=Rutenberg |work=The New York Times |date=June 8, 2008 |access-date=November 29, 2008 |archive-url=https://web.archive.org/web/20081209030041/http://www.nytimes.com/2008/06/08/us/politics/08recon.html |archive-date=December 9, 2008 |url-status=live }}</ref>
+<ref name="acceptance">{{cite news |title = Obama accepts Democrat nomination |url=http://news.bbc.co.uk/2/hi/americas/7586375.stm |publisher= BBC News |date = August 29, 2008 |access-date = August 29, 2008 |archive-url=https://web.archive.org/web/20080828234350/http://news.bbc.co.uk/2/hi/americas/7586375.stm |archive-date = August 28, 2008 |url-status=live }}
+* {{cite news |url=http://www.csmonitor.com/USA/Politics/2008/0829/soaring-speech-from-obama-plus-some-specifics |title = Soaring speech from Obama, plus some specifics |work = The Christian Science Monitor |author = Marks, Alexandra |date = August 29, 2008 |archive-url=https://web.archive.org/web/20100314121702/http://www.csmonitor.com/USA/Politics/2008/0829/soaring-speech-from-obama-plus-some-specifics |archive-date = March 14, 2010 }}</ref>
+<ref name="small donations">{{cite news|first=Jim |last=Malone |title=Obama Fundraising Suggests Close Race for Party Nomination |date=July 2, 2007 |url=http://www.voanews.com/english/archive/2007-07/2007-07-02-voa52.cfm |archive-url=https://web.archive.org/web/20070914032004/http://voanews.com/english/archive/2007-07/2007-07-02-voa52.cfm |archive-date=September 14, 2007 |publisher=Voice of America }}
+* {{cite news|first=Jeanne |last=Cummings |title=Small Donors Rewrite Fundraising Handbook |date=September 26, 2007 |url=http://dyn.politico.com/printstory.cfm?uuid=3ECB3515-3048-5C12-004D622CB6F4E214 |work=Politico |access-date=January 14, 2008 |archive-url=https://web.archive.org/web/20080201140941/http://dyn.politico.com/printstory.cfm?uuid=3ECB3515-3048-5C12-004D622CB6F4E214 |archive-date=February 1, 2008 |url-status=dead }}
+* {{cite news|first=Emily |last=Cadei |title=Obama Outshines Other Candidates in January Fundraising |date=February 21, 2008 |url=http://www.cqpolitics.com/wmspage.cfm?docID=news-000002674309 |publisher=CQ Politics |archive-url=https://web.archive.org/web/20080613213513/http://www.cqpolitics.com/wmspage.cfm?docID=news-000002674309 |archive-date=June 13, 2008 }}</ref>
+<ref name="presidential debates">{{cite press release |url=http://www.debates.org/pages/news_111907.html |archive-url=https://web.archive.org/web/20080706070658/http://www.debates.org/pages/news_111907.html |archive-date = July 6, 2008 |title = Commission on Presidential Debates Announces Sites, Dates, Formats and Candidate Selection Criteria for 2008 General Election |publisher = [[Commission on Presidential Debates]] |date = November 19, 2007 }}
+* {{cite news |access-date = July 6, 2008 |url=http://www.courant.com/topic/ |title = Gun Ruling Reverberates |work = [[Hartford Courant]] |date = June 27, 2008 |archive-url=https://web.archive.org/web/20080705225819/http://www.courant.com/topic/ |archive-date = July 5, 2008 |url-status=live }}</ref>
+<ref name="electoral votes">{{cite news |work = NBC News |access-date = February 20, 2009 |date = November 4, 2008 |url=https://www.nbcnews.com/id/27531033 |title = Barack Obama elected 44th president |author = Johnson, Alex }}
+* {{cite news |url=http://www.cnn.com/ELECTION/2008/results/president/ |title = CNN Electoral Map Calculator—Election Center 2008 |publisher = CNN |year = 2008 |access-date = December 14, 2008 |archive-url=https://web.archive.org/web/20081212014309/http://www.cnn.com/ELECTION/2008/results/president/ |archive-date = December 12, 2008 |url-status=live }}</ref>
+<ref name="direct assistance">{{cite news |url=http://stimulus.org/ |title = Committee for a Responsible Federal Budget, Stimulus Watch |access-date = April 9, 2011 }}
+* {{cite news |url=http://www.cnn.com/2009/POLITICS/02/17/obama.stimulus.remarks/ |title = Obama's remarks on signing the stimulus plan |access-date = February 17, 2009 |publisher = CNN |date = February 17, 2009 |archive-url=https://web.archive.org/web/20090220074825/http://www.cnn.com/2009/POLITICS/02/17/obama.stimulus.remarks/ |archive-date = February 20, 2009 |url-status=live }}</ref>
+<ref name="markets opened">{{cite news |title = U.S. Expands Plan to Buy Banks' Troubled Assets |date = March 23, 2009 |work = The New York Times |url=https://www.nytimes.com/2009/03/24/business/economy/24bailout.html |archive-url=https://web.archive.org/web/20090325043723/http://www.nytimes.com/2009/03/24/business/economy/24bailout.html |archive-date=March 25, 2009 |url-access=subscription |url-status=live |first1 = Edmund L. |last1 = Andrews |first2 = Eric |last2 = Dash |access-date = April 12, 2010 }}
+* {{cite news |title = Wall Street soars 7% on bank plan debut |date = March 23, 2009 |work = Reuters |url=https://www.reuters.com/article/businessNews/idUSTRE52H2FA20090323 }}</ref>
+<ref name="preceding administration">{{cite news|title=Biden vows break with Bush era foreign policy |url=http://www.canada.com/news/unveils+changes+foreign+policy/1265065/story.html |access-date=January 31, 2013 |first1=Ross |last1=Colvin |first2=Noah |last2=Barkin |publisher=Canada.com |location=Toronto |date=February 7, 2009 |archive-url=https://web.archive.org/web/20121106164443/http://www.canada.com/news/unveils%2Bchanges%2Bforeign%2Bpolicy/1265065/story.html |archive-date=November 6, 2012 |url-status=dead }}
+* {{cite news|first=Kim |last=Ghattas |title=Clinton's gaffes and gains on tour |url=http://news.bbc.co.uk/2/hi/americas/7931699.stm |access-date=June 15, 2009 |work=BBC News |date=March 8, 2009 }}</ref>
+<ref name="middleeast">{{cite news |url=http://www.cnn.com/2009/POLITICS/06/04/egypt.obama.speech |title = Obama in Egypt reaches out to Muslim world |date = June 4, 2009 |publisher = CNN |access-date = January 30, 2011 }}</ref>
+* {{cite news |first1 = Jeff |last1 = Zeleny |first2 = Alan |last2 = Cowell |url=https://www.nytimes.com/2009/06/05/world/middleeast/05prexy.html |title = Addressing Muslims, Obama Pushes Mideast Peace |work = The New York Times |date = June 4, 2009 |archive-url=https://web.archive.org/web/20110331161401/http://www.nytimes.com/2009/06/05/world/middleeast/05prexy.html|archive-date=March 31, 2011 }}
+* {{cite web |url=https://obamawhitehouse.archives.gov/blog/The-President-in-the-Middle-East/ |title = The President in the Middle East |date = June 3, 2009 |first = Jesse |last = Lee |via=[[NARA|National Archives]] |work=[[whitehouse.gov]] |access-date = June 4, 2009 }}
+<ref name="counterinsurgency tactics">{{cite news |url=https://www.washingtonpost.com/wp-dyn/content/article/2009/05/11/AR2009051101864.html |title = Top U.S. Commander in Afghanistan Is Fired |date = May 12, 2009 |newspaper = The Washington Post }}
+* {{cite news |url=http://www.foxnews.com/politics/2009/05/13/new-commander-brings-counterinsurgency-experience-afghanistan/ |title = New U.S. Commander Brings Counterinsurgency Experience to Afghanistan |date = May 13, 2009 |publisher = Fox News |access-date = May 30, 2012 |archive-url=https://web.archive.org/web/20120216024227/http://www.foxnews.com/politics/2009/05/13/new-commander-brings-counterinsurgency-experience-afghanistan/ |archive-date = February 16, 2012 |url-status=dead }}</ref>
+<ref name="exceptional orator">{{cite news |url=http://www.theage.com.au/world/a-classic-orator-obama-learnt-from-the-masters-20081129-6nf1.html |title = Obama: Oratory and originality |last = Holmes |first = Stephanie |date = November 30, 2008 |access-date = December 11, 2008 |work = The Age |location = Melbourne |archive-url=https://web.archive.org/web/20081218154747/http://www.theage.com.au/world/a-classic-orator-obama-learnt-from-the-masters-20081129-6nf1.html |archive-date = December 18, 2008 |url-status=live }}
+* {{cite news |url=http://www.businessweek.com/smallbiz/content/mar2008/sb2008033_156351.htm |title = How to Inspire People Like Obama Does |last = Gallo |first = Carmine |date = March 3, 2008 |access-date = February 21, 2009 |work = Bloomberg BusinessWeek |archive-url=https://web.archive.org/web/20090226003326/http://www.businessweek.com/smallbiz/content/mar2008/sb2008033_156351.htm |archive-date = February 26, 2009 |url-status=live }}
+* {{cite news |url=https://www.thestar.com/living/article/551538 |title = New emotion dubbed 'elevation' |date = December 11, 2008 |work = Toronto Star |access-date = December 11, 2008 |first = Diana |last = Zlomislic |archive-url=https://web.archive.org/web/20081212193736/http://www.thestar.com/living/article/551538 |archive-date = December 12, 2008 |url-status=live }}
+* {{cite news |title = Obama Is America's Third Greatest Presidential Orator in Modern Era |url=https://www.huffingtonpost.com/richard-greene/obama-is-americas-3rd-gre_b_813868.html |date = January 25, 2011 |first = Richard |last = Greene |work = [[The Huffington Post]] |access-date = July 2, 2011 }}</ref>
+<ref name="in Jakarta">{{cite web |title = Obama's Indonesian Redux |url=http://languagelog.ldc.upenn.edu/nll/?p=1025 |author = Zimmer, Benjamin |year = 2009 |access-date = March 12, 2009 |publisher = Language Log |archive-url=https://web.archive.org/web/20090303094040/http://languagelog.ldc.upenn.edu/nll/?p=1025 |archive-date = March 3, 2009 |url-status=live }}
+* {{cite news |url=http://cetak.kompas.com/read/xml/2008/11/26/00223862/obama.saya.kangen.nasi.goreng.bakso.dan.rambutan |title = Obama: Saya Kangen Nasi Goreng, Bakso, dan Rambutan |work = [[Kompas]] |date = November 26, 2008 |archive-url=https://web.archive.org/web/20081203010718/http://cetak.kompas.com/read/xml/2008/11/26/00223862/obama.saya.kangen.nasi.goreng.bakso.dan.rambutan |archive-date = December 3, 2008 |language = id }}</ref>
+<ref name="corruption charges">{{cite news |url=https://www.washingtonpost.com/wp-dyn/content/article/2006/12/16/AR2006121600729.html |title = Obama says he regrets land deal with fundraiser |newspaper = The Washington Post |date = December 17, 2006 |access-date = June 10, 2008 |last = Slevin |first = Peter }}
+* {{cite news |url=https://www.nbcnews.com/id/24973282 |title = Rezko found guilty in corruption case |access-date = June 24, 2008 |date = June 4, 2008 |agency = Associated Press |work = NBC News |last = Robinson |first = Mike }}</ref>
+<ref name="social change">Obama (2006), pp. 202–208. Portions excerpted in: {{cite news|first=Barack |last=Obama |title=My Spiritual Journey |date=October 16, 2006 |url=http://www.time.com/time/magazine/article/0,9171,1546579,00.html |magazine=Time |access-date=April 28, 2008 |archive-url=https://web.archive.org/web/20080430051154/http://www.time.com/time/magazine/article/0%2C9171%2C1546579%2C00.html |archive-date=April 30, 2008 |url-status=dead }}
+* {{cite web|url=http://obama.senate.gov/speech/060628-call_to_renewal/ |title='Call to Renewal' Keynote Address |access-date=June 16, 2008 |last=Obama |first=Barack |date=June 28, 2006 |publisher=Barack Obama: U.S. Senator for Illinois |archive-url=https://web.archive.org/web/20090104231501/http://obama.senate.gov/speech/060628-call_to_renewal/ |archive-date=January 4, 2009 }}</ref>
+<ref name="Trinity">{{cite news |last1 = Garrett |first1 = Major |last2 = Obama |first2 = Barack |date = March 14, 2008 |title = Obama talks to Major Garrett on 'Hannity & Colmes' |publisher = RealClearPolitics |url=http://www.realclearpolitics.com/articles/2008/03/obama_talks_to_major_garrett_o.html |access-date = November 10, 2012 |quote = Major Garrett, Fox News correspondent: So the first question, how long have you been a member in good standing of that church? Sen. Barack Obama (D-IL), presidential candidate: You know, I've been a member since 1991 or '92. And—but I have known Trinity even before then when I was a community organizer on the South Side, helping steel workers find jobs{{nbs}}... Garrett: As a member in good standing, were you a regular attendee of Sunday services? Obama: You know, I won't say that I was a perfect attendee. I was regular in spurts, because there was times when, for example, our child had just been born, our first child. And so we didn't go as regularly then. }}
+* {{cite news |agency = Associated Press |date = April 29, 2008 |title = Obama strongly denounces former pastor |work = NBC News |url=https://www.nbcnews.com/id/24371827 |access-date = November 10, 2012 |quote = I have been a member of Trinity United Church of Christ since 1992, and have known Reverend Wright for 20 years. The person I saw yesterday was not the person [whom] I met 20 years ago. }}
+* {{cite news |last = Miller |first = Lisa |date = July 11, 2008 |title = Finding his faith |work = Newsweek |url=http://www.thedailybeast.com/newsweek/2008/07/11/finding-his-faith.html |access-date = November 10, 2012 |quote = He is now a Christian, having been baptized in the early 1990s at Trinity United Church of Christ in Chicago. |archive-url=https://web.archive.org/web/20130720055213/http://www.thedailybeast.com/newsweek/2008/07/11/finding-his-faith.html |archive-date = July 20, 2013 |url-status=dead }}
+* {{cite book |last = Remnick |first = David |year = 2010 |title = The Bridge: The Life and Rise of Barack Obama |location = New York |publisher = Alfred A. Knopf |page = [https://archive.org/details/bridgelifeand00remn/page/177 177] |isbn = 978-1-4000-4360-6 |quote = In late October 1987, his third year as an organizer, Obama went with Kellman to a conference on the black church and social justice at the Harvard Divinity School. |title-link = The Bridge: The Life and Rise of Barack Obama }}
+* Maraniss (2012), <span class="plainlinks">[https://books.google.com/books?id=Wnna9CLtblAC&pg=PT887 p. 557]</span>: It would take time for Obama to join and become fully engaged in Wright's church, a place where he would be baptized and married; that would not happen until later, during his second time around in Chicago, but the process started then, in October 1987{{nbs}}... Jerry Kellman: "He wasn't a member of the church during those first three years, but he was drawn to Jeremiah."
+* {{Cite book |first=Baker |last=Peter |author-link=Peter Baker (author) |year=2017 |title=Obama: The Call of History |location=New York |publisher=[[The New York Times Company]]/Callaway |isbn=978-0-935112-90-0 |oclc=1002264033}}</ref>
+
+</references>
+
+===Works cited===
+
+{{Refbegin|30em|indent=yes}}
+* {{cite book |last = Jacobs |first = Sally H. |year = 2011 |title = The Other Barack: The Bold and Reckless Life of President Obama's Father |location = New York |publisher = [[PublicAffairs]] |isbn = 978-1-58648-793-5 |title-link = The Other Barack: The Bold and Reckless Life of President Obama's Father }}
+* {{cite book |author = Maraniss, David |year = 2012 |title = Barack Obama: The Story |location = New York |publisher = [[Simon & Schuster]] |isbn = 978-1-4391-6040-4 |title-link = Barack Obama: The Story |author-link = David Maraniss }}
+* {{cite book |author = Mendell, David |year = 2007 |title = Obama: From Promise to Power |location = New York |publisher = Amistad/[[HarperCollins]] |isbn = 978-0-06-085820-9 |title-link = Obama: From Promise to Power |author-link = David Mendell }}
+* {{cite book |last = Obama |first = Barack |orig-date = 1st pub. 1995 |year = 2004 |title = Dreams from My Father: A Story of Race and Inheritance |location = New York |publisher = [[Three Rivers Press]] |isbn = 978-1-4000-8277-3 |title-link = Dreams from My Father }}
+* {{cite book |last = Obama |first = Barack |year = 2006 |title = The Audacity of Hope: Thoughts on Reclaiming the American Dream |location = New York |publisher = [[Crown Publishing Group]] |isbn = 978-0-307-23769-9 |title-link = The Audacity of Hope }}
+* {{cite book |last = Scott |first = Janny |year = 2011 |title = A Singular Woman: The Untold Story of Barack Obama's Mother |location = New York |publisher = [[Riverhead Books]] |isbn = 978-1-59448-797-2 |title-link = A Singular Woman: The Untold Story of Barack Obama's Mother }}
+{{Refend}}
+
+==Further reading==
+
+{{Refbegin|30em|indent=yes}}
+* {{cite news |last = De Zutter |first = Hank |date = December 8, 1995 |title = What Makes Obama Run? |url=http://www.chicagoreader.com/chicago/what-makes-obama-run/Content?oid=889221 |newspaper = Chicago Reader |access-date = April 25, 2015 }}
+* {{cite magazine|last=Graff |first=Garrett M. |date=November 1, 2006 |title=The Legend of Barack Obama |url=http://www.washingtonian.com/articles/mediapolitics/1836.html |magazine=Washingtonian |access-date=January 14, 2008 |url-status=dead |archive-url=https://web.archive.org/web/20080214141924/http://www.washingtonian.com/articles/mediapolitics/1836.html |archive-date=February 14, 2008 }}
+* Kenny, Mary. "Obama shaped more by his WASP heritage than the passion of Martin Luther King," [https://www.independent.ie/opinion/columnists/obama-shaped-more-by-his-wasp-heritage-than-the-passion-of-martin-luther-king-30568999.html ''Independent.ie'' (September 7, 2014)]
+* {{cite book |last = Koltun |first = Dave |editor-last1 = Ahuja |editor-first1 = Sunil |editor-last2 = Dewhirst |editor-first2 = Robert |year = 2005 |title = The Road to Congress 2004 |chapter = The 2004 Illinois Senate Race: Obama Wins Open Seat and Becomes National Political "Star" |location = Hauppauge, New York |publisher = Nova Science Publishers |isbn = 978-1-59454-360-9 }}
+* {{cite magazine |last = Lizza |first = Ryan |date = September 2007 |title = Above the Fray |url=https://www.gq.com/news-politics/newsmakers/200708/obama-barack-election-president |magazine = GQ |access-date = October 27, 2010 }}
+* {{cite magazine |first = Larissa |last = MacFarquhar |date = May 7, 2007 |title = The Conciliator: Where is Barack Obama Coming From? |url=https://www.newyorker.com/reporting/2007/05/07/070507fa_fact_macfarquhar |magazine = The New Yorker |access-date = January 14, 2008 |author-link = Larissa MacFarquhar }}
+* {{cite book |last = McClelland |first = Edward |year = 2010 |title = Young Mr. Obama: Chicago and the Making of a Black President |location = New York |publisher = Bloomsbury Press |isbn = 978-1-60819-060-7 |url-access = registration |url=https://archive.org/details/youngmrobamachic0000mccl }}
+* Parmar, Inderjeet and Mark Ledwidge. "...'a foundation-hatched black': Obama, the US establishment, and foreign policy." ''International Politics'' 54.3 (2017): 373-388 [https://openaccess.city.ac.uk/id/eprint/12563/1/ online]
+{{Refend}}
+
+==External links==
+{{Library resources box|by=yes|onlinebooks=yes|viaf=52010985}}
+<!--
+Please keep this section brief and simple to navigate. Specific pages already referenced within the article should not be repeated here.
+-->
+
+===Official===
+* {{Official website|https://www.obama.org/}} of The Obama Foundation
+* {{Official website|https://www.obamalibrary.gov/}} of the Barack Obama Presidential Library
+* {{Official website|https://www.ofa.us/}} of [[Organizing for Action]]
+* [https://www.whitehouse.gov/about-the-white-house/presidents/barack-obama/ White House biography]
+<!--
+Do not add YouTube, MySpace, Twitter et al. There are MANY and all are linked from the campaign site.
+-->
+
+===Other===
+* [https://www.huffingtonpost.com/author/barack-obama Column archive] at ''[[HuffPost|The Huffington Post]]''
+* {{Curlie|Regional/North_America/United_States/Government/Executive_Branch/President/POTUS_Barack_Obama}}
+* {{CongBio|O000167}}
+* {{C-SPAN|55625}}
+* {{NYT topic|people/o/barack_obama}}
+* {{ChicagoTribuneKeyword}}
+* {{Gutenberg author | id=Obama,+Barack | name=Barack Obama}}
+* {{Internet Archive author | name=Barack Obama}}
+* {{Librivox author |id=11252}}
+* {{Nobelprize}}
+* [https://www.politifact.com/personalities/barack-obama/ Barack Obama] at [[Politifact]]
+
+{{Barack Obama}}
+{{US presidents}}
+{{Navboxes top
+|title = Offices and distinctions
+}}
+{{s-start}}
+{{s-par|us-il-sen}}
+{{s-bef|before=[[Alice Palmer (politician)|Alice Palmer]]}}
+{{s-ttl|title=Member of the [[Illinois Senate]]{{break}}from the 13th district|years=1997–2004}}
+{{s-aft|after=[[Kwame Raoul]]}}
+{{s-ppo}}
+{{s-bef|before=[[Carol Moseley Braun]]}}
+{{s-ttl|title=[[Democratic Party (United States)|Democratic]] nominee for [[U.S. Senator from Illinois]]{{break}}([[Classes of United States senators|Class 3]])|years=[[2004 United States Senate election in Illinois|2004]]}}
+{{s-aft|after=[[Alexi Giannoulias]]}}
+{{s-bef|before=[[Harold Ford Jr.]]}}
+{{s-ttl|title=Keynote Speaker of the [[Democratic National Convention]]|years=[[2004 Democratic National Convention|2004]]}}
+{{s-aft|after=[[Mark Warner]]}}
+{{s-bef|before=[[John Kerry]]}}
+{{s-ttl|title=[[Democratic Party (United States)|Democratic]] [[List of United States Democratic Party presidential tickets|nominee]] for President of the United States|years=[[2008 United States presidential election|2008]], [[2012 United States presidential election|2012]]}}
+{{s-aft|after=[[Hillary Clinton]]}}
+{{s-par|us-sen}}
+{{s-bef|before=[[Peter Fitzgerald (politician)|Peter Fitzgerald]]}}
+{{s-ttl|title=[[List of United States senators from Illinois|United States Senator (Class 3) from Illinois]]|years=2005–2008|alongside=[[Dick Durbin]]}}
+{{s-aft|after=[[Roland Burris]]}}
+{{s-off|usa}}
+{{s-bef|before=[[George W. Bush]]}}
+{{s-ttl|title=[[President of the United States]]|years=2009–2017}}
+{{s-aft|after=[[Donald Trump]]}}
+{{s-ach}}
+{{s-bef|before=[[Martti Ahtisaari]]}}
+{{s-ttl|title=[[Nobel Peace Prize]] Laureate|years=2009}}
+{{s-aft|after=[[Liu Xiaobo]]}}
+{{s-prec|usa}}
+{{s-bef|before=[[George W. Bush]]|as=former president}}
+{{s-ttl|title=[[United States order of precedence|Order of precedence of the United States]]{{break}}''former president''|years=}}
+{{s-aft|after=[[Donald Trump]]|as=former president}}
+{{s-dip}}
+{{s-bef|before=[[Gordon Brown]]}}
+{{s-ttl|title=Chairperson of the [[G20|Group of 20]]|years=2009}}
+{{s-aft|after=[[Stephen Harper]]}}
+{{s-end}}
+{{navboxes bottom}}
+{{Navboxes top
+|title = Articles related to Barack Obama
+}}
+{{2008 United States presidential election}}
+{{2012 United States presidential election}}
+{{Democratic Party (United States)}}
+{{United States senators from Illinois}}
+{{USCongRep-start|congresses= 109th–110th [[United States Congress]]es |state=[[Illinois]]}}
+{{USCongRep/IL/109}}
+{{USCongRep/IL/110}}
+{{USCongRep-end}}
+{{Patriot Act}}
+{{Time Persons of the Year}}
+{{Grammy Award for Best Spoken Word Album}}
+{{NAACP Image Award&nbsp;– Chairman's Award}}
+{{Nobel Peace Prize laureates}}
+{{2009 Nobel Prize winners}}
+{{African American topics}}
+{{navboxes bottom}}
+
+{{Subject bar
+| commons = y
+| n = y
+| n-search = Category:Barack Obama
+| wikt = y
+| wikt-search = Category:en:Barack Obama
+| d = y
+| q = y
+| s = y
+| s-search = Author:Barack Obama
+}}
+{{Authority control}}
+
+{{DEFAULTSORT:Obama, Barack}}
+[[Category:Barack Obama| ]]
+[[Category:1961 births]]
+[[Category:20th-century African-American men]]
+[[Category:20th-century American male writers]]
+[[Category:20th-century American non-fiction writers]]
+[[Category:20th-century Protestants]]
+[[Category:20th-century African-American academics]]
+[[Category:21st-century African-American men]]
+[[Category:21st-century American male writers]]
+[[Category:21st-century American non-fiction writers]]
+[[Category:21st-century American politicians]]
+[[Category:21st-century presidents of the United States]]
+[[Category:21st-century Protestants]]
+[[Category:21st-century scholars]]
+[[Category:Activists from Hawaii]]
+[[Category:Activists from Illinois]]
+[[Category:African-American Christians]]
+[[Category:African-American educators]]
+[[Category:African-American feminists]]
+[[Category:African-American lawyers]]
+[[Category:African-American non-fiction writers]]
+[[Category:African-American politicians]]
+[[Category:African-American state legislators in Illinois]]
+[[Category:African-American candidates for President of the United States]]
+[[Category:African-American United States senators]]
+[[Category:American civil rights lawyers]]
+[[Category:American community activists]]
+[[Category:American feminist writers]]
+[[Category:American gun control activists]]
+[[Category:American legal scholars]]
+[[Category:American male non-fiction writers]]
+[[Category:American memoirists]]
+[[Category:American Nobel laureates]]
+[[Category:American people of English descent]]
+[[Category:American people of French descent]]
+[[Category:American people of German descent]]
+[[Category:American people of Irish descent]]
+[[Category:American people of Kenyan descent]]
+[[Category:American people of Luo descent]]
+[[Category:American people of Scottish descent]]
+[[Category:American people of Swiss descent]]
+[[Category:American people of Welsh descent]]
+[[Category:American political writers]]
+[[Category:American Protestants]]
+[[Category:Articles containing video clips]]
+[[Category:Candidates in the 2008 United States presidential election]]
+[[Category:Candidates in the 2012 United States presidential election]]
+[[Category:Columbia College (New York) alumni]]
+[[Category:Democratic Party presidents of the United States]]
+[[Category:Democratic Party (United States) presidential nominees]]
+[[Category:Democratic Party United States senators]]
+[[Category:Grammy Award winners]]
+[[Category:Harvard Law School alumni]]
+[[Category:Illinois Democrats]]
+[[Category:Illinois lawyers]]
+[[Category:Illinois state senators]]
+[[Category:LGBT rights activists from the United States]]
+[[Category:Living people]]
+[[Category:Male feminists]]
+[[Category:Members of the American Philosophical Society]]
+[[Category:Netflix people]]
+[[Category:Nobel Peace Prize laureates]]
+[[Category:Obama family]]
+[[Category:Politicians from Chicago]]
+[[Category:Politicians from Honolulu]]
+[[Category:Presidents of the United States]]
+[[Category:Proponents of Christian feminism]]
+[[Category:Punahou School alumni]]
+[[Category:Scholars of constitutional law]]
+[[Category:Time Person of the Year]]
+[[Category:United States senators from Illinois]]
+[[Category:University of Chicago Law School faculty]]
+[[Category:Writers from Chicago]]
+[[Category:Writers from Honolulu]]
diff --git a/testcases_parsing/5390001.html b/testcases/parsing/5390001.html
similarity index 100%
rename from testcases_parsing/5390001.html
rename to testcases/parsing/5390001.html
diff --git a/testcases_parsing/77p2p-7.live-105.html b/testcases/parsing/77p2p-7.live-105.html
similarity index 100%
rename from testcases_parsing/77p2p-7.live-105.html
rename to testcases/parsing/77p2p-7.live-105.html
diff --git a/testcases_parsing/whut.html b/testcases/parsing/whut.html
similarity index 100%
rename from testcases_parsing/whut.html
rename to testcases/parsing/whut.html
diff --git a/testcases_parsing/yasudaya.html b/testcases/parsing/yasudaya.html
similarity index 100%
rename from testcases_parsing/yasudaya.html
rename to testcases/parsing/yasudaya.html