I have a file .pland I want to call the predicate declared in it from a python script. How can i do this?
For instance, test.pl
rD( [], Ans, Ans ).
rD( [X|Xs], Ans, Acc ) :-
member( X, Acc ),
rD( Xs, Ans, Acc ), !.
rD( [X|Xs], Ans, Acc ) :-
\+member( X, Acc ),
append( Acc, [X], AccNew ),
rD( Xs, Ans, AccNew ), !.
Works like
?- rD( [1,2,3,4,5,4], X ).
X = [1, 2, 3, 4, 5].
I want to somehow call rDfrom a python script and get the answer in the result variable
result
[1, 2, 3, 4, 5]
ps: this is just an example, and I don't want to rewrite the current Prolog program.