From 750b7e2b6f7fea594b2d8d65bc89d4acaef75b3e Mon Sep 17 00:00:00 2001 From: Giovanni Ciatto Date: Sat, 12 Mar 2022 19:16:46 +0100 Subject: [PATCH] chore: describe up to 2p-kt --- figures/term-hierarchy | 63 +++++ figures/term-hierarchy.pdf | Bin 0 -> 24531 bytes figures/term-hierarchy.svg | 121 +++++++++ ise-lab-knowledge-representation.bib | 53 +++- ise-lab-knowledge-representation.sty | 3 +- ise-lab-knowledge-representation.tex | 355 +++++++++++++++++++++++++-- listings/meta-predicates.pl | 7 + 7 files changed, 578 insertions(+), 24 deletions(-) create mode 100644 figures/term-hierarchy create mode 100644 figures/term-hierarchy.pdf create mode 100644 figures/term-hierarchy.svg create mode 100644 listings/meta-predicates.pl diff --git a/figures/term-hierarchy b/figures/term-hierarchy new file mode 100644 index 0000000..d8bf706 --- /dev/null +++ b/figures/term-hierarchy @@ -0,0 +1,63 @@ +@startuml +skinparam shadowing false + +interface Term +interface Constant +interface Var +interface Struct +interface Numeric +interface Integer +interface Real +interface Atom +interface Truth +interface Indicator +interface Recursive +interface Empty +interface EmptyBlock +interface EmptyList +interface List +interface Cons +interface Block +interface Tuple + +Term <|-down- Struct +Term <|-down- Constant +Term <|-down- Var + +Constant <|-down- Numeric +Constant <|-down- Atom + +Numeric <|-down- Real +Numeric <|-down- Integer + +Struct <|-down- Atom +Struct <|-down- Recursive +Struct <|-down- Indicator + +Recursive <|-down- List +Recursive <|-down- Tuple +Recursive <|-down- Block + +Atom <|-down- Truth +Atom <|-down- Empty + +Empty <|-up- EmptyList +Empty <|-up- EmptyBlock + +List <|-down- EmptyList +List <|-down- Cons +Block <|-down- EmptyBlock + +package clauses <> { + + interface Clause + interface Rule + interface Directive + interface Fact + Struct <|-down- Clause + Clause <|-down- Rule + Clause <|-down- Directive + Rule <|-down- Fact + +} +@enduml diff --git a/figures/term-hierarchy.pdf b/figures/term-hierarchy.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1f8fbabb57be2660e99698898066b8688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+->% zGxBr1|3C%*yR-A}xuE#Z0_neV!9S|3#eTIY$f3w5ICOyIs4UE%6i)-uNo@ztnz%@!tJD!gWuCowqG8`?!FuwUZ};11t)b z6oqgIIC^=xBc;WFqIy7e@U(V!bh1T?B0L=ge`0Y(U~X~%uye>ND=903KoB?x1XBW< z0th520rdC=2G&794+Vk5fnEaG76)wp=m8P0_3f< zKQ>?|2@D7W4k`{m`3^wr#7!rJ+co@m0|M8i#X;iYfCJ)SDIl<5VGx)f1QPt~x%s`0 z1OHt3iO?0T0iKU=I61#3XZp92|34$*=V^b748#FET>#I2TL3@|m4I^G;`phFOTZvN zRPYOj+ix1c&%r=&|EA$n^;Zqp`d4;9I{j(~hQfhrgkLpr2{4d)ziMDG9PsRK8dL%( zXZVMPPfYysr_WFr{GWD`_`B|}b}$JzkkY?s;^GkeMfP`10!Zk;X;M=E)ZlnT|ErzE z$wm7&4UWh6ziVEe) +clausesClauseRuleDirectiveFactTermConstantVarStructNumericIntegerRealAtomTruthIndicatorRecursiveEmptyEmptyBlockEmptyListListConsBlockTuple \ No newline at end of file diff --git a/ise-lab-knowledge-representation.bib b/ise-lab-knowledge-representation.bib index cd371df..e447670 100644 --- a/ise-lab-knowledge-representation.bib +++ b/ise-lab-knowledge-representation.bib @@ -4,4 +4,55 @@ @misc{enwiki:cons year = "2021", url = "https://en.wikipedia.org/wiki/Cons", note = "[Online; accessed 11-March-2022]" -} \ No newline at end of file +} + +@misc{Ciatto20212pktPresentation, + author = "Ciatto, Giovanni", + title = "\twopkt{}: A Kotlin Multi-Platform ecosystem for Symbolic AI", + year = "2021", + url = "https://github.com/tuProlog/2p-kt-presentation/releases/latest", + note = "[Online; accessed 11-March-2022]" +} + +@Inbook{Lachiche2010, + author="Lachiche, Nicolas", + editor="Sammut, Claude + and Webb, Geoffrey I.", + title="Propositionalization", + bookTitle="Encyclopedia of Machine Learning", + year="2010", + publisher="Springer US", + address="Boston, MA", + pages="812--817", + isbn="978-0-387-30164-8", + doi="10.1007/978-0-387-30164-8\_680", + url="https://doi.org/10.1007/978-0-387-30164-8_680" +} + + @inproceedings{dcc-aixia-2021-plp, + keywords = {probabilistic logic programming, symbolic AI, 2P-Kt}, + year = 2021, + articleNo = 3, + pages = {19-32}, + author = {Dellaluce, Jason and Calegari, Roberta and Ciatto, Giovanni}, + sort = {inproceedings}, + numpages = 14, + volume = 3078, + issn = {1613-0073}, + month = {dec}, + publisher = {Sun SITE Central Europe, RWTH Aachen University}, + status = {Published}, + title = {Probabilistic logic programming in 2P-Kt}, + booktitle = {AIxIA 2021 Discussion Papers}, + editor = {Mascardi, Viviana and Palmonari, Matteo and Vizzari, Giuseppe}, + url = {http://ceur-ws.org/Vol-3078/paper-29.pdf}, + series = {CEUR Workshop Proceedings}, + subseries = {AI*IA Series}} + +@misc{uci:iris, + author = "{UCI}, Machine Learning Repository", + title = "Iris Dataset", + year = "1950", + url = "https://archive.ics.uci.edu/ml/datasets/iris", + note = "[Online; accessed 11-March-2022]" +} diff --git a/ise-lab-knowledge-representation.sty b/ise-lab-knowledge-representation.sty index d955808..b9b3092 100644 --- a/ise-lab-knowledge-representation.sty +++ b/ise-lab-knowledge-representation.sty @@ -29,7 +29,7 @@ \newcommand{\mgu}[2]{\text{mgu}(#1, #2)} \newcommand{\functor}[1]{\mathtt{#1}} \newcommand{\variable}[1]{\mathit{#1}} -\newcommand{\predication}[1]{\mathit{#1}} +\newcommand{\predication}[1]{\text{\textit{#1}}} \newcommand{\consdot}{\functor{~.~}} \newcommand{\fullstop}{\mathtt{.}} @@ -44,3 +44,4 @@ \newcommand{\optional}[1]{\grammar{(#1)}\questionmark} \newcommand{\twopkt}{\textsc{2P-Kt}} + diff --git a/ise-lab-knowledge-representation.tex b/ise-lab-knowledge-representation.tex index bc94a59..75a4fdb 100644 --- a/ise-lab-knowledge-representation.tex +++ b/ise-lab-knowledge-representation.tex @@ -14,7 +14,7 @@ % version \newcommand{\versionmajor}{0} \newcommand{\versionminor}{1} -\newcommand{\versionpatch}{4-dev} +\newcommand{\versionpatch}{5-dev} \newcommand{\version}{\versionmajor.\versionminor.\versionpatch} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \title[\currentLab{} -- Knowledge Representation]{Knowledge Representation with Horn Clauses} @@ -441,12 +441,6 @@ \subsubsection{Ancillary definitions} \end{block} \end{frame} -\begin{frame} - \todo[inline]{Exercise on term construction in \twopkt{}} - - \todo[inline]{Exercise on the construction of the first $N$ of the Herbrand universe for a given set of functors} -\end{frame} - \subsection{Predicates} \begin{frame}[allowframebreaks]{Predicates} @@ -747,7 +741,7 @@ \subsection{Horn Clauses} \begin{exampleblock}{How to read definite clauses} \centering - $\predication{mother(\variable{X}) \Leftarrow \predication{parent}(\variable{X}, \variable{Y}) \wedge \predication{female}(\variable{X})}$ + $\predication{mother}(\variable{X}) \Leftarrow \predication{parent}(\variable{X}, \variable{Y}) \wedge \predication{female}(\variable{X})$ \medskip @@ -755,7 +749,7 @@ \subsection{Horn Clauses} \medskip - $\predication{\alert{\forall \variable{X}} : mother(\variable{X}) \Leftarrow \alert{\exists \variable{Y}} : \predication{parent}(\variable{X}, \variable{Y}) \wedge \predication{female}(\variable{X})}$ + $\alert{\forall \variable{X}} : \predication{mother}(\variable{X}) \Leftarrow \alert{\exists \variable{Y}} : \predication{parent}(\variable{X}, \variable{Y}) \wedge \predication{female}(\variable{X})$ \medskip @@ -767,14 +761,6 @@ \subsection{Horn Clauses} \end{exampleblock} \end{frame} -\begin{frame} - \todo[inline]{Exercise writing the $sum/3$ relation for summing up Peano numbers} - - \todo[inline]{Exercise writing the $concat/3$ relation for concatenating two lists} - - \todo[inline]{Exercise model students, courses, exams, and marks, then identify the set of functors, and the set of predications, and the Herbrand universe} -\end{frame} - %=============================================================================== \section{Flexibility of Logic Representation} %=============================================================================== @@ -916,18 +902,343 @@ \subsection{Intensional vs. Extensional} \end{alertblock} \end{frame} -\begin{frame} - \todo[inline]{Exercise expressing the grandparenthood relation extensively} -\end{frame} - \subsection{Relational vs. Propositional} \begin{frame}[allowframebreaks]{Relational vs. Propositional Representations} + + \begin{block}{Propositional representations} + The natural way of representing knowledge in \alert{data science}: + % + \begin{itemize} + \item data is represented in \alert{tabular form} + % + \begin{itemize} + \item \alert{attribute--value}, bi-dimensional representation + \item $m$ columns, one per attribute + \item $n$ rows, one per instance + \end{itemize} + + \item this can be attained $n$ definite clauses, one per instance + % + \begin{itemize} + \item each one having a head of arity $m$ + \item where the $i^{th}$ argument of the head of the $j^{th}$ denotes the value of the $i^{th}$ attribute for the $j^{th}$ instance + \end{itemize} + \end{itemize} + \end{block} + + \begin{exampleblock}{Iris Dataset, in \textbf{propositional} form\cccite{uci:iris}} + \begin{itemize} + \item $\predication{iris}(\functor{flower1}, 5.1, 3.5, 1.4, 0.2, \functor{setosa}) \fullstop$ + \item[$\vdots$] + \item $\predication{iris}(\functor{flower82}, 5.5, 2.4, 3.7, 1.0, \functor{versicolor}) \fullstop$ + \item[$\vdots$] + \item $\predication{iris}(\functor{flower150}, 5.9, 3.0, 5.1, 1.8, \functor{virginica}) \fullstop$ + \end{itemize} + \end{exampleblock} + % + \begin{itemize} + \item Attributes names: + % + \begin{itemize} + \item[1.] identifier, \alert{2.} sepal length, \alert{3.} sepal width, \alert{4.} petal length, + \item[5.] petal width, \alert{6.} class + \end{itemize} + \end{itemize} + \begin{block}{Relational representations} - contenuto... + The natural way of representing knowledge in computational logic: + % + \begin{itemize} + \item constants represent individual entities or values + \item structures represent groups of composed entities + \item clauses represent sets of, or relations among, those entities + \end{itemize} + \end{block} + + \begin{exampleblock}{Iris Dataset, in \textbf{relational} form\cccite{uci:iris}} + \begin{multicols}{2} + \begin{itemize} + \item $\predication{iris}(\functor{flower1}) \fullstop$ + \item $\predication{sepal-length}(\functor{flower1}, 5.1) \fullstop$ + \item $\predication{sepal-width}(\functor{flower1}, 3.5) \fullstop$ + \item $\predication{petal-length}(\functor{flower1}, 1.4) \fullstop$ + \item $\predication{petal-width}(\functor{flower1}, 0.2) \fullstop$ + \item $\predication{class}(\functor{flower1}, \functor{setosa}) \fullstop$ + \item[$\vdots$] + \item $\predication{iris}(\functor{flower82}) \fullstop$ + \item $\predication{sepal-length}(\functor{flower82}, 5.5) \fullstop$ + \item $\predication{sepal-width}(\functor{flower82}, 2.4) \fullstop$ + \item $\predication{petal-length}(\functor{flower82}, 3.7) \fullstop$ + \item $\predication{petal-width}(\functor{flower82}, 1.0) \fullstop$ + \item $\predication{class}(\functor{flower82}, \functor{versicolor}) \fullstop$ + \item[$\vdots$] + \end{itemize} + \end{multicols} + \end{exampleblock} +\end{frame} + +\begin{frame}{Pros and cons} + \begin{columns} + \begin{column}{.48\linewidth} + \begin{block}{Propositional} + \begin{itemize} + \item[$\checkmark$] Table $\rightarrow$ matrix + % + \begin{itemize} + \item[$\rightarrow$] good for sub-symbolic processing + \end{itemize} + \item[$\checkmark$] Easy to count/add instances + \item[$\checkmark$] Easy to count attributes + \item[$\times$] Hard to add/remove attributes + \item[$\times$] Rigid schema + \end{itemize} + \end{block} + \end{column} + % + \begin{column}{.48\linewidth} + \begin{block}{Relational} + \begin{itemize} + \item[$\checkmark$] Supports $n$-ary relations s.t. $n\geq2$ + \item[$\checkmark$] Good for symbolic processing + \item[$\checkmark$] Easy to count/add instances + \item[$\checkmark$] Easy to add/remove attributes + \item[$\checkmark$] Flexible schema + \item[$\times$] Hard to count attributes + \end{itemize} + \end{block} + \end{column} + \end{columns} + % + \begin{center} + \alert{easy} $\rightarrow$ O(1) + \\ + \alert{hard} $\rightarrow$ O(n) + \end{center} +\end{frame} + +\begin{frame}{Relationalisation and Propositionalization\ccite{Lachiche2010}} + \begin{block}{Relationalisation} + \begin{itemize} + \item the operation of converting a propositional theory into a relational one + \item it is always possible + \end{itemize} + \end{block} + + \begin{block}{Propositionalisation} + \begin{itemize} + \item the operation of converting a relational theory into a propositional one + \item may be tricky if the relational theory has $n$-ary relations s.t. $n\geq3$ + \end{itemize} + \end{block} +\end{frame} + +%=============================================================================== +\section{About Horn Clauses in Prolog} +%=============================================================================== + +\begin{frame}{Prolog Overview} + \begin{itemize} + \item Most relevant language in the \alert{logic programming} playground + + \vfill + + \item The \alert{program} is a \alert{theory} of Horn clauses + % + \begin{itemize} + \item exploiting a compact notation (`\pl{:-}' instead of `$\Leftarrow$', `\pl{,}' instead of `$\wedge$') + \end{itemize} + + \vfill + + \item Execution consists of applying SLD+NaF to prove \alert{goals} against that theory + % + \begin{itemize} + \item goals are user-provided, a.k.a. \alert{queries} + \item all solutions are \alert{lazily} enumerated via \alert{backtracking} + \item solutions consists of variables' \alert{assignments} + \end{itemize} + + \vfill + + \item Several built-in predicates are commonly available for practical reasons + % + \begin{itemize} + \item Prolog is an actual programming language + \item quite more than a simple theorem prover + \end{itemize} + \end{itemize} +\end{frame} + +\subsection{Why Prolog is tricky} + +\begin{frame}[allowframebreaks]{Horn Clauses in Prolog} + \begin{block}{The Prolog trick} + \begin{itemize} + \item the \alert{exact same syntax} is used for both predicates and structures + \item making them interchangeable + \item hence supporting the definition of \alert{meta-predicates} + % + \begin{itemize} + \item[ie] predicates accepting other predicates as arguments + \end{itemize} + \end{itemize} + \end{block} + + \prologimport{listings/meta-predicates.pl} + + \begin{block}{Consequences of the Prolog trick} + \begin{itemize} + \item conjunctions are represented as structures whose functor is $\pl{,}/2$ + % + \begin{center} + \begin{tabular}{rcl} + \pl{(a, b)} & \qquad $\equiv$ \qquad & \pl{,(a, b)} + \\ + \pl{(a, b, c)} & \qquad $\equiv$ \qquad & \pl{,(a, ,(b, c))} + \\ + \pl{(a, b, c, d)} & \qquad $\equiv$ \qquad & \pl{,(a, ,(b, ,(c, d)))} + \end{tabular} + \end{center} + + \item clauses are represented as structures whose functor is $\pl{:-}/2$ + % + \begin{center} + \begin{tabular}{rcll} + \pl{a.} & \qquad $\equiv$ \qquad & \pl{:-(a, true)} & fact + \\ + \pl{a :- b.} & \qquad $\equiv$ \qquad & \pl{:-(a, b)} & rule + \\ + \pl{a :- b, c.} & \qquad $\equiv$ \qquad & \pl{:-(a, ,(b, c))} & rule + \\ + \pl{:- a, b, c.} & \qquad $\equiv$ \qquad & \pl{:-(,(a ,(b, c)))} & goal + \end{tabular} + \end{center} + \end{itemize} \end{block} \end{frame} +%=============================================================================== +\section{Practice} +%=============================================================================== + +\subsection{\tuprolog{} and \twopkt{}} + +\begin{frame}{\twopkt{} Overview} + \begin{itemize} + \item Multi-platform, Kotlin-based reboot of \tuprolog{} + % + \begin{center} + \alert{\url{https://github.com/tuProlog/2p-kt}} + \\ + \small(please star us on GitHub :) + \end{center} + + \vfill + + \item Multi-module architecture: each aspect of LP has its own module + % + \begin{itemize} + \item[eg] module \texttt{:core} supports \alert{terms and Horn clauses} + \item[eg] module \texttt{:parser-core} supports \alert{parsing} terms and Horn clauses + \item[eg] module \texttt{:theory} supports \alert{theories} of Horn clauses + \end{itemize} + + \vfill + + \item Far more than yet another Prolog interpreter + % + \begin{itemize} + \item it's an \alert{ecosystem} for logic programming and symbolic AI in general + \item LP functionalities are made available as re-usable \& extensible \alert{libraries} + \item a Prolog interpreter is available, but not only\ccite{dcc-aixia-2021-plp} + \end{itemize} + + \end{itemize} +\end{frame} + +\begin{frame}[allowframebreaks]{The \kt{it.unibo.tuprolog.core} package in \kt{:core}} + \begin{figure} + \centering + \includegraphics[width=.7\linewidth]{figures/term-hierarchy.pdf} + \caption{Term's type hierarchy in \twopkt{}} + \label{fig:term-hierarchy} + \end{figure} + + \framebreak + + \begin{itemize} + \item Set of interrelated interfaces for knowledge representation in \twopkt{} + + \bigskip + + \item \kt{Term} is the super-type of all terms and \alert{clauses} (Prolog trick) + % + \begin{description} + \item[\kt{Var}] --- type for logic variables + \item[\kt{Number}] --- type for numeric constants + \item[\kt{Atom}] --- type for alphanumeric constants (strings) + \item[\kt{Struct}] --- type for structures + \item[\kt{List}] --- type for lists + \item[\kt{Tuple}] --- type for conjunctions + \item[\kt{Clause}] --- type for clauses + \end{description} + + \framebreak + + \item All sub-types of \kt{Term}: + % + \begin{itemize} + \item are strictly \alert{immutable} (i.e. one cannot alter a term/clause) + \item come with a number of \alert{static factory} methods letting the user instantiate them + % + \begin{itemize} + \item most commonly \kt{.\alert{of}()} + \item they won't let you instantiate invalid terms or clauses :) + \item they guarantee the term to be of the \alert{most adequate} sub-type + \end{itemize} + \end{itemize} + + \bigskip + + \item In the following exercises you will mostly need to create terms + % + \begin{itemize} + \item use the map on figure \ref{fig:term-hierarchy} to know \alert{which} types exist + \item have a look to \cite{Ciatto20212pktPresentation} for detailed API description + \end{itemize} + \end{itemize} +\end{frame} + +\subsection{Exercises on terms} + +\begin{frame} + \todo[inline]{Exercise on term construction in \twopkt{}} + + \todo[inline]{Exercise on the construction of the first $N$ of the Herbrand universe for a given set of functors} +\end{frame} + +\subsection{Exercises on Horn clauses} + +\begin{frame} + \todo[inline]{Exercise writing the $sum/3$ relation for summing up Peano numbers} + + \todo[inline]{Exercise writing the $concat/3$ relation for concatenating two lists} + + \todo[inline]{Exercise model students, courses, exams, and marks, then identify the set of functors, and the set of predications, and the Herbrand universe} +\end{frame} + +\subsection{Exercises on representations} + +\begin{frame} + \todo[inline]{Exercise expressing the grandparenthood relation extensively} +\end{frame} + +\begin{frame} + \todo[inline]{Exercise Propositionalize the theory concerning Abraham's family tree} + \todo[inline]{Exercise write tabular dataset in logic propositional form, then convert it in relational form} +\end{frame} + %=============================================================================== \section*{} %=============================================================================== diff --git a/listings/meta-predicates.pl b/listings/meta-predicates.pl new file mode 100644 index 0000000..e8b7796 --- /dev/null +++ b/listings/meta-predicates.pl @@ -0,0 +1,7 @@ +not(Goal) :- Goal, !, fail. % negation as failure + +or(Goal, _) :- Goal. % disjunction (left case) +or(_, Goal) :- Goal. % disjunction (right right) + +if(Cond, Then, _) :- Cond, !, Then. % if-then-else (then case) +if(_, _, Else) :- Else. % if-then-else (else case) \ No newline at end of file