From 7e84455117d6612033c16028204b7bb66e7fcbbb Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 11 Dec 2018 12:50:52 +0000 Subject: [PATCH] yap --- misc/backcall-0.1.0-cp36-none-any.whl | Bin 11964 -> 0 bytes os/readterm.c | 2 +- os/writeterm.c | 5 +- packages/python/swig/README.md | 45 +++++++----------- packages/python/swig/prolog/yapi.yap | 26 +++++----- .../yap_ipython/core/interactiveshell.py | 2 +- .../yap_kernel/yap_ipython/prolog/jupyter.yap | 8 ++-- .../python/yap_kernel/yap_ipython/yapi.py | 13 ++--- 8 files changed, 47 insertions(+), 54 deletions(-) delete mode 100644 misc/backcall-0.1.0-cp36-none-any.whl diff --git a/misc/backcall-0.1.0-cp36-none-any.whl b/misc/backcall-0.1.0-cp36-none-any.whl deleted file mode 100644 index c08fa1b1527e860e1c78bd5de7fd4061d7766cfb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11964 zcmaKy18`*)fPjF&fTT;>%e#xO(|G-^CH=O)o*EmO*q9jE+AwI9_TVLF!&(J@`kIMGyUuVzx6TiMbs}l-&DF)1~-zo zz|eh6{ie#kz~1PqtFw1Uz_+@p@Bymy4_9gPv}}FwKtNJmK|rwo;i`+3g}srho3okA zZ*SKHZCq9*6E~mesb-B8J!dO)R)(rv>7|7&{o0)59dX|K>Pr))OLF6 zGVqvu0sYeS6}Ycdrb%J$?d{#_^UT>-P*C8|Jl{@#9Mw1gO!im}tABpB5W3KAs=()( z9AoQZ^5Vzy`#R~cTx`$xiFvua%^otFs3;!I5~ug@xHS|T*kQgNRiAIo4f3_}WT0tp z7WGw!0lqWP{WPQAt7BtN4|KOiZ@LoWHvA|+VLRYs;My8gT(CVS?st(a*!^m7gGJCKFDTKrkaj=dtIy-}ASRtIzF2#*s}y zkg}_#X;$)EX`f&dAv!mmwxa2dG~3pdu#H!n2C;A2jfEXn74n|zfNE9qj|Ifr#*LKU$W_=o?0oD66lj3|!Kf z{5>lR(SfU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ZJjs>EfrV| z&Rm@{-Inq;F^czEJ0A74?fT;F$VGD?mgzZNNlwU~Nmg6jz;>ki@vuZ(SLfk$CVmCJR^{k9CraH96oZv8`Spc0r&6k5?{bfaf{YD2x*J4@1UekuHKY&3HZylQ zdz_}FM-FOMQOFVCQzmxhAYIp@c|M5_D2xg~b1tM3$cbQV`u+ijcx1y49Ak&tdPCd( z%Ep(hep}?I%uh7j1f!%qkJV4(k=nM6>r8{<&0C=a=1mad?H910m1VFcHmKR7E)vjY zZ6pZ-ka*DLj*D<*Zx@^w1@ESx{i!Zt%Q3Fnld70`Bw((X|2YK-m-O5W|6ay6f9p5m zfBVx_0OE=&5`NP%@%c&^kXwF~cZz|DGKSOep%&l+N;~4yh+e}2lVDw){MnjzCFmX= zPB+N&Xt*o=`#sxr5zqHub#o>gxHs7g5I~5@YE8yT37`nT^Q~( z`nVxvY$Hg{pam-PpT(i1Mm}}rTBl1aBFBd=6t>tJ{m7e(6V0a3_R*L@FEO~hzfrv} z7E`5BPVlIID*?F%1cT<%L@W7DiKFi~j^v1-+6i9;${|S1$U*$HIY#oMi_J&fMF4m~qp#}Q|)HjrB;e=WydaiADK$d>~OV8s3 zy?-fwHB3njN!XJQ8XK~cVz^ztn9wO7T|S?h)hD1S z3WfpxSBmfdKk@hXi~lKwL4V!;vo8I28t|WlKl5?_w>=0*VNm%$2>-~={S)%%A<5qm z9sK`t<3IlVJ~H`}@aJCSZvq#|--Q3O!2Yo_`IGvm*!!DGPyR2|e@MSSnSW}DznLVI z|HAx-viOtvr=a+o>F{sN|B)Aevi{Tnf3skIOP~LA!TEL?{tNDZ XryV6ZNT|OW!2Z7e+G#$}|5f{c1p53t diff --git a/os/readterm.c b/os/readterm.c index f7122186d..74d5e419b 100644 --- a/os/readterm.c +++ b/os/readterm.c @@ -904,7 +904,7 @@ static Term syntax_error(TokEntry *errtok, int sno, Term cmod, Int newpos, bool v_vnames = get_varnames(fe, tokstart); else v_vnames = 0L; - if (fe->t && trueGlobalPrologFlag(SINGLE_VAR_WARNINGS_FLAG)) + if (fe->t && fe->reading_clause && trueGlobalPrologFlag(SINGLE_VAR_WARNINGS_FLAG)) { warn_singletons(fe, tokstart); } diff --git a/os/writeterm.c b/os/writeterm.c index 972af199e..715d84e3c 100644 --- a/os/writeterm.c +++ b/os/writeterm.c @@ -680,12 +680,13 @@ static Int term_to_string(USES_REGS1) { } return Yap_unify(ARG2, MkStringTerm(s)); } else if (!IsStringTerm(t2)) { - Yap_Error(TYPE_ERROR_STRING, t2, "string_to_ter®m/2"); + Yap_Error(TYPE_ERROR_STRING, t2, "term_to_string/3"); return false; } else { s = StringOfTerm(t2); } - return (rc = readFromBuffer(s, TermNil)) != 0L && Yap_unify(rc, ARG1); + yhandle_t y1 = Yap_InitHandle( t1 ); + return (rc = readFromBuffer(s, TermNil)) != 0L && Yap_unify(rc, Yap_PopHandle(y1)); } static Int term_to_atom(USES_REGS1) { diff --git a/packages/python/swig/README.md b/packages/python/swig/README.md index d609f6392..90f64fe05 100644 --- a/packages/python/swig/README.md +++ b/packages/python/swig/README.md @@ -1,14 +1,16 @@ +The YAP Prolog System {#main} +=========== -
![The YAP Logo](docs/icons/yap_128x128x32.png)
NOTE: this version of YAP is still experimental, documentation may be out of date. -## Introduction +Introduction +++++++++++ This document provides User information on version 6.3.4 of -YAP (Yet Another Prolog). The YAP Prolog System is a +YAP (*Yet Another Prolog*). The YAP Prolog System is a high-performance Prolog compiler developed at Universidade do Porto. YAP supports stream Input/Output, sockets, modules, exceptions, Prolog debugger, C-interface, dynamic code, internal @@ -16,7 +18,6 @@ Porto. YAP supports stream Input/Output, sockets, modules, We explicitly allow both commercial and non-commercial use of YAP. - YAP is based on the David H. D. Warren's WAM (Warren Abstract Machine), with several optimizations for better performance. YAP follows the Edinburgh tradition, and was originally designed to be largely @@ -47,47 +48,33 @@ different licenses. If you have a question about this software, desire to add code, found a bug, want to request a feature, or wonder how to get further assistance, -please send e-mail to . To -subscribe to the mailing list, visit the page -. +please send e-mail to `yap-users AT lists.sourceforge.net. To +subscribe to the mailing list, visit the [YAP Mailing list page](https://lists.sourceforge.net/lists/listinfo/yap-users). On-line documentation is available for [YAP](http://www.dcc.fp.pt/~vsc/yap/) - - The packages are, in alphabetical order: -+ The CHR package developed by Tom Schrijvers, -Christian Holzbaur, and Jan Wielemaker. ++ The CHR package developed by Tom Schrijvers, Christian Holzbaur, and Jan Wielemaker. + The CLP(BN) package and Horus toolkit developed by Tiago Gomes, and Vítor Santos Costa. -+ The CLP(R) package developed by Leslie De Koninck, Bart Demoen, Tom -Schrijvers, and Jan Wielemaker, based on the CLP(Q,R) implementation -by Christian Holzbaur. ++ The CLP(R) package developed by Leslie De Koninck, Bart Demoen, Tom Schrijvers, and Jan Wielemaker, based on the CLP(Q,R) implementation by Christian Holzbaur. -+ The CPLint package developed by Fabrizio Riguzzi's research -laboratory at the [University of Ferrara](http://www.ing.unife.it/Docenti/FabrizioRiguzzi/) ++ The CPLint package developed by Fabrizio Riguzzi's research laboratory at the [University of Ferrara](http://www.ing.unife.it/Docenti/FabrizioRiguzzi/). -+ The CUDA interface package developed by Carlos Martínez, Jorge -Buenabad, Inês Dutra and Vítor Santos Costa. ++ The CUDA interface package developed by Carlos Martínez, Jorge Buenabad, Inês Dutra and Vítor Santos Costa. + The [GECODE](http://www.gecode.org) interface package developed by Denys Duchier and Vítor Santos Costa. + The [JPL](http://www.swi-prolog.org/packages/jpl/) (Java-Prolog Library) package developed by . - The minisat SAT solver interface developed by Michael Codish, - Vitaly Lagoon, and Peter J. Stuckey. ++ The minisat SAT solver interface developed by Michael Codish, Vitaly Lagoon, and Peter J. Stuckey. -+ The MYDDAS relational data-base interface developed at the - Universidade do Porto by Tiago Soares, Michel Ferreira, and Ricardo Rocha. ++ The MYDDAS relational data-base interface developed at the Universidade do Porto by Tiago Soares, Michel Ferreira, and Ricardo Rocha. -+ The [PRISM](http://rjida.meijo-u.ac.jp/prism/) logic-based -programming system for statistical modeling developed at the Sato -Research Laboratory, TITECH, Japan. ++ The [PRISM](http://rjida.meijo-u.ac.jp/prism/) logic-based programming system for statistical modeling developed at the Sato Research Laboratory, TITECH, Japan. -+ The ProbLog 1 system developed by the [ProbLog](https://dtai.cs.kuleuven.be/problog) team in the -DTAI group of KULeuven. ++ The ProbLog 1 system developed by the [ProbLog](https://dtai.cs.kuleuven.be/problog) team in the DTAI group of KULeuven. -+ The [R](http://stoics.org.uk/~nicos/sware/packs/real/) interface package developed by Nicos Angelopoulos, -Vítor Santos Costa, João Azevedo, Jan Wielemaker, and Rui Camacho. ++ The [R](http://stoics.org.uk/~nicos/sware/packs/real/) interface package developed by Nicos Angelopoulos, Vítor Santos Costa, João Azevedo, Jan Wielemaker, and Rui Camacho. diff --git a/packages/python/swig/prolog/yapi.yap b/packages/python/swig/prolog/yapi.yap index 37047c60e..5fca3bce8 100644 --- a/packages/python/swig/prolog/yapi.yap +++ b/packages/python/swig/prolog/yapi.yap @@ -75,20 +75,24 @@ python_query( Caller, String ) :- write_query_answer( Bindings ), nl(user_error), Caller.answer := {}, - maplist(in_dict(Caller.answer), Bindings). + maplist(in_dict(Caller.answer, Bindings), Bindings). - -in_dict(Dict, var([V0,V|Vs])) :- +/** + * + */ +in_dict(_Dict, _, var([_V0])) :- + !. +in_dict(Dict, Bindings, var([V0,V|Vs])) :- !, - atom_string(V0,S0), - atom_string(V,S), + atom_to_string(V0,S0), + atom_to_string(V,S), Dict[S] := S0, - in_dict( Dict, var([V0|Vs])). -in_dict(Dict, nonvar([V0|Vs], T)) :- + in_dict( Dict, Bindings, var([V0|Vs])). +in_dict(Dict, Bindings, nonvar([V0|Vs], T)) :- !, - atom_string(V0,S0), - atom_string(T,S), + atom_to_string(V0,S0), + term_to_string(T, S, _Bindings), Dict[S0] := S, - in_dict( Dict, var([V0|Vs])). -in_dict(_,_). + in_dict( Dict, Bindings, var([V0|Vs])). +in_dict(_, _, _). diff --git a/packages/python/yap_kernel/yap_ipython/core/interactiveshell.py b/packages/python/yap_kernel/yap_ipython/core/interactiveshell.py index cd60ec2b2..626bddb55 100644 --- a/packages/python/yap_kernel/yap_ipython/core/interactiveshell.py +++ b/packages/python/yap_kernel/yap_ipython/core/interactiveshell.py @@ -2040,7 +2040,7 @@ class InteractiveShell(SingletonConfigurable): list where you want the completer to be inserted.""" newcomp = types.MethodType(completer,self.Completer) - self.Completer.matchers.insert(pos,newcomp) + self.Completer.matches.insert(pos,newcomp) def set_completer_frame(self, frame=None): """Set the frame of the completer.""" diff --git a/packages/python/yap_kernel/yap_ipython/prolog/jupyter.yap b/packages/python/yap_kernel/yap_ipython/prolog/jupyter.yap index 9a928589f..4b4be4e88 100644 --- a/packages/python/yap_kernel/yap_ipython/prolog/jupyter.yap +++ b/packages/python/yap_kernel/yap_ipython/prolog/jupyter.yap @@ -38,7 +38,7 @@ jupyter_cell( _Caller, _, Line ) :- blank( Line ), !. jupyter_cell(Caller, _, Line ) :- - Query = Caller, + Query = Caller, catch( python_query(Query,Line), error(A,B), @@ -67,7 +67,7 @@ jupyter_consult(Cell) :- ( Options = [], open_mem_read_stream( Cell, Stream), - load_files(user:'jupyter cell',[stream(Stream)| Options]) + load_files(Stream,[stream(Stream)| Options]) ), error(A,B), (close(Stream), system_error(A,B)) @@ -88,11 +88,11 @@ blank(Text) :- streams(false) :- - %close(user_input), + close(user_input), close(user_output), close(user_error). streams( true) :- - %open('/python/input', read, _Input, [alias(user_input),bom(false),script(false)]), + open('/python/input', read, _Input, [alias(user_input),bom(false),script(false)]), open('/python/sys.stdout', append, _Output, [alias(user_output)]), open('/python/sys.stderr', append, _Error, [alias(user_error)]). diff --git a/packages/python/yap_kernel/yap_ipython/yapi.py b/packages/python/yap_kernel/yap_ipython/yapi.py index af65e8ee5..92735de00 100644 --- a/packages/python/yap_kernel/yap_ipython/yapi.py +++ b/packages/python/yap_kernel/yap_ipython/yapi.py @@ -739,12 +739,13 @@ class YAPRun(InteractiveShell): # def f(self, cell, state): # state = self.jupyter_query( cell ) - # run the new command using the given tracer - # - # tracer.runfunc(f,self,cell,state) - self.jupyter_query( cell ) - # state = tracer.runfunc(jupyter_query( self, cell ) ) + # run the new command using the given tracer + # + # tracer.runfunc(f,self,cell,state) + self.jupyter_query( cell ) + # state = tracer.runfunc(jupyter_query( self, cell ) ) self.shell.last_execution_succeeded = True + result.info += [self.answer] result.result = True except Exception as e: has_raised = True @@ -773,7 +774,7 @@ class YAPRun(InteractiveShell): self.shell.execution_count += 1 self.yapeng.mgoal(streams(False),"user", True) - return result + return result.result def clean_end(self,s): """