Search code examples
prologprolog-assert

In PROLOG, How can I use assert recursively without getting 'true' result?


I'm planning to make new facts based on existing facts, by using assert. However, the number of facts to be made will be more than 500, so that typing semicolon to go further steps become pretty tedious work. thus I want to ignore or pass the 'true'(in the SWI PROLOG)

Are there any ways to deal with this?(ex. automatically pass all the 'true's...)

here's a part of my code

%initialize
initialize :-
   discipline(X,Y),
   assert(result(X,0)).

I have too many Xs in discipline(X,Y)..


Solution

  • maybe

    ?- forall(a_fact(F), your_fact_processing(F)).