You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(23) |
Nov
(29) |
Dec
(21) |
2007 |
Jan
(48) |
Feb
(9) |
Mar
(49) |
Apr
(49) |
May
(33) |
Jun
(28) |
Jul
(34) |
Aug
(51) |
Sep
(52) |
Oct
(26) |
Nov
(15) |
Dec
(26) |
2008 |
Jan
(21) |
Feb
(22) |
Mar
(19) |
Apr
(35) |
May
(23) |
Jun
(62) |
Jul
(11) |
Aug
(20) |
Sep
(35) |
Oct
(46) |
Nov
(22) |
Dec
(3) |
2009 |
Jan
(45) |
Feb
(59) |
Mar
(24) |
Apr
(19) |
May
(10) |
Jun
(17) |
Jul
(16) |
Aug
(30) |
Sep
(41) |
Oct
(55) |
Nov
(37) |
Dec
(18) |
2010 |
Jan
(13) |
Feb
(103) |
Mar
(64) |
Apr
(134) |
May
(35) |
Jun
(47) |
Jul
(31) |
Aug
(27) |
Sep
(29) |
Oct
(6) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(20) |
Feb
(6) |
Mar
(8) |
Apr
(19) |
May
(36) |
Jun
(23) |
Jul
(10) |
Aug
(14) |
Sep
(54) |
Oct
(15) |
Nov
(29) |
Dec
(19) |
2012 |
Jan
(20) |
Feb
(11) |
Mar
(21) |
Apr
(7) |
May
(17) |
Jun
(3) |
Jul
(9) |
Aug
(10) |
Sep
(19) |
Oct
(46) |
Nov
(22) |
Dec
(3) |
2013 |
Jan
(6) |
Feb
(27) |
Mar
(9) |
Apr
(13) |
May
(9) |
Jun
(18) |
Jul
(33) |
Aug
(32) |
Sep
(10) |
Oct
(16) |
Nov
(3) |
Dec
(16) |
2014 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(3) |
May
(5) |
Jun
(4) |
Jul
(1) |
Aug
(13) |
Sep
(9) |
Oct
(5) |
Nov
(12) |
Dec
(39) |
2015 |
Jan
(14) |
Feb
(15) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(12) |
Jul
(6) |
Aug
|
Sep
(1) |
Oct
(15) |
Nov
(6) |
Dec
(5) |
2016 |
Jan
|
Feb
(11) |
Mar
(17) |
Apr
|
May
(1) |
Jun
(6) |
Jul
(3) |
Aug
(1) |
Sep
(9) |
Oct
|
Nov
(7) |
Dec
|
2017 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(6) |
Jul
|
Aug
(3) |
Sep
(6) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2018 |
Jan
(1) |
Feb
(8) |
Mar
|
Apr
(5) |
May
(4) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2019 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(1) |
Nov
(1) |
Dec
(5) |
2020 |
Jan
(1) |
Feb
|
Mar
(3) |
Apr
(6) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
(4) |
May
|
Jun
(13) |
Jul
(10) |
Aug
(4) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(1) |
2022 |
Jan
(1) |
Feb
(4) |
Mar
(1) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
(5) |
2023 |
Jan
|
Feb
(6) |
Mar
(11) |
Apr
(3) |
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2024 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
(2) |
Sep
(3) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2025 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Paulo M. <pm...@di...> - 2006-11-08 23:20:28
|
On 2006/11/08, at 13:55, Joachim Schimpf wrote: >> My question now is how can I write in a file line by line. > > writeln/2, nl/1 or printf/3. Please try not to use proprietary predicates such as writeln/2. They can be a pain whew porting Prolog code. Cheers, Paulo ----------------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Computer Science, University of Beira Interior 6201-001 Covilhã, Portugal Office 4.3 Ext. 3257 Phone: +351 275319891 Fax: +351 275319899 Email: <mailto:pm...@di...> Home page: <http://www.di.ubi.pt/~pmoura> Research: <http://logtalk.org/> ----------------------------------------------------------------- |
From: Joachim S. <js...@cr...> - 2006-11-08 21:55:31
|
J. Manuel Velasco wrote: > Hello all, > > My question now is how can I write in a file line by line. writeln/2, nl/1 or printf/3. -- Joachim |
From: J. M. V. <jve...@gu...> - 2006-11-08 16:33:32
|
Hi William, I would like to redirect to a site that maybe can be good for you to take a look: http://catb.org/esr/faqs/smart-questions.html Don't let you carry on by the tittle, I think is not the best, but I suggest you have a look. At http://eclipse.crosscoreop.com/ the same URL where it's the documentation there is another link called Download where you can download the eclipse environment and install it. Good look, Regards, -_· manou El Martes, 7 de Noviembre de 2006 19:25, William Heath escribió: > Thanks!!! Can you give me the full eclipse program to do this example? > > On 11/7/06, J. Manuel Velasco <jve...@gu...> wrote: > > Hello William, > > > > I am glad to guide you to the eclipse CHR tutorial, but I am a newbie so > > I don't think I will be able to help you a lot. > > > > Somebody explain me how CHRs work, the right syntax you'll find at the > > eclipse tutorial that you will find in the following URL: > > > > http://www.eclipse-clp.org/ > > > > Go to the link Documentation, then Eclipse Tutorial Documentation and > > finally > > you will see the chapter: Propia and CHR. > > > > What a kind man explained to me from swi-prlog list (I don't put his > > address > > to respect him) about CHRs and Prolog was that: > > > > The thing for you to be aware of is that this code combines basic prolog > > code > > with CHR code. > > Basic prolog code is > > > > s(B,C,D) :- s1, s2, s3. > > > > The logical interpretation is that s is true when s1, s2 and s3 are true. > > The execution is to evaluate the parameters in order. > > > > CHR code looks like this: > > > > constraint1, constraint2 <=> test | prolog_code, constraint3. > > constraint1, constraint2 ==> test | prolog_code. > > > > The first line says, if constraint1 and constraint2 exist, and test is > > true, > > then drop > > constraint1 and constraint2, evaluate prolog_code, and add > > constraint3. The > > second line > > says, if constraint1 and constraint2 exist, and test is true, then > > evaluate > > prolog_code (and > > drop nothing). > > > > Take care, > > -_· manou |
From: Joachim S. <js...@cr...> - 2006-11-08 10:02:07
|
J. Manuel Velasco wrote: > > // Try to call the prolog main function defined in prologCode > post_goal(term(EC_functor("main",4), A,B,C,D, Result)); main/4 has 4 arguments, but you are giving 5: A,B,C,D,Result. > if (EC_resume() == EC_succeed) > { > // Asingnation error > // prologOutput = Result; My previous mails contained sample code for how to test types and get return values from the EC_refs. See also http://eclipse-clp.org/eclipse/doc/embedding/embroot009.html#toc16 > [eclipse 2]: main(A,B,C,D). > lists.eco loaded traceable 0 bytes in 0.00 seconds > > A = A > B = B > C = C > D = D > > > Constraints: > (2) ctr_orient(1, C_255, A_269, B_283, [lm], 1) > (4) ctr_orient(1, D_1187, C_255, B_283, [lm], 1) > (5) ctr_orient(3, D_1187, A_269, B_283, [lf, l, lm], 2) > (9) ctr_orient(5, D_1187, C_255, A_269, [lm, ibl, bl, sb, br], 2) > Yes (0.01s cpu) > > But from C++ I don't know how to get the result of the CHR execution. This is not a "result". A result is when A,B,C,D have values and there are no more pending constraints. You have to think properly what kind of data you want to return to C++ (strings, numbers, whatever). Then you compute that data in Eclipse and instantiate your main goal's output variables to those results. Then you extract these variable values from the corresponding EC_refs in C++. Keep in mind that C++ has no idea about logical variables or constraints, so deal with these things on the Eclipse side, and pass only simple data types across the C++/Eclipse boundary. Some general remarks about Eclipse embedding are here: http://eclipse-clp.org/eclipse/archive/eclipse-users/0823.html -- Joachim |
From: J. M. V. <jve...@gu...> - 2006-11-07 17:06:10
|
Hello William (and the rest), If you know something about I put the question I will be gratefull you to give me a hand. My directrice is stressing me. Thanks El Lunes, 6 de Noviembre de 2006 20:19, escribió: > Hi Manou, > > I am very interested in using CHR with eclipse, could you point me to a > tutorial or just tell me how to do a simple program in eclipse that utlizes > CHR? > > On 11/6/06, J. Manuel Velasco <jve...@gu...> wrote: > > Hello all, > > > > My directrice has told me that it could be good to write to a file the > > CHRs at > > the same time they trigger, but I am not sure if I can do that. > > > > What she wants to is someting like: > > > > ctr_orient(C,A,B,Rel) <=> length(Rel,N) | ctr_orient(N,C,A,B,Rel,1), > > <write to > > a file the ctr_orient(...)>. > > > > ctr_orient(N1,C,A,B,R1,I),ctr_orient(N2,D,B,C,R2,J) ==> I=1, > > composition_op(R1,R2,R3), length(R3,N3), K is I+J | > > ctr_orient(N3,D,A,B,R3,K), <write to a file the ctr_orient(...)>. > > > > and so... > > > > > > She had this idea to read that file from C/C++ after. > > > > > > I was looking for some reference to do that, but i can't find anything. > > Can > > somebody give me a reference or tell me if this is posible, please? > > > > Or maybe it is an invention from my directrice ?¿ > > > > Thank in advance. > > > > ·_· manou > > > > _______________________________________________ > > ECLiPSe-Users mailing list > > ECL...@cr... > > http://www.crosscoreop.com/mailman/listinfo/eclipse-users |
From: J. M. V. <jve...@gu...> - 2006-11-07 17:01:56
|
Hello William, I am glad to guide you to the eclipse CHR tutorial, but I am a newbie so I don't think I will be able to help you a lot. Somebody explain me how CHRs work, the right syntax you'll find at the eclipse tutorial that you will find in the following URL: http://www.eclipse-clp.org/ Go to the link Documentation, then Eclipse Tutorial Documentation and finally you will see the chapter: Propia and CHR. What a kind man explained to me from swi-prlog list (I don't put his address to respect him) about CHRs and Prolog was that: The thing for you to be aware of is that this code combines basic prolog code with CHR code. Basic prolog code is s(B,C,D) :- s1, s2, s3. The logical interpretation is that s is true when s1, s2 and s3 are true. The execution is to evaluate the parameters in order. CHR code looks like this: constraint1, constraint2 <=> test | prolog_code, constraint3. constraint1, constraint2 ==> test | prolog_code. The first line says, if constraint1 and constraint2 exist, and test is true, then drop constraint1 and constraint2, evaluate prolog_code, and add constraint3. The second line says, if constraint1 and constraint2 exist, and test is true, then evaluate prolog_code (and drop nothing). Take care, -_· manou |
From: J. M. V. <jve...@gu...> - 2006-11-06 23:51:00
|
Hello all, My directrice has told me that it could be good to write to a file the CHRs at the same time they trigger, but I am not sure if I can do that. What she wants to is someting like: ctr_orient(C,A,B,Rel) <=> length(Rel,N) | ctr_orient(N,C,A,B,Rel,1), <write to a file the ctr_orient(...)>. ctr_orient(N1,C,A,B,R1,I),ctr_orient(N2,D,B,C,R2,J) ==> I=1, composition_op(R1,R2,R3), length(R3,N3), K is I+J | ctr_orient(N3,D,A,B,R3,K), <write to a file the ctr_orient(...)>. and so... She had this idea to read that file from C/C++ after. I was looking for some reference to do that, but i can't find anything. Can somebody give me a reference or tell me if this is posible, please? Or maybe it is an invention from my directrice ?¿ Thank in advance. ·_· manou |
From: J. M. V. <jve...@gu...> - 2006-11-06 20:40:54
|
Dear Joachim, Thanks to you I am advancing in this task. What I really need to execute in prolog from C++ are CHRs. I've create an unique file to compile from C++ two files: %----------------------------- % prologCode.pl :- [orientacion_main,orientacion_chr]. main(A,B,C,D) :- ctr_orient(C,A,B,[lm]),ctr_orient(D,C,B,[lm]). %----------------------------- "orientacion_chr" is the result to execute chr2pl. The C++ file is the following: % orientacion.cc main() { ec_init(); post_goal(term(EC_functor("compile",1),"prologCode")); if (EC_resume() != EC_succeed) { cout << "Compilation failed\n"; exit(-1); } EC_ref Result; EC_ref A,B,C,D; string prologOutput; // Try to call the prolog main function defined in prologCode post_goal(term(EC_functor("main",4), A,B,C,D, Result)); if (EC_resume() == EC_succeed) { // Asingnation error // prologOutput = Result; cout << prologOutput; post_goal(EC_atom("fail")); } else { cout << "goal failed" << endl; } // There is no operator<< defined to EC_ref type. //cout << prologOutput << endl; ec_cleanup(); } If I make this process in eclipse it works fine: [eclipse 1]: [prologCode]. orientacion_main.pl compiled traceable 50264 bytes in 0.00 seconds chr2pl.eco loaded traceable 0 bytes in 0.01 seconds chr.eco loaded traceable 0 bytes in 0.02 seconds orientacion_chr.pl compiled traceable 153508 bytes in 0.05 seconds prologCode.pl compiled traceable 200 bytes in 0.05 seconds Yes (0.05s cpu) [eclipse 2]: main(A,B,C,D). lists.eco loaded traceable 0 bytes in 0.00 seconds A = A B = B C = C D = D Constraints: (2) ctr_orient(1, C_255, A_269, B_283, [lm], 1) (4) ctr_orient(1, D_1187, C_255, B_283, [lm], 1) (5) ctr_orient(3, D_1187, A_269, B_283, [lf, l, lm], 2) (9) ctr_orient(5, D_1187, C_255, A_269, [lm, ibl, bl, sb, br], 2) Yes (0.01s cpu) But from C++ I don't know how to get the result of the CHR execution. I am still trying to find the way. Any help/guide will be really appreciate again. Thanks a lot. Your sincerely, ·_- manou |
From: David T. <D.T...@po...> - 2006-11-03 23:23:35
|
Hi, The following code is a latex source which presents a model with 128481 variables, 73601 constraints. It has been implemented in ECLiPse using FD library, but setting up the model only without computing for solutions already consumes a lot of CPU power and takes alot of memory several GB. I am wondering whether it is possible to re-model it in a better way using less no. of constraints. BTW, Constraints (3) contributes alot to the model complexity: there are 70400 constraints of (3). I would really appreciate any help. I am sorry about the inconvience that the latex source is provided. This is the only way to show my model. Many thanks and Best Regards, David \documentclass{article}[12pt] \title{Model Simplification} \begin{document} \maketitle \section{The Model} Variables: B1 is a 2-d matrix of boolean variables. Dimensions of B1 are 44 and 30. B2 is a 2-d matrix of boolean variables. The dimensions of B2 are 1600 and 44. B3 is a 1-d matrix of boolean variables. Its dimension is 1600. S is varible.\\ Domains: Domains of all the boolean variables are $\{0,1\}$. The domain of S is $\{1,2,3,\ldots,44\}$.\\ Integer values: D is a 3-d matrix of integer values with dimension 44, 1600 and 30 so that D[a][p][i] refers to the item of D at the ath, pth and ith position. \begin{tabbing} \label{eq} for\=(p=1,$p<1600$,p++)$\{$\\ \> for\=(a=1,$a<44$,a++)$\{$\\ \> \> $B2[p][a] \Leftrightarrow \sum_{i = 1,2,\ldots,30} B1[a][i]*D[a][p][i] > 0$ (1)\\ \>$\}$\\ \>$B3[p]\Leftrightarrow \sum_{a=1,2,\ldots,44} B2[p][a] = 1$ (2)\\ \>$\sum_{a=1,2,3,\ldots,44}B2[p][a] \geq 1$ (3)\\ $\}$\\ $\sum_{p = 1,2,3,\ldots,1600}B3[p] = S$ (4)\\ minimize: f = S/44 \end{tabbing} \section{Number of Variables, Constraints and Search Space Size} Total number of variables = 44*30 + 1600*44 + 1600 + 1 = 128481. \\ Search space size = $2^{130086}$.\\ The total number of constraints = 1600*44 (constraints 1) + 1600 (constraints 2) + 1600 (constraints 3) + 1 (constraint 4) = 73601.\\ \end{document} |
From: Joachim S. <js...@cr...> - 2006-11-03 19:30:33
|
J. Manuel Velasco wrote: > ... > post_goal(term(EC_functor("es_hermano",2), "daniel", Result)); This is equivalent to the query ?- es_hermano("daniel", Result). which fails because daniel \= "daniel" (one is an atom, the other one a string type). You'd have to write instead post_goal(term(EC_functor("es_hermano",2), EC_atom("daniel"), Result)); > { > long i; > if (EC_word(Result).is_long(&i) == EC_succeed) > cout << i << "\n"; > else > cout << "unexpected result type"; > } Because you are now expecting Result to be an atom, you have to change this code accordingly, e.g. { EC_atom a; if (EC_word(Result).is_atom(&a) == EC_succeed) cout << a.name() << "\n"; else cout << "unexpected result type"; } -- Joachim |
From: J. M. V. <jve...@gu...> - 2006-11-03 18:59:12
|
El Martes, 31 de Octubre de 2006 22:03, Joachim Schimpf escribió: > J. Manuel Velasco wrote: > > Can't I compile the prolog code like that: > > post_goal(term(EC_functor("compile", 1), "familia")); > > > > and then make questions from C/C++ ??? > > Here is an example (on Linux): > ... Dear Joachim, Thanks a lot to give me a hand and on GNU/Linux, the system we love ;) I really appreciate because I feel desesperate with this issue. I have tried you code and works fine, although there is always a 'but'. When I try to update to get my goal, I start little by little with a family tree example. And although the code executes fine, I obtain results not expected. Here is the prolog code. % prolog file: family.pl padre(juan,juanma). padre(javier,eduardo). padre(pedro, pascual). padre(daniel,juanma). es_hermano(X,Y):- padre(X,Z),padre(Y,Z). Here is the C++ code updated from your code to my needs. // C++ file #include "eclipseclass.h" #include <iostream> using namespace std; main() { ec_init(); post_goal(term(EC_functor("compile",1),"family")); if (EC_resume() != EC_succeed) { cout << "Compilation failed\n"; exit(-1); } EC_ref Result; //post_goal(term(EC_functor("twice",2), 123, Result)); post_goal(term(EC_functor("es_hermano",2), "daniel", Result)); if (EC_resume() == EC_succeed) { long i; if (EC_word(Result).is_long(&i) == EC_succeed) cout << i << "\n"; else cout << "unexpected result type"; } else { cout << "goal failed" << endl; } ec_cleanup(); } In the eclipse environment I get what I expect: [eclipse 3]: es_hermano(juan,daniel). Yes (0.00s cpu) But executing the C++ code I always get: manou@acad5071act:~/test$ ./eg_cc_basic goal failed I am studing your foo.ecl code in eclipse to try to understand the right use. I saw I can use twice as a function that returns the double - using a variable -, or I can ask if one parameter is the double of the other and returns yes or not. Anyway, I don't get what I am doing wrong. When you have time and if that doesn't bother to you too much I would appreciate your guide. Thanks for your time in advance. Best Regards, ·_· manou > -- Joachim > > _______________________________________________ > ECLiPSe-Users mailing list > ECL...@cr... > http://www.crosscoreop.com/mailman/listinfo/eclipse-users |
From: Joachim S. <j.s...@cr...> - 2006-11-01 08:31:35
|
Zhou Xu wrote: > According to the ReadME_WIN.txt: > === > The important files are in <eclipsedir>\lib\i386_nt: > > eclipse.exe ECLiPSe standalone executable (needs eclipse.dll) > eclipse.dll ECLiPSe linkable library > eclipse.lib ECLiPSe linkable library stubs > eclipse.def Export specification of the dll > eclipse.reg Registry file for use with regedit > == > > However, I can't find .reg and .lib > > How can I use functions in eclipose.h (or eclipse.lib)? > > It is said that "cannot open eclipse.lib" in MFC I guess here we could use some help from the user community. Unlike earlier versions, the ECLiPSe 5.10 binaries for Windows are not produced with a MS compiler, but cross-compiled via MinGW. We distribute an eclipse.dll.a file which can be used to link using the gnu linker, but this is not the same as a MS .lib file. In principle, it should be possible to use MS's LIB utility to create an eclipse.lib file from eclipse.dll and eclipse.def (see e.g. http://www.mingw.org/MinGWiki/index.php/MSVC-MinGW-DLL), but some sources (http://wyw.dcweb.cn/stdcall.htm) suggest that this might not be so straightforward when different calling conventions are involved (the eclipse dll contains both stdcall and cdecl functions - all the basic ones are stdcall). I don't have a Microsoft development environment set up at the moment, so I'd be grateful if someone else could shed some light on this issue. -- Joachim |
From: Joachim S. <j.s...@cr...> - 2006-11-01 05:04:21
|
J. Manuel Velasco wrote: > > Can't I compile the prolog code like that: > post_goal(term(EC_functor("compile", 1), "familia")); > > and then make questions from C/C++ ??? Here is an example (on Linux): % file foo.ecl twice(X,Y) :- Y is 2*X. // file ex.cc #include "eclipseclass.h" #include <iostream> using namespace std; main() { ec_init(); post_goal(term(EC_functor("compile",1),"foo")); if (EC_resume() != EC_succeed) { cout << "Compilation failed\n"; exit(-1); } EC_ref Result; post_goal(term(EC_functor("twice",2), 123, Result)); if (EC_resume() == EC_succeed) { long i; if (EC_word(Result).is_long(&i) == EC_succeed) cout << i << "\n"; else cout << "unexpected result type"; } else { cout << "goal failed"; } ec_cleanup(); } Compile the C++ file (change path names according to your installation): % g++ -o ex ex.cc -I/vol/Eclipse/5.10_33/include/i386_linux -L/vol/Eclipse/5.10_33/lib/i386_linux -leclipse Run the resulting executable ex: asterix% LD_LIBRARY_PATH=/vol/Eclipse/5.10_33/lib/i386_linux ECLIPSEDIR=/vol/Eclipse/5.10_33 ./ex 246 -- Joachim |
From: Kish S. <kis...@cr...> - 2006-10-31 23:41:30
|
Hi, On Friday 27 October 2006 15:57, J. Manuel Velasco wrote: > Hi Kish, > > Thanks for your reply. > > I've tried your trick, but I don't get nothing. > > This is what I try: > > /* LICENSE BLock > ... > */ > > #include "eclipseclass.h" > #include <iostream> > > using namespace std; > > main() > { > char buf[1024]; > int n; > > ec_set_option_int(EC_OPTION_IO, MEMORY_IO); > ec_init(); > > // orientacion_main is a Prolog file > post_goal(term(EC_functor("compile", 1), "orientacion_main")); > > // orientacion is a Prolog file got it after processing the CHR file with > chr2pl command > post_goal(term(EC_functor("compile", 1), "orientacion")); > > // This is the query I want to pass to prolog. > // I need to do it like that because I get strings like that after > // an image processing from a C++ controller > ec_post_string("ctr_orient(C,A,B,[lm]),ctr_orient(D,C,B,[lm])"); > > ec_resume(); > > n = ec_queue_read(1, buf, 1024); > buf[n] = 0; > cout << "eclipse returned: " << buf << ".\n"; > > n = ec_queue_read(2, buf, 1024); > buf[n] = 0; > cout << "eclipse error returned: " << buf << ".\n"; > > ec_cleanup(); > exit(0); > } > > > And when I compile and execute it, nothing happends: > > manou@acad5071act:~/test$ make > g++ -O -I/home/manou/eclipse/include/i386_linux -c eg_cc_basic.cc > g++ eg_cc_basic.o -L/home/manou/eclipse/lib/i386_linux -leclipse -lgmp > -L/home/manou/eclipse/tcltk/i386_linux/lib -L. -lnsl -ldl -lieee -lm -s > -Wl,--export-dynamic -o eg_cc_basic > manou@acad5071act:~/test$ ./eg_cc_basic > eclipse returned: . > eclipse error returned: . > > Thanks in advance for any comment. > I don't think anything would be sent to either output (1) or the error (2) streams for your program -- ec_post_string() should only be used for goals you don't want output for. Unless you have special need to manipulate ECLiPSe data structures in your C/C++ code, you should also avoid them in your C/C++ code, it is quite difficult to do, and easy to get wrong. It is better to leave the complex data structures on the ECLiPSe side if you can, and wrap any complex query you have in a simpler goal you call from C/C++, looking something like: my_c_call(Data) :- do_my_eclipse_query(Data, Result), writeln(output, Result). where do_my_eclipse_query is the actual ECLiPSe goal(s) you want to run, and Result is the final result(s) you want to see. Of course Data and Result in do_my_eclipse_query may be arranged as you need it in your code. You then call my_c_call(Data) from C/C++, using ec_post_string(). By the way, you seem to be using lib(chr) instead of the newer lib(ech): ech should generate code that runs faster than chr, and it also does not need the extra step of chr2pl to compile CHR code. [See the end of the chapter on CHR in the library manual for information on lib(ech)] Cheers, Kish > > El Viernes, 27 de Octubre de 2006 14:32, Kish Shen escribió: > > post_goal(term(EC_functor("compile", 1), "orientacion")); > > _______________________________________________ > ECLiPSe-Users mailing list > ECL...@cr... > http://www.crosscoreop.com/mailman/listinfo/eclipse-users > |
From: J. M. V. <jve...@gu...> - 2006-10-31 23:02:49
|
Hello all again, I am studing the interface between Prolog and C/C++ to achieve execute some constraints from C/C++. The constraints and other prolog needed for the definition of this constraints were implemented for eclipse. The first idea was compile this code and execute the constraints with the interface but i don't see the way. Looking the chapter "Managing Data and Memory in Mixed-Language Applications", I saw that there are special ways to define prolog code from C/C++, so I put the question to myself that maybe the way to achieve what I need is rewrite the Prolog code in the way of terms, atoms, etc I mean, EC_functor, EC_atom and so... in a C/C++ program. Is like that? Can't I compile the prolog code like that: post_goal(term(EC_functor("compile", 1), "familia")); and then make questions from C/C++ ??? Please I feel really lost, any help or guide will be really appreciate. Thanks in advance. Best Regards, J.Manuel Velasco Martínez - Cognition for Robotics Research [http://www.c4r2.uji.es] Universitat Jaume I |
From: J. M. V. <jve...@gu...> - 2006-10-30 20:53:17
|
Hello, No, I am sorry. I am not that manou. When I start writing my name in this way I thought I would be the only... but then I realise that no,... ;) For use chr2pl you have to: 1) load the library: lib(chr) 2) execute the command: chr2pl(fileWithCHRExtension) 3) compile the Prolog file generated: [fileGenerated]. fileWithCHRExtension must be the prlog constraints file and the file generated will have the same name but with pl extension. Try it ;) Good luck. Cheers, ·_· manou El Viernes, 27 de Octubre de 2006 19:07, escribió: > Are you manou from tinyerp by chance? By the way I would love to get some > help understand how to use chr2pl, can you help me to understand that more? > > Thanks, > > Tim > > On 10/27/06, J. Manuel Velasco <jve...@gu...> wrote: > > Hi Kish, > > > > Thanks for your reply. > > > > I've tried your trick, but I don't get nothing. > > > > This is what I try: > > > > /* LICENSE BLock > > ... > > */ > > > > #include "eclipseclass.h" > > #include <iostream> > > > > using namespace std; > > > > main() > > { > > char buf[1024]; > > int n; > > > > ec_set_option_int(EC_OPTION_IO, MEMORY_IO); > > ec_init(); > > > > // orientacion_main is a Prolog file > > post_goal(term(EC_functor("compile", 1), "orientacion_main")); > > > > // orientacion is a Prolog file got it after processing the CHR file > > with > > chr2pl command > > post_goal(term(EC_functor("compile", 1), "orientacion")); > > > > // This is the query I want to pass to prolog. > > // I need to do it like that because I get strings like that after > > // an image processing from a C++ controller > > ec_post_string("ctr_orient(C,A,B,[lm]),ctr_orient(D,C,B,[lm])"); > > > > ec_resume(); > > > > n = ec_queue_read(1, buf, 1024); > > buf[n] = 0; > > cout << "eclipse returned: " << buf << ".\n"; > > > > n = ec_queue_read(2, buf, 1024); > > buf[n] = 0; > > cout << "eclipse error returned: " << buf << ".\n"; > > > > ec_cleanup(); > > exit(0); > > } > > > > > > And when I compile and execute it, nothing happends: > > > > manou@acad5071act:~/test$ make > > g++ -O -I/home/manou/eclipse/include/i386_linux -c eg_cc_basic.cc > > g++ eg_cc_basic.o -L/home/manou/eclipse/lib/i386_linux -leclipse -lgmp > > -L/home/manou/eclipse/tcltk/i386_linux/lib -L. -lnsl -ldl -lieee -lm -s > > -Wl,--export-dynamic -o eg_cc_basic > > manou@acad5071act:~/test$ ./eg_cc_basic > > eclipse returned: . > > eclipse error returned: . > > > > Thanks in advance for any comment. > > > > El Viernes, 27 de Octubre de 2006 14:32, Kish Shen escribió: > > > post_goal(term(EC_functor("compile", 1), "orientacion")); > > > > _______________________________________________ > > ECLiPSe-Users mailing list > > ECL...@cr... > > http://www.crosscoreop.com/mailman/listinfo/eclipse-users ------------------------------------------------------- |
From: J. M. V. <jve...@gu...> - 2006-10-30 20:46:29
|
Hello all, I am trying to call prolog from C++. I make a compilation of the prolog code: post_goal(term(EC_functor("compile", 1), "familia")); familia is a simple prolog database: progenitor(clara,jose). progenitor(tomas,jose). progenitor(tomas,isabel). progenitor(jose,ana). progenitor(jose,patricia). progenitor(patricia,jaime). I would like to know in first time how can I make a query to the database from C++. I am reading the manual and trying things from examples but I don't achieve. Any help or guide will be appreciate. Thanks in advance. |
From: Ulrich S. <ulr...@em...> - 2006-10-30 17:48:24
|
Dear all, I'm about to start a project in Prolog, where it is necessary to read and parse user input. I'd like to do that in Prolog, too. I had some compiler classes in school and I'm pretty sure that I could write one. But in general, I prefer reusing existing code and libraries. Could you suggest me some code / a complete parser (frontend) that is well documented and easy to modify? Thank you, Ulrich -- Ulrich Scholz Personal Memory Group European Media Laboratory GmbH |
From: Ulrich S. <ulr...@em...> - 2006-10-30 17:41:45
|
Thank you all for your answers. Unfortunately, I cannot use a keysort as suggested > However, I want to stress that the Eclipse sorting builtins (sort/2,4, > msort, keysort, etc) are significantly faster and it is often preferable > to use a pattern like my_sort(Random, Sorted) :- because users are allowed to provide arbitrary comparators that work on pairs of objects. I will use the merge sort suggested by Joachim, but with the predicate halve/3 supplied with list library of ECLiPSe. In general, I prefer using libraries over writing my own code - and I think that I wrote enough sorting algorithms in my student years ;-) > Versions using other sorting algorithms (merge sort, bubble sort etc.) > are an exercise for the reader ;) Yours, Ulrich -- Ulrich Scholz Personal Memory Group European Media Laboratory GmbH |
From: Zhou X. <xu...@us...> - 2006-10-30 00:09:51
|
According to the ReadME_WIN.txt: === The important files are in <eclipsedir>\lib\i386_nt: eclipse.exe ECLiPSe standalone executable (needs eclipse.dll) eclipse.dll ECLiPSe linkable library eclipse.lib ECLiPSe linkable library stubs eclipse.def Export specification of the dll eclipse.reg Registry file for use with regedit == However, I can't find .reg and .lib How can I use functions in eclipose.h (or eclipse.lib)? It is said that "cannot open eclipse.lib" in MFC Thanks for help -- --centerwise |
From: J. M. V. <jve...@gu...> - 2006-10-27 22:57:51
|
Hi Kish, Thanks for your reply. I've tried your trick, but I don't get nothing. This is what I try: /* LICENSE BLock ... */ #include "eclipseclass.h" #include <iostream> using namespace std; main() { char buf[1024]; int n; ec_set_option_int(EC_OPTION_IO, MEMORY_IO); ec_init(); // orientacion_main is a Prolog file post_goal(term(EC_functor("compile", 1), "orientacion_main")); // orientacion is a Prolog file got it after processing the CHR file with chr2pl command post_goal(term(EC_functor("compile", 1), "orientacion")); // This is the query I want to pass to prolog. // I need to do it like that because I get strings like that after // an image processing from a C++ controller ec_post_string("ctr_orient(C,A,B,[lm]),ctr_orient(D,C,B,[lm])"); ec_resume(); n = ec_queue_read(1, buf, 1024); buf[n] = 0; cout << "eclipse returned: " << buf << ".\n"; n = ec_queue_read(2, buf, 1024); buf[n] = 0; cout << "eclipse error returned: " << buf << ".\n"; ec_cleanup(); exit(0); } And when I compile and execute it, nothing happends: manou@acad5071act:~/test$ make g++ -O -I/home/manou/eclipse/include/i386_linux -c eg_cc_basic.cc g++ eg_cc_basic.o -L/home/manou/eclipse/lib/i386_linux -leclipse -lgmp -L/home/manou/eclipse/tcltk/i386_linux/lib -L. -lnsl -ldl -lieee -lm -s -Wl,--export-dynamic -o eg_cc_basic manou@acad5071act:~/test$ ./eg_cc_basic eclipse returned: . eclipse error returned: . Thanks in advance for any comment. El Viernes, 27 de Octubre de 2006 14:32, Kish Shen escribió: > post_goal(term(EC_functor("compile", 1), "orientacion")); |
From: Kish S. <kis...@cr...> - 2006-10-27 20:27:31
|
Hi, Your previous messages are being held because the included files are rather large -- 130K or so. In general, if you want to compile a Prolog/ECLiPSe program like the two programs you included, you should compile them from ECLiPSe. If you must issue the compile from C++, you can use post_goal to do this, e.g. post_goal(term(EC_functor("compile", 1), "orientacion")); Cheers, Kish On Friday 27 October 2006 13:07, J. Manuel Velasco wrote: > Hello all, > > I have a long file with a lot of Prolog facts and other that is the result of > converting constraints with the chr2pl command. > > I need to make some inferences from results that I get as output in a C++ > function, so I am trying to embebeb Prolog in C++. > > I am experiecing problems since I am really newbie. > > I tried with ec_post_string giving to porlog line by line, but I get an > "found-end-of-line" not recogniced command error. > > I look for other way and I found things like: > > post_goal(term(EC_functor("writeln",1),"hello world")); > > But I don't achieve good understanding how can I pass the prolog facts. > > I would love to attach the two files I need to embebed but the message is > held. > > Any help/guide will be appreciate. > > Best Regards, > ·_· manou > > _______________________________________________ > ECLiPSe-Users mailing list > ECL...@cr... > http://www.crosscoreop.com/mailman/listinfo/eclipse-users > |
From: J. M. V. <jve...@gu...> - 2006-10-27 20:07:34
|
Hello all, I have a long file with a lot of Prolog facts and other that is the result of converting constraints with the chr2pl command. I need to make some inferences from results that I get as output in a C++ function, so I am trying to embebeb Prolog in C++. I am experiecing problems since I am really newbie. I tried with ec_post_string giving to porlog line by line, but I get an "found-end-of-line" not recogniced command error. I look for other way and I found things like: post_goal(term(EC_functor("writeln",1),"hello world")); But I don't achieve good understanding how can I pass the prolog facts. I would love to attach the two files I need to embebed but the message is held. Any help/guide will be appreciate. Best Regards, ·_· manou |
From: Giuseppe Di G. <dig...@sc...> - 2006-10-27 19:50:08
|
The problems which I've to solve with ECLiPSe sometimes could be in range [ -2^31 , (2^31)-1 ]and the constraints sometimes could be very trivial, like X \= 0. Can you prompt me some efficient solutions with ECLiPSe? ---------------------------------------------------------------------------- - Giuseppe Di Guglielmo Dept. of Computer Science - University of Verona Strada le Grazie, 15 - 37134 Verona - Italy Phone: +39 045 8027049 Fax: +39 045 8027068 email: dig...@sc... WWW: http://profs.sci.univr.it/~diguglielmo Skype: giuseppe.diguglielmo ---------------------------------------------------------------------------- - |
From: J. M. V. <jve...@gu...> - 2006-10-27 19:27:41
|
Hello, I reply this mail just because when I send to the list I receice a reponse from bounces. So it's a test. El Viernes, 27 de Octubre de 2006 02:29, Joachim Schimpf escribió: > Ulrich Scholz wrote: > > Hi everybody, > > > > a question about setof/3: The manual states that the result is sorted but > > I could not find according to which ordering. I guess, it's the standart > > term order. > > Correct, the standard term order, as described in > http://www.eclipse-clp.org/doc/bips/kernel/termcomp/compare-3.html > > > How could an implementation of setof/3 look like that uses an arbitrary, > > i.e., user-supplied ordering? > > Use bagof/3 (or the faster findall/3), and sort the resulting list > afterwards. > > Alternatively, you could take advantage of the fact that the standard order > sorts on the leftmost argument of compound terms first. So if you > construct your result terms such that the leftmost argument is your sorting > key, then the result list will automatically be ordered correctly: > > % sorted alphabetically > ?- setof(X, member(X,[bb,c,aaa]), L). > X = X > L = [aaa, bb, c] > Yes (0.00s cpu) > > % sorted by length first > ?- setof(N-X, (member(X,[bb,c,aaa]),atom_length(X,N)), L). > N = N > X = X > L = [1 - c, 2 - bb, 3 - aaa] > Yes (0.00s cpu) > > > Thank you, > > > > Ulrich > > > > > > BTW, the manual states "This predicate is sensitive to its module context > > (tool predicate, see @/1)". I guess, that sould read "... see @/2)". > > Quite right, thanks for spotting this! > > > -- Joachim > > _______________________________________________ > ECLiPSe-Users mailing list > ECL...@cr... > http://www.crosscoreop.com/mailman/listinfo/eclipse-users |