GithubHelp home page GithubHelp logo

learnprolognow / lpn Goto Github PK

View Code? Open in Web Editor NEW
78.0 78.0 251.0 3.15 MB

Learn Prolog Now LaTeX sources

License: Other

Python 11.84% Shell 0.41% Perl 0.95% TeX 82.04% PHP 0.91% CSS 0.30% Makefile 0.04% HTML 0.09% Hack 3.43%

lpn's People

Contributors

anniepoo avatar janwielemaker avatar jobos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lpn's Issues

Problem magic square

Hallo Guys

i am new in programming prolog. Now i have a problem to solve the a magic issue. This is the problem which i have to solve

/*Implement the a EA version of the "Magic Square" finder of size N in prolog including a makefile (make test shall test all cases) compressed into a ZIP or tgz file. Test your program from size N= 3 up to 9 (and more if possible) and find 5 new ones, that differ from wikipedia.

I would recommend, that you modify the "8-queens problem" finder or "the simple EA" accordingly.

Your group has to implement the magic square version equal to its group number mod(12).*/

Franklin magic square when it is a doubly even magic square with three further properties
(i) every bent diagonal adds to the magic constant,
(ii) every half row and half column starting at an outside edge adds to half the magic constant, and
(iii) the square is compact.

Thanks

Correction in the occurs check explanation

Given the example ?- father(X) = X. it states that:

Because the left hand term is the variable X , by clause 2 it decides that the terms do unify, and (in accordance with clause 2) instantiates X to the right hand side, namely father(X) .

I think it should say:

Because the right hand term is the variable X , by clause 2 it decides that the terms do unify, and (in accordance with clause 2) instantiates X to the left hand side, namely father(X) .

Left and right seems to be swapped.

"List as terms" section no longer applicable to SWI Prolog 7

Learn Prolog now 9.2 introduces the list constructors . and [] and gives some example code :
?- .(a,[]) == [a]. yes

In SWI Prolog 7, this example gives the error

ERROR: Stream user_input:25:1 Syntax error: Unexpected end of clause

After googling, I found the reason: http://www.complang.tuwien.ac.at/ulrich/iso-prolog/SWI7_and_ISO. SWI7 deviates from the Prolog standard a bit as it seems. The workaround in SWI 7 is using [|], such as: ?- [a|[]]==[a].
(please see SWI documentation). Maybe you should add an explanatory message to the LPN mentioned above.

_run script fails

From a fresh clone with no changes:

~/lpn $ scripts/_run
~/lpn ~/lpn
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./lpn.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/book.cls
Document Class: book 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/bk10.clo)) (./kcp.sty)
(./kcp-texts.sty
kpathsea: Running mktextfm cmss11
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cmss11
This is METAFONT, Version 2.7182818 (TeX Live 2019/Debian) (preloaded base=mf)


kpathsea: Running mktexmf cmss11
mf: /home/prophet/.texlive2019/texmf-var/fonts/source/public/sauter/cmss11.mf: successfully generated.
(/home/prophet/.texlive2019/texmf-var/fonts/source/public/sauter/cmss11.mf
(/usr/share/texlive/texmf-dist/fonts/source/public/sauter/b-cmss.mf
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/cmbase.mf)
(/usr/share/texlive/texmf-dist/fonts/source/public/sauter/c-cmss.mf)
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/roman.mf
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romanu.mf [65] [66]
[67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81]
[82] [83] [84] [85] [86] [87] [88] [89] [90])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romanl.mf [97] [98]
[99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111]
[112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/greeku.mf [0] [1]
[2] [3] [4] [5] [6] [7] [8] [9] [10])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romand.mf [48] [49]
[50] [51] [52] [53] [54] [55] [56] [57])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romanp.mf [36] [38]
[63] [62]) (/usr/share/texlive/texmf-dist/fonts/source/public/cm/romspl.mf
[16] [17] [25] [26] [27] [28])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romspu.mf [29] [30]
[31]) (/usr/share/texlive/texmf-dist/fonts/source/public/cm/punct.mf [33]
[60] [35] [37] [39] [40] [41] [42] [43] [44] [46] [47] [58] [59] [61] [64]
[91] [93] [96]) (/usr/share/texlive/texmf-dist/fonts/source/public/cm/accent.mf
[18] [19] [20] [21] [22] [23] [24] [32] [94] [95] [125] [126] [127])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romlig.mf [11] [12]
[13] [14] [15]) (/usr/share/texlive/texmf-dist/fonts/source/public/cm/comlig.mf
[34] [45] [92] [123] [124]) ) ) )
Font metrics written on cmss11.tfm.
Output written on cmss11.600gf (128 characters, 23740 bytes).
Transcript written on cmss11.log.
mktextfm: /home/prophet/.texlive2019/texmf-var/fonts/tfm/public/sauter/cmss11.tfm: successfully generated.

kpathsea: Running mktextfm cmss14
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cmss14
This is METAFONT, Version 2.7182818 (TeX Live 2019/Debian) (preloaded base=mf)


kpathsea: Running mktexmf cmss14
mf: /home/prophet/.texlive2019/texmf-var/fonts/source/public/sauter/cmss14.mf: successfully generated.
(/home/prophet/.texlive2019/texmf-var/fonts/source/public/sauter/cmss14.mf
(/usr/share/texlive/texmf-dist/fonts/source/public/sauter/b-cmss.mf
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/cmbase.mf)
(/usr/share/texlive/texmf-dist/fonts/source/public/sauter/c-cmss.mf)
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/roman.mf
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romanu.mf [65] [66]
[67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81]
[82] [83] [84] [85] [86] [87] [88] [89] [90])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romanl.mf [97] [98]
[99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111]
[112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/greeku.mf [0] [1]
[2] [3] [4] [5] [6] [7] [8] [9] [10])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romand.mf [48] [49]
[50] [51] [52] [53] [54] [55] [56] [57])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romanp.mf [36] [38]
[63] [62]) (/usr/share/texlive/texmf-dist/fonts/source/public/cm/romspl.mf
[16] [17] [25] [26] [27] [28])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romspu.mf [29] [30]
[31]) (/usr/share/texlive/texmf-dist/fonts/source/public/cm/punct.mf [33]
[60] [35] [37] [39] [40] [41] [42] [43] [44] [46] [47] [58] [59] [61] [64]
[91] [93] [96]) (/usr/share/texlive/texmf-dist/fonts/source/public/cm/accent.mf
[18] [19] [20] [21] [22] [23] [24] [32] [94] [95] [125] [126] [127])
(/usr/share/texlive/texmf-dist/fonts/source/public/cm/romlig.mf [11] [12]
[13] [14] [15]) (/usr/share/texlive/texmf-dist/fonts/source/public/cm/comlig.mf
[34] [45] [92] [123] [124]) ) ) )
Font metrics written on cmss14.tfm.
Output written on cmss14.600gf (128 characters, 30480 bytes).
Transcript written on cmss14.log.
mktextfm: /home/prophet/.texlive2019/texmf-var/fonts/tfm/public/sauter/cmss14.tfm: successfully generated.

kpathsea: Running mktextfm cmss14
mktextfm: /home/prophet/.texlive2019/texmf-var/fonts/tfm/public/sauter/cmss14.tfm already exists.
)
(/usr/share/texlive/texmf-dist/tex/latex/pstricks/pstricks.sty
(/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/tools/shellesc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/dvips.def))
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/pst-xkey.tex
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))))
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pstricks.tex
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pst-fp.tex
`pst-fp' v0.05, 2010/01/17 (hv))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.t
ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.t
ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
Loading pgffor.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code
.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonomet
ric.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.cod
e.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison
.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.
tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code
.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.
tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerari
thmetics.code.tex)))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)))
`PSTricks' v2.97  <2019/05/11> (tvz,hv)
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pstricks.con))
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pst-fp.tex))
(/usr/share/texlive/texmf-dist/tex/latex/pst-node/pst-node.sty
(/usr/share/texlive/texmf-dist/tex/generic/pst-node/pst-node.tex
 v1.42, 2019/03/03))
(/usr/share/texlive/texmf-dist/tex/latex/pst-tree/pst-tree.sty
(/usr/share/texlive/texmf-dist/tex/generic/pst-tree/pst-tree.tex
 v1.13, 2017/02/18(tvz,dg,hv)))
(/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)))
(/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)
(/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty)
Writing index file lpn.idx
(./LPNmacros.tex)
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
No file lpn.aux.
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/ot1ptm.fd) (./lpn.toc [5]
[6]) [7] (./preface2.tex [8] [9]) [10] (./preface.tex [11]

LaTeX Warning: Reference `L2.EX4' on page xii undefined on input line 69.

) [12] (./introduction.tex [13] [14] [15]) [16] (./chapter1.tex [1]

LaTeX Font Warning: Font shape `OT1/cmtt/m/rm' undefined
(Font)              using `OT1/cmtt/m/n' instead on input line 63.

[2] [3] [4] [5] [6] [7]

LaTeX Warning: Reference `CHAPTER10' on page 8 undefined on input line 360.

[8] [9] [10] [11]

LaTeX Warning: Reference `CHAPTER5' on page 12 undefined on input line 604.


LaTeX Warning: Reference `CHAPTER4' on page 12 undefined on input line 619.

[12] [13] [14] [15] [16]

LaTeX Warning: Reference `CHAPTER12' on page 17 undefined on input line 854.

[17] [18] (/usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd)

LaTeX Warning: Reference `L1.EX5' on page 19 undefined on input line 991.

) [19] [20] (./chapter2.tex [21] [22] [23] [24]

LaTeX Warning: Reference `CHAPTER1' on page 25 undefined on input line 227.

[25]

LaTeX Warning: Reference `CHAPTER1' on page 26 undefined on input line 275.

[26] [27] [28] [29]
Underfull \vbox (badness 1838) has occurred while \output is active [30]
[31] [32]

LaTeX Warning: Reference `CHAPTER7' on page 33 undefined on input line 644.

[33] [34]

LaTeX Warning: File `chap2-pspic1.ps' not found on input line 724.


! LaTeX Error: File `chap2-pspic1.ps' not found.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.724 \includegraphics{chap2-pspic1.ps}
                                       
? 

Exercise 2.2 doesn't work

Execrise 2.2 in chapter 2.3 Exercises is missing one fact. I guess it's going to be wizard(harry)... As it is, I get the following:

procedure `wizard(A)' does not exist
Reachable from:
	  magic(A)

Embedded examples get wrong quotes in swish

When I try running examples frpm exercise 2.2 in chapter 2.3, there's a problem with magic('McGonagall')., because it gets imported into swish with reverse quotes (` instead of ') and the result is:

Cannot run query due to a syntax error (check query window)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.