忍者ブログ

LAL 昭和な気まぐれ飛行機

LALのブログです。 http://eisl.kan-be.com/index.html

O-Prolog update

I updated O-Prolog to ver1.58.
http://eisl.kan-be.com/library/oprolog1.html
http://eisl.kan-be.com/library/oprolog1.html
Improvement
You can compile the library with the compiler.
The trouble of the C wrapper at the Raspai version was solved.
You can use wiringpi.

Usage of compiler.
O-Prolog Ver 1.58(Chika)
| ?- use_module(library(compiler)).
yes
| ?- compile_file('queens.pl ').
pass1
pass2
compiling test16
compiling test
compiling queen
compiling queen_2
compiling qdelete
compiling tail nodiag
invoke gcc
yes
|
reconsult and dynamic link.
| ?- ['queens.o'].
yes
| ?- time(test).
Elapsed Time=0.024888 (second)
no
| ?- time(test16).
Elapsed Time=0.379730 (second)
no
|


O-Prolog has some libraries. math list tree bitwise and dcg.
for example.
O-Prolog Ver 1.58(Chika)
| ?- use_module(library(math)).
yes
| ?- factorization(13123123232213,X).
X = [[53,1],[97,1],[131,1],[3301,1],[5903,1]]
yes
|
O-Prolog supports unicode and sift JIS.  On linux os , unicode is default. On windows, shift is default. you can change character sets.
| ?- current_prolog_flag(char_set,Y).
Y = sjis
yes
| ?- set_prolog_flag(char_set,unicode).
yes
|


usage of DCG
O-Prolog Ver 1.58(Chika)
| ?- use_module(library(dcg)).
yes
| s --> np,vp.
np --> det,n.
det -->[a].
n -->[dog].
n -->[postman].
vp --> v,np.
v -->[bites].
| | | | | | | ?- phrase(s,X).
X = [a,dog,bites,a,dog];
X = [a,dog,bites,a,postman];
X = [a,postman,bites,a,dog] ...


ISO-Prolog
O-Prolog aims for compatibility with ISO-Prolog.
We also aim for ISO-Prolog compliance on modules.
ISO/IEC 13211-1 
ISO/IEC 13211-2
PR

コメント

プロフィール

HN:
笹川
性別:
非公開

最新記事

P R