I have some .pl
file and I want to call predicate declared in it from python script. How can I do that?
For example, 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 ), !.
Working like
?- rD( [1,2,3,4,5,4], X ).
X = [1, 2, 3, 4, 5].
I want to call rD
somehow from python script and get answer in result variable
result
[1, 2, 3, 4, 5]
ps: it is just an example, and I don't want to rewrite my current Prolog program.