Teadmiste formaliseerimine: erinevus redaktsioonide vahel

Allikas: Lambda
Mine navigeerimisribale Mine otsikasti
116. rida: 116. rida:
= Blocks and lectures: the main content of the course =
= Blocks and lectures: the main content of the course =


Allpool olev blokkide struktuur on sarnane, aga mitte sama, kui 2022 aastal. Transformerite (BERT, GPT) ja hübriidsüsteemide osa muutub mahukamaks.
The details and materials of lectures in the future are from 2024 and will be revised/extended. The materials of the current or passed lectures are up to date.


Toimunud loengute materjalid ja salvestused osaliselt uuendatakse/muudetakse: kogu info veel mitte toimunud loengute ja prakside kohta on pärit peamiselt 2022 aastast ja on esialgne indikatsioon.


== Block 1: knowledge in SQL, RDF and JSON ==
== Block 1: knowledge in SQL, RDF and JSON ==


=== Lecture: Intro and background, 30. Jan ===
=== Lecture: Intro and background: 4. February ===


Sissejuhatuse presentatsioon:
Intro presentation:


[[Media:teadmised_intro2024.pdf|teadmised_intro2024.pdf]]
[[Media:teadmised_intro2024.pdf|teadmised_intro2024.pdf]]


Soovitav (mitte kohustuslik) kuulamine:
Recommended non-obligatory listening:
* Marcus episode on the Lex Fridman podcast https://lexfridman.com/gary-marcus/
* Marcus episode on the Lex Fridman podcast https://lexfridman.com/gary-marcus/
* Gary Marcus (KR&R commonsense proponent) & Joshua Bengio (ML proponent) https://www.facebook.com/watch/live/?v=498403850881660&ref=watch_permalink read also the related Marcus paper https://arxiv.org/ftp/arxiv/papers/1801/1801.00631.pdf  
* Gary Marcus (KR&R commonsense proponent) & Joshua Bengio (ML proponent) https://www.facebook.com/watch/live/?v=498403850881660&ref=watch_permalink read also the related Marcus paper https://arxiv.org/ftp/arxiv/papers/1801/1801.00631.pdf  
135. rida: 134. rida:
* Reading, not listening: on Hybrid A.I. in image analysis https://knowablemagazine.org/article/technology/2020/what-is-neurosymbolic-ai
* Reading, not listening: on Hybrid A.I. in image analysis https://knowablemagazine.org/article/technology/2020/what-is-neurosymbolic-ai


=== Lecture: Nosql, json and rdf in databases: 6. Feb ===
=== Lecture: Nosql, json and rdf in databases: 11. February ===


2024 lecture [https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2023/Shared%20Documents/General/Recordings/Meeting%20in%20_General_-20240206_120353-Meeting%20Recording.mp4?csf=1&web=1&e=VZgTGB&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D recording in teams].
Lecture materials:
Lecture materials:
* We cover [[Media:Kr_lect_1b_2024.pdf| Background: relations of sql and logic]] <font color="red">E1</font>
* We cover [[Media:Kr_lect_1b_2024.pdf| Background: relations of sql and logic]] <font color="red">E1</font>


* and start with [[Media:Kr_lect_2b_2024.pdf| schemaless databases, RDF and RDFS]] <font color="red">E1</font> (also important for practice work)
* and start with [[Media:Kr_lect_2b_2024.pdf| schemaless databases, RDF and RDFS]] <font color="red">E1</font> (also important for practice work)
<!--
* [https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2022/Shared%20Documents/General/Recordings/Meeting%20in%20_General_-20220201_100310-Meeting%20Recording.mp4?csf=1&web=1&e=VcZTmK Lecture recording in teams]
-->
<!--
These materials will be taken up in the next lecture:
* [[Nosql links and notes]] <font color="red">E2</font>
* Json in Postgresql [https://www.postgresqltutorial.com/postgresql-json/ intro tutorial] <font color="red">E2</font> and official [https://www.postgresql.org/docs/current/datatype-json.html json datatype] and especially [https://www.postgresql.org/docs/current/functions-json.html functions and operations]
-->
See also
See also
* Json in Postgresql: [https://www.postgresql.org/docs/current/datatype-json.html json datatype] and [https://www.postgresql.org/docs/current/functions-json.html functions for json]
* Json in Postgresql: [https://www.postgresql.org/docs/current/datatype-json.html json datatype] and [https://www.postgresql.org/docs/current/functions-json.html functions for json]
<!-- * [[notes about schema for rdf / first lab]] -->


The weekly homework will be about trying out small things in logic: please try out [http://logictools.org/ logictools] from "basics" to "equality" in simple examples selectbox. Details will appear after the lecture.
The weekly homework will be about trying out small things in logic: please try out [http://logictools.org/ logictools] from "basics" to "equality" in simple examples selectbox. Details will appear after the lecture.
<!--
 
* [https://json-ld.org/ json-ld]: currently most popular rdf syntax (in json), also recommended by Google.
-->


== Block 2: handling simple facts and rules in symbolic AI and logic ==
== Block 2: handling simple facts and rules in symbolic AI and logic ==




=== Lecture: simple rules in rdfs, logic and owl: 13 feb ===
=== Lecture: simple rules in rdfs, logic and owl: 18. February ===
 
[https://echo360.org.uk/media/45b942c7-002b-4735-a270-83475a5ccec7/public Loengusalvestus echos].
 
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Praktikum-20240213_140229-Meeting%20Recording.mp4?csf=1&web=1&e=Gk454L&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D praktikumi salvestus].


* Main lecture material: [[Media:Kr_lect_2b.ppt| schemaless databases, RDF and RDFS]] looked at rdfs rule meanings in logic and sparql (up to page 30 in the presentation).
* Main lecture material: [[Media:Kr_lect_2b.ppt| schemaless databases, RDF and RDFS]] looked at rdfs rule meanings in logic and sparql (up to page 30 in the presentation).
<!--
* [https://echo360.org.uk/media/39c66a70-0b79-4fb9-b516-affdd1cbe108/public Lecture recording in echo].
-->
* [https://livettu.sharepoint.com/:v:/s/Knowledgerepresentation2023/EflyEjMnTMxKji6nxhy1ErUBvaUg1I749ZjrOtNYrHUynQ?e=cBfYNu 2023 Loengusalvestuse link].
* [https://livettu.sharepoint.com/:v:/s/Knowledgerepresentation2023/EflyEjMnTMxKji6nxhy1ErUBvaUg1I749ZjrOtNYrHUynQ?e=cBfYNu 2023 Loengusalvestuse link].
<!-- * [https://livettu.sharepoint.com/:v:/s/Knowledgerepresentation2023/EXxSuoyDiidApoXqKs8SAkwBuvebQ7kg3iDeGQOD4_cyoQ?e=A67Grh Praksi salvestuse link]. -->
* [[Rdf example developed during lecture]]
* [[Rdf example developed during lecture]]


200. rida: 179. rida:
* [https://www.w3.org/RDF/ various rdf tools] listed at the bottom of the page
* [https://www.w3.org/RDF/ various rdf tools] listed at the bottom of the page


=== Lecture: what the reasoner does: Feb 20 ===
=== Lecture: what the reasoner does: 25. February ===
 
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Meeting%20in%20_General_-20240220_115919-Meeting%20Recording.mp4?csf=1&web=1&e=qIv94A&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D loengusalvestus teamsis]
 
[https://livettu.sharepoint.com/sites/Knowledgerepresentation2024/_layouts/15/stream.aspx?id=%2Fsites%2FKnowledgerepresentation2024%2FShared%20Documents%2FGeneral%2FRecordings%2FLab1%5Fextra%2Emp4&referrer=StreamWebApp%2EWeb&referrerScenario=AddressBarCopied%2Eview Lisamaterjal esimese labori kohta]
 
<!--
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2022/Shared%20Documents/General/Recordings/Meeting%20in%20_General_-20220222_100259-Meeting%20Recording.mp4?csf=1&web=1&e=UzkVBH Loengusalvestus teamsis].
-->
<!--
Recall and go over OWL ideas:
* Official w3c [https://www.w3.org/TR/2012/REC-owl2-primer-20121211/ owl primer] but it is better to look at this [https://www.semantic-web-book.org/w/images/b/b0/KI09-OWL-Rules-1.pdf intro presentation] and continue with [https://www.semantic-web-book.org/w/images/5/5e/KI09-OWL-Rules-2.pdf the owl rules presentation]. If you want, have a deeper look at the [https://www.semantic-web-book.org/ full book].
-->
<!--
[https://livettu.sharepoint.com/:v:/s/Knowledgerepresentation2023/Edac0C29IUlPrhnmVmD-mAcBY_Cj2INfwTSczOD5WlMGtA?e=ETbUGu Loengusalvestus teamsis].
-->


We will consider the reasoning part of K&R to understand what provers do:
We will consider the reasoning part of K&R to understand what provers do:
232. rida: 196. rida:




=== Lecture: looking into main large knowledge bases: 27. Feb ===
=== Lecture: looking into main large knowledge bases  ===


Guest lecture by Martin Verrev. Slides:[[Media:ITI8700_05_Large_KB.pdf|lecture slides]] <font color="red">E2</font>, a tool to explore Wordnet taxonomies can be found here: https://github.com/martinve/wntool
Guest lecture by Martin Verrev. Slides:[[Media:ITI8700_05_Large_KB.pdf|lecture slides]] <font color="red">E2</font>, a tool to explore Wordnet taxonomies can be found here: https://github.com/martinve/wntool
[https://echo360.org.uk/media/11fb2467-f5cd-42aa-a056-35dbf7ae9a2e/public Loengusalvestus 2024: echo]
<!--
[https://livettu.sharepoint.com/:v:/s/Knowledgerepresentation2023/EX-i55YZenZLtLRwgjpOeVIB0IemlS87kmKx94Mxhbm62w?e=SMU7Jf Loengusalvestus 2023]
-->
<!--
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2022/Shared%20Documents/General/Recordings/Teadmiste%20loeng%208%20m%C3%A4rts-20220308_100112-Meeting%20Recording.mp4?csf=1&web=1&e=DyngLd Loengusalvestus teamsis].
-->


You can search/investigate what kind of data is available and you can find out actual data from these databases with some work, by surfing on the web pages of the systems.
You can search/investigate what kind of data is available and you can find out actual data from these databases with some work, by surfing on the web pages of the systems.
291. rida: 246. rida:
== Block 4: natural language and question answering ==
== Block 4: natural language and question answering ==


=== Lecture: Intro to NLP, n-grams, word vectors: 5 March ===
=== Lecture: Intro to NLP, n-grams, word vectors ===


[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Teadmiste%20loeng%205%20m%C3%A4rts-20240305_120418-Meeting%20Recording.mp4?csf=1&web=1&e=cWEU8A&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D Loengusalvestus teamsis]
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Teadmiste%20loeng%205%20m%C3%A4rts-20240305_120418-Meeting%20Recording.mp4?csf=1&web=1&e=cWEU8A&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D Loengusalvestus teamsis]
323. rida: 278. rida:
* A bit old (i.e. few new episodes) [https://soundcloud.com/nlp-highlights NLP highlights] podcast series from the [https://allenai.org/ Allen institute for AI]. Makes sense to start from the very first ones and pick these which have a title looking interesting to you. World-leading stuff and quite understandable.
* A bit old (i.e. few new episodes) [https://soundcloud.com/nlp-highlights NLP highlights] podcast series from the [https://allenai.org/ Allen institute for AI]. Makes sense to start from the very first ones and pick these which have a title looking interesting to you. World-leading stuff and quite understandable.


=== Lecture: large language models (LLM), BERT and GPT families, plus intro to second lab: 12 märts ===
=== Lecture: large language models (LLM), BERT and GPT families, plus intro to second lab ===


[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/New%20channel%20meeting-20240312_120339-Meeting%20Recording.mp4?csf=1&web=1&e=j8fZj2&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D loengusalvestus koos teise praksi ülesannetega]
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/New%20channel%20meeting-20240312_120339-Meeting%20Recording.mp4?csf=1&web=1&e=j8fZj2&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D loengusalvestus koos teise praksi ülesannetega]
357. rida: 312. rida:
* [https://course.fast.ai/ väga detailne ja mahukas videoloengutega deep learningu kursus], mh [https://course.fast.ai/Resources/book.html raamat].
* [https://course.fast.ai/ väga detailne ja mahukas videoloengutega deep learningu kursus], mh [https://course.fast.ai/Resources/book.html raamat].


=== Lecture: LLM usage patterns and RAG: 19 March ===
=== Lecture: LLM usage patterns and RAG ===


[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Meeting%20in%20_General_-20240319_122509-Meeting%20Recording.mp4?csf=1&web=1&e=8Qv48X&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D loengusalvestus]
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Meeting%20in%20_General_-20240319_122509-Meeting%20Recording.mp4?csf=1&web=1&e=8Qv48X&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D loengusalvestus]
378. rida: 333. rida:
** [https://getalign.com/ example estonian startup using a kind of rag]
** [https://getalign.com/ example estonian startup using a kind of rag]


<!--
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2022/Shared%20Documents/General/Recordings/Teadmiste%20kursuse%20loeng%2029%20m%C3%A4rts-20220329_100211-Meeting%20Recording.mp4?csf=1&web=1&e=FV87X7 Loengusalvestus] teamsis.
Nädala eesmärk on konkreetne: <b>sul on vaja aru saada vektorsemantikast</b>, ehk, mis see on, kuidas sõnavektoreid moodustatakse ja kuidas neid kasutada saab.
Now, you may have had a course on NLP and machine learning, in which case you should already know <b>a lot</b> about vector semantics. If so, consider yourself lucky :) and just skim through the following materials to check whether there are any new things or old friends for you. If not so, consider yourself extra lucky: you have come to the core of machine-learning-based NLP, and this is both pretty cool and quite understandable at the same time! Most of the machine-learning-based NLP is built on top of the ideas of vector representation of words.
As a continuation of the lecture from the last week, please have a look and try out
* [https://demo.allennlp.org/ Allen NLP demos] for a number of core NLP techniques: highly recommended for experimentation.
Background study materials for vector representations (continuation of the previous lecture):
* First, listen to [http://lineardigressions.com/episodes/2017/4/23/feature-processing-for-text-analytics text vectorization episode] from the [http://lineardigressions.com/ linear digressions] podcast.
* Second, listen to [http://lineardigressions.com/episodes/2018/12/30/re-release-word2vec word2vec episode] from the [http://lineardigressions.com/ linear digressions] podcast.
* Finally the <b>main thing</b>: slowly read the whole [https://web.stanford.edu/~jurafsky/slp3/6.pdf Vector Semantics: chapter 6] <font color="red">E2</font> from the Jurafsky & Martin book.
Additional supporting non-obligatory materials from (roughly) easier to more complex:
-->
<!-- * [https://medium.com/@jayeshbahire/introduction-to-word-vectors-ea1d4e4b84bf word vectors]: a short intro -->
<!--
* [https://web.stanford.edu/~jurafsky/slp3/slides/vector1.pptx vector semantics part I] presentation from the Jurafsky & Martin book for for chapter 6.
* [https://towardsdatascience.com/art-of-vector-representation-of-words-5e85c59fee5 vector representation]: a short tutorial with code examples.
* [http://u.cs.biu.ac.il/~gonenhi/slides/WiDS_tutorial.pdf vector representation and word2vec]: a medium-sized tutorial presentation.
* [https://www.tensorflow.org/tutorials/representation/word2vec word2vec tutorial] from [https://www.tensorflow.org/ tensorflow]
* [https://web.stanford.edu/~jurafsky/slp3/slides/vector2.pptx vector semantics part II] <font color="red">E2</font> presentation from the Jurafsky & Martin book for chapter 6.
-->
<!--* [[Media:How_does_word2vec_work.pdf|How does word2vec work]] paper by David Meyer.
* [[Media:Word2vec_learning_explained.pdf|Word2vec learning explained]] paper by Xin Rong.-->
<!--
If you want to get a deeper understanding and look at longer lectures while doing that, there is a wealth of good word vector lecture videos available,
for example, from the Stanford NLP course
* [https://www.youtube.com/watch?v=IYMYI9AJpQs Word vectors 1]
* [https://www.youtube.com/watch?v=nH4rn3X8i0c Word vectors 2]
* [https://www.youtube.com/watch?v=pip8h9vjTHY Word vectors 3]
However, I'd recommend to use the obligatory and supporting materials above first and only - optionally - spend time with the longer lectures after that.
Also interesting to look and read:
* Probabilistic models: [https://www.youtube.com/watch?v=u7l5hhmdc0M LDA video explanation by Jordan Boyd-Graber]
* [https://drive.google.com/file/d/0B8i61jl8OE3XdHRCSkV1VFNqTWc/edit Aetherial Symbols] by the  ultimate machine learning guru aka "godfather of machine learning" [https://en.wikipedia.org/wiki/Geoffrey_Hinton Geoffrey Hinton]
*[https://yurichev.com/blog/markov/ Autocomplete using Markov chains]
-->
<!--
=== Lecture: large language models, BERT and GPT families ===
Materials will be added later.
-->


== Block 5: hybrid systems and uncertain knowledge ==
== Block 5: hybrid systems and uncertain knowledge ==
429. rida: 338. rida:
We will focus on (a) world modeling and uncertainty in KR (open/closed world, frame problem, probabilities, exceptions) and (b) current research on building hybrid systems
We will focus on (a) world modeling and uncertainty in KR (open/closed world, frame problem, probabilities, exceptions) and (b) current research on building hybrid systems


=== Lecture: neurosymbolic reasoning, open/closed world, planning, frame problem, blocks world: 26 March ===
=== Lecture: neurosymbolic reasoning, open/closed world, planning, frame problem, blocks world ===
 
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Meeting%20in%20_General_-20240326_120304-Meeting%20Recording.mp4?csf=1&web=1&e=2VKaQV&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D Loengusalvestus 2024]
 
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Praktikum-20240326_141051-Meeting%20Recording.mp4?csf=1&web=1&e=O7bE6R&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D Praktikumi salvestus 2024]
 
 
<!--
We will first have a brief look at the 3. lab: [[Experiment with natural language rules, ChatGPT and ProofWriter]] and an alternative [[Use a semantic parser and a reasoner to solve questions posed in natural language]].
-->
<!--
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2022/Shared%20Documents/General/Recordings/General-20220405_100120-Meeting%20Recording.mp4?csf=1&web=1&e=IbnqJe 202 loengusalvestus teamsis]
-->


For intro/recalling hybrid neurosymbolic reasoning:
For intro/recalling hybrid neurosymbolic reasoning:
494. rida: 391. rida:
* [[Simple axiomatization of the blocks world]]: <font color="red">E2</font> please also read through the comments explaining the axiomatization and queries!
* [[Simple axiomatization of the blocks world]]: <font color="red">E2</font> please also read through the comments explaining the axiomatization and queries!
* [[More complex blocks world axiomatization]] taken from the [http://www.tptp.org/ TPTP] problem set for first order logic, concretely by concatenanting and commenting axiom sets [[PLA001-0.ax]], [[PLA001-1.ax]] and queries [[PLA004-1.p]], [[PLA005-1.p]], [[PLA019-1.p]]
* [[More complex blocks world axiomatization]] taken from the [http://www.tptp.org/ TPTP] problem set for first order logic, concretely by concatenanting and commenting axiom sets [[PLA001-0.ax]], [[PLA001-1.ax]] and queries [[PLA004-1.p]], [[PLA005-1.p]], [[PLA019-1.p]]


To get a simple visualization of the blocks world, have a look at this [https://www.youtube.com/watch?v=gbIPicRoIgQ tiny video].
To get a simple visualization of the blocks world, have a look at this [https://www.youtube.com/watch?v=gbIPicRoIgQ tiny video].


<!--
=== Blocks world examples, then reasoning with uncertainty ===
<b>NB!</b>Please email me tanel.tammet at taltech.ee a short description of (a) with which of the queries in the files were you successful and how long did they approximately take, (b) what queries did you invent yourself and
what happened with these. Please put a word "formaliseerimine" into the email subject so I can easily find them.
-->
 
=== Blocks world examples, then reasoning with uncertainty: 2 April ===
 
* [https://echo360.org.uk/media/ea46391b-09ed-4bc3-89dc-3d68960c360e/public Loengusalvestus 2024] echos
<!--
* [https://livettu.sharepoint.com/:v:/s/Knowledgerepresentation2022/EUZLJOrQonJNuQG5uMr6TSwBxV6b91HJcPz1XRG9gRgHlA?e=J1KIbS Loengusalvestus 2022: siit vaata esimest 30 minutit].
* [https://livettu.sharepoint.com/:v:/s/Knowledgerepresentation2023/EQXdkEsVEeFEp4BJBIQIp44BUhezJHLiOe4Ag6NAGaFX3g?e=PedhX6 Loengusalvestus 2023: uuem variant pärast eelmise 30 minutit ja edasi]
-->


Loengu sissejuhatava osa presentatsioon: [[Media:Reasoning_with_uncertainty.pdf|Reasoning_with_uncertainty.pdf]] <font color="red">E1</font>.
Loengu sissejuhatava osa presentatsioon: [[Media:Reasoning_with_uncertainty.pdf|Reasoning_with_uncertainty.pdf]] <font color="red">E1</font>.
534. rida: 417. rida:
* [https://dtai.cs.kuleuven.be/problog/ Problog] start with a [https://dtai.cs.kuleuven.be/problog/tutorial.html tutorial] <font color="red">E2</font>
* [https://dtai.cs.kuleuven.be/problog/ Problog] start with a [https://dtai.cs.kuleuven.be/problog/tutorial.html tutorial] <font color="red">E2</font>
* Try out some examples via browser from the [https://dtai.cs.kuleuven.be/problog/tutorial.html tutorial]
* Try out some examples via browser from the [https://dtai.cs.kuleuven.be/problog/tutorial.html tutorial]
<!--
 
Finally some additional possibly helpful material considering some parts of the main [[Numeric uncertainty]] material.
* [[Media:Uncertain_prob_fuzzy.ppt?|Uncertain_prob_fuzzy.ppt?]] a good intro to both Bayesian and Fuzzy reasoning.
* [[Media:Vienna_tanel_4.pdf|Vienna_tanel_4.pdf]] some additional examples of different uncertainties and possible combinations of these.
-->


=== Lecture: continue with uncertainty, then intro to lab 3: 9 April  ===
=== Lecture: continue with uncertainty, then intro to lab 3: 9 April  ===


Numeric confidences and probabilities.
Numeric confidences and probabilities.
<!--
[https://livettu.sharepoint.com/:v:/s/Knowledgerepresentation2023/EWMpX54Kw8JAiF1hIMGWe-QBp_fy9DE6eJpjtYBR0RIq9w?e=dgTfKe&nav=eyJwbGF5YmFja09wdGlvbnMiOnsic3RhcnRUaW1lSW5TZWNvbmRzIjoxNTEuNX19 Lecture recording 2023]
-->
<!--
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2022/Shared%20Documents/General/Recordings/Teadmiste%20loeng%2019%20aprill-20220419_100152-Meeting%20Recording.mp4?csf=1&web=1&e=lgh5OR Lecture recording 2022].
-->
<!--
Materials accompanying the lecture:
* [https://arxiv.org/abs/2303.12712 Paper "Sparks of Artificial General Intelligence: Early experiments with GPT-4"]
* [https://github.com/tammet/nlpsolver nlpsolver] and [[Media:nlp_reasoning_pipeline.pdf]]
* [[nlpsolver knowledge representation principles: draft]]
-->
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Meeting%20in%20_General_-20240409_115938-Meeting%20Recording.mp4?csf=1&web=1&e=pZeleG&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D Loengusalvestus] teamsis 2024.


A [[Media:Confidences_cade28_d.pdf |presentation]] of our [https://link.springer.com/chapter/10.1007/978-3-030-79876-5_29 paper] about implementing numeric confidences. Here are [https://logictools.org/confer/ examples], a binary, etc.
A [[Media:Confidences_cade28_d.pdf |presentation]] of our [https://link.springer.com/chapter/10.1007/978-3-030-79876-5_29 paper] about implementing numeric confidences. Here are [https://logictools.org/confer/ examples], a binary, etc.


=== Lecture: continuing with uncertain knowledge: 16 aprill ===
=== Lecture: continuing with uncertain knowledge: 16 aprill ===
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Meeting%20in%20_General_-20240416_115928-Meeting%20Recording.mp4?csf=1&web=1&e=HmJolx&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D Teamsi salvestus 2024]


Wider background: [https://en.wikipedia.org/wiki/Non-monotonic_logic non-monotonic logic]
Wider background: [https://en.wikipedia.org/wiki/Non-monotonic_logic non-monotonic logic]
570. rida: 432. rida:


Additionally, we look at non-montonic logic using [https://swish.swi-prolog.org/example/scasp.swinb s(CASP)] and [https://www.dlvsystem.it/dlvsite/ dlv]. Both are examples of [https://en.wikipedia.org/wiki/Answer_set_programming Answer set programming (ASP)] and related to [https://en.wikipedia.org/wiki/Datalog datalog]. For ASP, have a look at [https://acris.aalto.fi/ws/portalfiles/portal/30223846/SCI_Janhunen_Niemela_The_Answer_Set_Programming.pdf this intro], written by [https://www.aalto.fi/en/people/ilkka-niemela Ilkka Niemelä] who is currently the [https://www.aalto.fi/en/aalto-university/governance-president president (rehtori) of the Aalto University]
Additionally, we look at non-montonic logic using [https://swish.swi-prolog.org/example/scasp.swinb s(CASP)] and [https://www.dlvsystem.it/dlvsite/ dlv]. Both are examples of [https://en.wikipedia.org/wiki/Answer_set_programming Answer set programming (ASP)] and related to [https://en.wikipedia.org/wiki/Datalog datalog]. For ASP, have a look at [https://acris.aalto.fi/ws/portalfiles/portal/30223846/SCI_Janhunen_Niemela_The_Answer_Set_Programming.pdf this intro], written by [https://www.aalto.fi/en/people/ilkka-niemela Ilkka Niemelä] who is currently the [https://www.aalto.fi/en/aalto-university/governance-president president (rehtori) of the Aalto University]
<!--
[https://livettu.sharepoint.com/:v:/s/Knowledgerepresentation2023/EbB7A92RcW1Hul1VLQZ8vLMBh2NDteNwQ-L-p_9z1EJzSg?e=0QiAOz Teamsi salvestus 2023]
[[Hübriidsüsteemid: loengu käigus tehtud sissjeuhatavad märkmed]]
-->
<!--
=== TPTP and the landscape of reasoners ===
* [http://www.cs.miami.edu/~tptp/ TPTP] problem set for first order logic
* See [[how to run gkc on the Wordnet TPTP version]]
* [http://www.cs.miami.edu/~tptp/CASC/ CASC prover competition]
-->
<!--
=== Blocks world ===
* [http://www.ee.pdx.edu/~mperkows/May4/005.Ch11-planning.ppt Old intro: planning and blocks world]
Some axiom sets:
* [[PLA001-0.ax]]
* [[PLA001-1.ax]]
And some planning problems to solve from these axiom sets:
* [[PLA004-1.p]]
* [[PLA005-1.p]]
* [[PLA019-1.p]]
Also:
[[blocks world axiom/query examples from lecture|Alternative axiomatization]]
-->
<!--
We use the [https://github.com/tammet/gkc gkc] prover for examples.
-->
<!--
Some background links:
** [http://www.cs.unm.edu/~mccune/papers/robbins/ Otter solving an open problem in math]
** [http://www.math.md/files/qrs/v10-n1/v10-n1-(pp95-114).pdf using otter for algebra problems]
** [http://www.cs.miami.edu/~tptp/ TPTP problem set for first order logic formalizations]
** [https://en.wikipedia.org/wiki/Zermelo%E2%80%93Fraenkel_set_theory set theory] and [http://www.cs.miami.edu/~tptp/cgi-bin/SeeTPTP?Category=Axioms&File=SET004-0.ax its axiomatization in logic] and [http://www.cs.miami.edu/~tptp/cgi-bin/SeeTPTP?Category=Problems&Domain=SET set theory problems in TPTP]
** [http://www.cs.miami.edu/~tptp/CASC/ CASC prover competition]
-->
<!--
=== Lecture: starting to parse natural language for interaction with rule reasoners ===
We will start building a tiny question-answering tool, translating natural language to rule reasoner input.
Our first, very simple goal: translate the text "John is a father of Pete. Pete is a father of Mark. Who is the father of Pete?" to
a rule reasoner input
<pre>
father(john,pete).
father(pete,mark).
-father(X,pete) | ans(X).
</pre>
then run the reasoner, fetch the ans(john) and give an answer "John is".
You can use a trivial NLP-to-reasoner parser in python [[nlp.py]] as a starting point.


We will then proceed to gradually make questions and sentences more complex and add rules to be able to answer them.


In the final part of the course we will start looking at uncertain reasoning: right now we will only try to do simple strict reasoning.
=== Lecture: Semantic parsing  ===
 
We will have a look at potential tools for semantic parsing, from simpler to more complex:
* [https://github.com/Kitt-AI/parsetron parsetron]: a really simple and very limited tool to build your own parser.
* [https://github.com/wcmac/sippycup sippycup]: has a detailed [https://nbviewer.jupyter.org/github/wcmac/sippycup/tree/master/ tutorial/course] attached, check the [https://nbviewer.jupyter.org/github/wcmac/sippycup/blob/master/sippycup-unit-0.ipynb first lab]
* [https://github.com/mynlp/ccg2lambda ccg2lambda]: parses to classical logic strings, which are embedded in XML output.
 
Other interesting things to look at:
* [https://framenet.icsi.berkeley.edu/fndrupal/ Framenet]: map meaning to form in English through the theory of Frame Semantics.
* [https://github.com/google/sling Sling]: Google project for getting facts from Wikipedia using Frame Semantics.
* [https://yale-lily.github.io/spider Spider]: Yale Semantic Parsing and Text-to-SQL Challenge.
* [https://github.com/salesforce/WikiSQL WikiSQL]: A Salesforce crowd-sourced dataset for developing NLP interfaces for relational databases.
* [https://github.com/allenai/allennlp Allennlp] from the [https://allenai.org/ Allen Institute for AI]. See also their [https://github.com/allenai/acl2018-semantic-parsing-tutorial semantic parsing tutorial].
-->
 
=== Lecture: Semantic parsing: 23 aprill ===
 
Loengu annab Martin: audikas pluss teamsis.
 
[https://teams.microsoft.com/l/meetup-join/19%3apbCAi1dcW-0ZYLt9oaEWEF0OVSCh_itNLauu6apjLII1%40thread.tacv2/1682415298039?context=%7b%22Tid%22%3a%223efd4d88-9b88-4fc9-b6c0-c7ca50f1db57%22%2c%22Oid%22%3a%22e3e55dca-e89b-46ae-b8ee-1d158e79281d%22%7d Teamsi salvestus 2023]


Loenguslaidid: [[Media:KR_2024_Parsing_01.pdf]] <font color="red">E2</font>  
Loenguslaidid: [[Media:KR_2024_Parsing_01.pdf]] <font color="red">E2</font>  


<!--
=== Semantic parsing continued ===
[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2022/Shared%20Documents/General/Recordings/Teadmiste%20loeng%2026%20aprill_%20semantilised%20NLP%20parserid-20220426_100254-Meeting%20Recording.mp4?csf=1&web=1&e=m4kIuB Teams recording]
-->
 
=== 30. aprillil loengut ei ole: ülikoolis on lühendatud tööpäev, kuni 12:00ni ===
 
=== Semantic parsing continued : 7 mai ===
 
Martin jätkab teemat: audikas pluss teamsis.


Loenguslaidid (lisatud linkidega): [[Media:KR_2024_Parsing_02.pdf]] <font color="red">E2</font>
Loenguslaidid (lisatud linkidega): [[Media:KR_2024_Parsing_02.pdf]] <font color="red">E2</font>


[https://livettu.sharepoint.com/:v:/r/sites/Knowledgerepresentation2024/Shared%20Documents/General/Recordings/Loeng_%20Semantiline%20Parsimine%20vol%202-20240507_120602-Meeting%20Recording.mp4?csf=1&web=1&e=BKG1VU&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D Salvestus teamsis 2024]


=== Topics in neurosymbolic reasoning ja konsultatsioon eksamiks: 14 mai===
=== Topics in neurosymbolic reasoning ja konsultatsioon eksamiks ===


Some papers to explore:
Some papers to explore:


* https://ceur-ws.org/Vol-3432/
* https://ceur-ws.org/Vol-3432/
* https://ceur-ws.org/Vol-3432/paper5.pdf
* https://ceur-ws.org/Vol-3432/paper5.pdf
* https://ceur-ws.org/Vol-3432/paper8.pdf
* https://ceur-ws.org/Vol-3432/paper8.pdf
* https://aclanthology.org/2023.emnlp-main.313.pdf
* https://aclanthology.org/2023.emnlp-main.313.pdf
* https://ojs.aaai.org/index.php/AAAI/article/view/29938/31639
* https://ojs.aaai.org/index.php/AAAI/article/view/29938/31639
* https://arxiv.org/pdf/2404.12698
* https://arxiv.org/pdf/2404.12698
* https://proceedings.neurips.cc/paper_files/paper/2023/file/79fea214543ba263952ac3f4e5452b14-Paper-Conference.pdf
* https://proceedings.neurips.cc/paper_files/paper/2023/file/79fea214543ba263952ac3f4e5452b14-Paper-Conference.pdf
* https://proceedings.neurips.cc/paper_files/paper/2023/file/ba90e56a74fd77d0ddec033dc199f0fa-Paper-Conference.pdf
* https://proceedings.neurips.cc/paper_files/paper/2023/file/ba90e56a74fd77d0ddec033dc199f0fa-Paper-Conference.pdf




<!--
[[Märkmed konteksti teemal]]
-->
<!-- [[Teadmiste formaliseerimise eksamiülesanded 20 mai 2020]] -->


<!--
== Block 7: context, time, location, events, causality. ==
To be filled.
-->
<!--
[[Teadmiste formaliseerimise eksamiülesanded 20 mai 2020]]
[[Teadmiste formaliseerimise eksamiülesanded 27 mai 2020]]
-->
<!--
Other stuff: [[Commonsense rules development]]
-->
[[Category:Kursus]]
[[Category:Kursus]]

Redaktsioon: 3. veebruar 2025, kell 09:52

teadmised
teadmised

Name: Knowlege representation
Code: ITI8700
Link: http://lambda.ee/Teadmiste_formaliseerimine
Lecturer: Tanel Tammet tanel.tammet@ttu.ee ICT-426
Practice sessions: Riina Maigre
Archives of previous years: 2024.

Time, place, result

Lectures: Tuesdays 14:00-15:30 room SOC 312/313 (313 weeks 1,3,5,...; 312 weeks 2,4,6,...)
Practice sessions: Wednesdays 12:00-13:30 room U06A-204.

The lectures and sessions will be on site (physical room) plus teams. Later we may decide to do some lecturers/practice sessions on teams only: this will be advertised on the page here early. Beware: recording may not always succeed.

Please join the teams of the course. The code for joining is y0bd8e5.

Weekly teams link for the lecture.

Weekly teams link for the practice session.

Grading

Practical work will give 50%, exam 50% of points, and weekly tasks additional extra up to 10%, underlying the final grade. The exam will consist of (a) several questions asking for the explanation of important concepts along with examples (b) some small excercises.

The materials below marked with the red E1 are the main materials for the exam, while E2 materials will also come up, but less and/or in a simpler form. The markings will be changed as the course progresses, i.e. the future ones will not necessarily persist!

To finish the course successfully, you need to

  • successfully pass three practical works
  • receive at least 1/3 of the max points at exam
  • get practice work + weekly tasks + exam at least 50% points altogehter.

Contents overview: what the course is about

The theme of the course: from SQL to natural language.

Hence the main focus of the course is on hybrid methods for knowledge representation and reasoning: symbolic AI, machine learning / neural methods and their neurosymbolic combinations. We look at this spectrum from simple (representing and using knowledge in databases) to complex (meaning of sentences in natural language and commonsense knowledge) tasks. A closely related subject is commonsense reasoning.

The course contains the following blocks:

  • Knowledge in SQL, RDF and JSON
  • Handling simple facts and rules in symbolic AI and logic
  • General-knowledge databases
  • Natural language and question answering
  • Uncertain knowledge and hybrid systems

Weekly tasks

The small weekly tasks are in addition to the practical work: their goal is to practice with the stuff presented at the last lecture. The tasks will start from the week two; i.e. no weekly task at the first week.

Practical work

NB! The details of the labs are currently from 2024 and will be updated asap.

There are three labs.

The labs have to be presented (as a demo + small overview of the software and principles) to the course teachers and all students present at labwork time, either in the auditorium or over MS teams. The labs can be prepared alone or by teams of two or three people.

Each lab is evaluated independently and gives the same number of points. NB! When you do not meet the lab deadline, you will be awarded half of the points for this lab.

First lab

The 2025 task for the first lab is about handling and understanding triplet stores, meaning of rdf types/properties/etc and writing simple logical rules for answering questions.

Second lab

See Details of the KR second lab in 2025

Third lab: questions in NLP

Books to use

Main materials:

Other useful books and tools for symbolic K&R:

  • logictools.org for experimenting with classical automated reasoning
  • Symbolic reasoning themes are covered in this book with (hopefully) freely accessible pdf-s via Taltech. See also slides for the book.
  • Similarly, the freely accessible pdf of the handbook of knowledge representation gives a detailed and thorough coverage of the subject; far more than necessary for the course.
  • You may want to get a small intro to Prolog by reading the first 100 pages of a classic Art of Prolog book. It is not strictly necessary for the course (we will not be using Prolog) but it surely helps. Besides, the book is interesting, quite easy to read and works out a lot of interesting examples.

Other useful material for neural NLP:

Observe that a noticeable part of the course contents are not covered by these books: use the course materials and links to papers, standards and tutorials provided.

Blocks and lectures: the main content of the course

The details and materials of lectures in the future are from 2024 and will be revised/extended. The materials of the current or passed lectures are up to date.


Block 1: knowledge in SQL, RDF and JSON

Lecture: Intro and background: 4. February

Intro presentation:

teadmised_intro2024.pdf

Recommended non-obligatory listening:

Lecture: Nosql, json and rdf in databases: 11. February

Lecture materials:

See also

The weekly homework will be about trying out small things in logic: please try out logictools from "basics" to "equality" in simple examples selectbox. Details will appear after the lecture.


Block 2: handling simple facts and rules in symbolic AI and logic

Lecture: simple rules in rdfs, logic and owl: 18. February

Have a brief a look at this, no need to read thoroughly:

The main materials covered in the lecture:


And then have brief look (skim through) at:

Certainly read:

We will also start at looking and understanding the examples in logictools.org

More resources:

Lecture: what the reasoner does: 25. February

We will consider the reasoning part of K&R to understand what provers do:

You may want to have a look at the additional materials - from easier to harder - from the


Lecture: looking into main large knowledge bases

Guest lecture by Martin Verrev. Slides:lecture slides E2, a tool to explore Wordnet taxonomies can be found here: https://github.com/martinve/wntool

You can search/investigate what kind of data is available and you can find out actual data from these databases with some work, by surfing on the web pages of the systems.

We will have a look at the goals, main content and differences between:


Block 4: natural language and question answering

Lecture: Intro to NLP, n-grams, word vectors

Loengusalvestus teamsis

Recommended listening:

Lecture: large language models (LLM), BERT and GPT families, plus intro to second lab

loengusalvestus koos teise praksi ülesannetega

Eesmärk: saada pinnaliselt aru LLM ja transformerite (NLP masinõppe põhiasjad) peamistest ideedest. Detailid on tegelikult keerulised ja nendest arusaamine võtab hulga rohkem aega, kui meil kursuses on, sestap lepime vähesega. Samas, kui sul endal huvi, siis loomulikult on teretulnud detailsem iseõpe.

Enne järgmisse materjali süvenemist tutvu kindlasti vektorsemantikaga, mida seletasime 14 märtsi loengus.

Loengus plaanime kasutada:

Mida lisaks vaadata ja lugeda:

Kindlasti

Paratamatult jääb enamus detaile loengus vähearusaadavaks (kui ise ei kuluta hulga aega järele katsetamiseks), aga sellegipoolest on see tõenäoliselt kõige parem loeng transformeritest: mingi tunnetuse sellest, et mis toimub, saab.

Optsionaalselt üldisem arusaam klassikutelt:

Optsionaalselt diipim arusaam:

Lecture: LLM usage patterns and RAG

loengusalvestus

NB! Loeng jäi 20 minutit hiljaks, sest meie audikasse planeeriti eksikombel ad hoc seminar, seega pidime kolima.

Useful reading:


Block 5: hybrid systems and uncertain knowledge

We will focus on (a) world modeling and uncertainty in KR (open/closed world, frame problem, probabilities, exceptions) and (b) current research on building hybrid systems

Lecture: neurosymbolic reasoning, open/closed world, planning, frame problem, blocks world

For intro/recalling hybrid neurosymbolic reasoning:

See also an interesting recent piece about learning chess

We will first give a brief overview / reminder of the work/tasks in hybrid neurosymbolic AI.

We will then consider the issues regarding the world model and the output we expect from the neural part / LLM, along with some demonstrations of semantic parsing with and without the use of LLM.

We will then consider planning, open/closed worlds and the frame problem. The standard example for these is a blocks world: some blocks are on the table and the robot arm can lift single blocks and put them on other blocks or on the table. The arm cannot lift several blocks or a tower of blocks. Then, given a position of blocks at initial situation, can the robot arm create a required new position of blocks? Can we get the steps required? For getting the steps we use the $ans predicate.

One hard issue arising is that how do we know that doing some action like lifting a block does not create side effects like stumbling existing towers, moving other blocks etc? This issue is called the frame problem and it has no easy solutions.

Importantly, the frame problem arises since normal first order logic has

  • the open world assumption E1 (must read): if we do not have (and cannot derive) a positive fact like P(a) and neither a negative fact like -P(a), we assume we simply do not know which holds.

Prolog and databases operate under the

  • closed world assumption E1 (must read): if we do not have (and cannot derive) a positive fact like P(a), we automatically assume that -P(a) must be true. For example, Prolog "negation" really means "cannot prove". One consequence of this assumption is that we cannot represent real negation and disjunction in an OK manner (Prolog does not contain these) and cannot satisfactorily speak about "true", "false" and "unknown". See also negation as failure in prolog


Please look at and read these materials about the frame problem:

These two readings are optional:

  • frame problem at the Stanford Encyclopedia of philosophy: not obligatory, but a good read to get a better understanding.
  • another classic about frame problem: read this only if you became really really interested about the whole issue: it goes quite deep, although it is not especially technical.

You may also want to have a look at the algorithmic complexity and efficient solution algorithms, regardless of how we formalize the problem: see this article.

Next, importantly, you should experiment yourself with gkc and both of the following files. Please copy and read the files and understand the encoding. At the end of the files are several queries to experiment with: instructions are also there.

In both of them the predicate holds(X,Y) is used to describe something X about the blocks world (like, one block is on another or robot holds some block) and the second argument Y describes the state we have arrived to via robot actions from the original state (like, picked up a block in the initial state and then did put the block down on top of another).

To get a simple visualization of the blocks world, have a look at this tiny video.

Blocks world examples, then reasoning with uncertainty

Loengu sissejuhatava osa presentatsioon: Reasoning_with_uncertainty.pdf E1.

Almost all the knowledge we have is uncertain: there are many exceptions to a rule or a fact/rule holds with some vague probability. Notice that, in contrast, typical databases in companies contain facts with very high certainty, but they do not contain rule or commonsense knowledge: the latter is built into brittle software code of systems using these databases.

We will consider two different ways to tackle uncertainty:

  • Numeric methods: uncertainty is estimated with probability-like numbers of various kinds.
  • Discrete methods: no numbers used. Instead, uncertainty is described as exceptions or beliefs of people.

NB! Both of these ways are hard to actually implement, neither have they been understood very well, despite an immense amount of research and papers. For example, typical machine learning methods operate with extremely vague probability-like numbers and do not attempt to put these numbers into a real properly-theoretical-and-correct probabilities framework.

The main material for reading about numeric methods is an overview-followed-in-depth by the lecturer Numeric uncertainty: (E2 up to and including the chapter 3, see also E2 tags inside)

  • Read carefully up to and including the chapter 4 "Different ways to encode confidences in logic" and have a quick look at all the wikipedia links.
  • Skim through the later parts and look only into these subchapters which you found interesting.

Next,

  • Read the paper E2 about confidences. containing intro, algorithms and experiments. Then look at the web page with the confer reasoner and a wealth of examples.
  • Read the paper E2 about exceptions (default logic). containing intro, alorithms and experiments. Then look at the web page with the gk reasoner and a wealth of examples.

Next, have a brief look at a good example system doing some specific kinds of probability reasoning:


Lecture: continue with uncertainty, then intro to lab 3: 9 April

Numeric confidences and probabilities.

A presentation of our paper about implementing numeric confidences. Here are examples, a binary, etc.

Lecture: continuing with uncertain knowledge: 16 aprill

Wider background: non-monotonic logic

A presentation E2 of our paper about implementing default logic E1. Here are examples, a binary, etc.

Additionally, we look at non-montonic logic using s(CASP) and dlv. Both are examples of Answer set programming (ASP) and related to datalog. For ASP, have a look at this intro, written by Ilkka Niemelä who is currently the president (rehtori) of the Aalto University


Lecture: Semantic parsing

Loenguslaidid: Media:KR_2024_Parsing_01.pdf E2

Semantic parsing continued

Loenguslaidid (lisatud linkidega): Media:KR_2024_Parsing_02.pdf E2


Topics in neurosymbolic reasoning ja konsultatsioon eksamiks

Some papers to explore: