Closed ShubhamSharma1808 closed 4 years ago
The alternate solution which worked for me, but still how to read the prolog list ?
from pyswip import Prolog
p = Prolog()
p.retractall('tran(_,_)')
p.retractall('listtran(_,_)')
p.assertz("tran(eins,one)")
p.assertz('tran(zwei,two)')
p.assertz('tran(drei,three)')
p.assertz('tran(vier,four)')
p.assertz('tran(fuenf,five)')
p.assertz('tran(sechs,six)')
p.assertz('tran(sieben,seven)')
p.assertz('tran(acht,eight)')
p.assertz('tran(neun,nine)')
p.assertz('listtran([],[])')
p.assertz('listtran([X|Tx],[Y|Ty]) :- tran(X,Y) , listtran(Tx,Ty)')
for soln in p.query('listtran([eins,zwei,drei],[X,Y,Z])'):
print(soln)
Output:-
{'X': 'one', 'Y': 'two', 'Z': 'three'}
@ShubhamSharma1808 The private repo that implements a fix will be made public soon. Let me know if you'd like to get access to it.
@yuce Would be great if you provide the access.
Can you send your Gitlab handle to pyswip@scaleplan.net so I can grant you access there?
@ShubhamSharma1808 Does the PR https://github.com/yuce/pyswip/pull/97 fix the problem for you?
Hey Yuce,
I am currently busy in some other problematic areas in my work , so i havent tested it yet. I will reach to you when i have done testing.
Thank you
On Tue, 7 Jul 2020, 4:17 pm Yüce Tekol, notifications@github.com wrote:
@ShubhamSharma1808 https://github.com/ShubhamSharma1808 Does the PR #97 https://github.com/yuce/pyswip/pull/97 fix the problem for you?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yuce/pyswip/issues/96#issuecomment-654768177, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALRCA6HERO5NQ24Z5V6TP4TR2L4LHANCNFSM4OK43FXQ .
@yuce the issue is being solved by the update in the pyswip.
Output shows the type Atom and address associated with it.the prolog list returned by the query is not getting properly stored in python list. where it should print -> [one,two,three,four]
Output:-