|Did you know ...||Search Documentation:|
|Pack pac -- prolog/other/note-on-pac.txt|
I have updated the package PAC to version 0.6.4, adding the files below among many other ones:
The favorite points of progresses are the following:
f(a) @ b => f(a, b) f(a) @ (g @ b) @ c => f(a, g(b), c) append @ [a,b] @ [c,d] => append([a,b], [c,d]]). f @ a1 @ a2 @ ... @ an => f(a1, a2..., an)
Due to the operation @, the PAC syntax and semantics now are clear, and close to that of standard Lisps. To explain them, let the symbol [[ e ]] means the semantics of a expression e:
[[ (f e1 e2 ... en) ]] = [[f]]( [[e1]], [[e2]], ..., [[en]] )
[[ f @ e1 @ e2 @ ... @ en ]] = [[f]]( [[e1]], [[e2]], ..., [[en]] )
(f e1 e2 ... en) ~ f @ e1 @ ... @ en
According to the correspondence, the term_expansion/2 in PAC is defined so that the following equivalence holds.
[[f]](x1, x2, ..., xn) = V
call(f(x1, x2, ..., xn), V) is true
The current version 0.6.4 seems clean, stable and usable as far as daily uses of mine. Although documentation on PAC is still poor (maybe forever), I hope some interested and patient readers would go into the PAC package. Also I would like to help them use and extend PAC freely for their purposes.
[2014/09/30] v0.5.5 initial version. [2014/10/02] v0.5.6 all sources are modules. [2015/03/31] v0.6.4 Syntax in BNF added.
The PAC library defines term_expansion/2, which implements following featues on SWI-Prolog develop version (> V7.1).
A sample usage:
maplist(pred([X,Y,X-Y]), [a,b,c],[1,2,3], R).
User's manual of the package is in preparation.
I will appreciate for any comment or feedback.
Kuniaki Mukai mukai at sfc.keio.ac.jp / kuniaki.mukai at gmail.com
Application as Term Completion
[2015/03/25] http://www.univcoop.jp/keio/info/procedure.html ã223-0061ãç¥å¥å·çæ¨ªæµå¸æ¸¯ååºæ¥å4-1-1 TEL 045-563-8489 / FAX 045-562-6433 çµåå¡è¨¼ åäººçªå·091113
I have made a silent update on the package PAC to version 0.6.3.
Now finally PAC has reached to clean and coherent syntax and alos semantics, which is a main reason of the update.
I have included many SWI-Prolog/PAC files using pac macros into the package. For instance, a file pac/fol.pl may be a non trivial sample codes using conditional equations, which is one of main features of PAC. The fol.pl is, in theory, a complete implementation of a first-order prover based on linear ancestor resolution.
Documetation of PAC is still poor, but I have added a memo of some length on PAC syntax and some sample queries.
By the way, about SWI-Prolog version 7, I have found a merit of the compound zero arity term while writing codes for send/receive streams in emacs-lisp process, actually I have written a short and clean transaltion between S-Expression and Prolog v7 term.
p.s. sample session of PAC ( on Mac OSX 10).
X = [, [3, 1], [3, 2, 1], [3, 2], , [2, 1], , ] .
pac: ?- val(([X,Y] \ (
append(Y,X))) @[1,2,3]@[a,b,c], R).
R = [a, b, c, 1, 2, 3].
pac: ?- val(
fun([X, Y] -> append(X, Y))@[1,2,3]@[a,b,c], R).
R = [1, 2, 3, a, b, c].
X = hello.
call(pred([A], [F, Y]:- Y =..[F, A]), f, R), A = a.
A = a,