-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathplingo-example.tex
57 lines (51 loc) · 1.57 KB
/
plingo-example.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
% ----------------------------------------------------------------------
\begin{frame}[fragile]{Example}{Birds in \textit{lpmln}}
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north east,xshift=-1em,yshift=-2cm] at (current page.north east){%
\includegraphics[width=.4\textwidth]{birds}};
\end{tikzpicture}
\begin{lstlisting}[escapeinside=||]
bird(X) :- resident(X).
bird(X) :- migratory(X).
:- resident(X), migratory(X).
resident(jo) :- &weight(2).
migratory(jo) :- &weight(1).
&query(resident(jo)).
\end{lstlisting}
\end{frame}
% ----------------------------------------------------------------------
\begin{frame}[fragile]{Example}{Birds in \textit{lpmln}}
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north east,xshift=-1em,yshift=-2cm] at (current page.north east){%
\includegraphics[width=.4\textwidth]{birds-resident}};
\end{tikzpicture}
\begin{adjustbox}{max totalsize={\textwidth}{.75\textheight},keepaspectratio}
\begin{lstlisting}[escapeinside=||]
$ plingo birds.plp --frontend=lpmln-alt
plingo version 1.0.0
Reading from birds.plp
Solving...
Answer: 1
Optimization: 300000
Answer: 2
resident(jo) bird(jo)
Optimization: 100000
Answer: 3
migratory(jo) bird(jo)
Optimization: 200000
resident(jo): 0.66524
OPTIMUM FOUND
Models : 3
Optimum : yes
Calls : 1
Time : 0.002s (Solving: 0.00s 1st Model: 0.00s Unsat: 0.00s)
CPU Time : 0.002s
\end{lstlisting}
\end{adjustbox}
\end{frame}
% ----------------------------------------------------------------------
%
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../../main"
%%% End: