From afe5780fc15f64635bdcd5505fc854152d772c38 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 11 Dec 2018 08:16:54 +0000 Subject: [PATCH] bad chars? --- packages/python/swig/prolog/yapi.yap | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/python/swig/prolog/yapi.yap b/packages/python/swig/prolog/yapi.yap index 23da8e0f5..37047c60e 100644 --- a/packages/python/swig/prolog/yapi.yap +++ b/packages/python/swig/prolog/yapi.yap @@ -78,13 +78,17 @@ python_query( Caller, String ) :- maplist(in_dict(Caller.answer), Bindings). -in_dict(Dict, var([V0,V|Vs])) :- !, - Dict[V] := V0, +in_dict(Dict, var([V0,V|Vs])) :- + !, + atom_string(V0,S0), + atom_string(V,S), + Dict[S] := S0, in_dict( Dict, var([V0|Vs])). -in_dict(_Dict, var([_],_G)) :- !. -in_dict(Dict, nonvar([V0|Vs],G)) :- !, -term_to_atom(G,A,_), - Dict[V0] := A, - in_dict( Dict, nonvar(Vs, G) ). -in_dict(_Dict, nonvar([],_G)) :- !. -in_dict(_, _) +in_dict(Dict, nonvar([V0|Vs], T)) :- + !, + atom_string(V0,S0), + atom_string(T,S), + Dict[S0] := S, + in_dict( Dict, var([V0|Vs])). +in_dict(_,_). +