I'm working with ALEPH reasoning engine in SWI-Prolog. I want to save the rules that ALEPH infers and shows them in SWI-Prolog console, but I have no idea how can I do it! The sample result is depicted in the picture below,
[Rule 134] [Pos cover = 1 Neg cover = 0]
likes(u9,soccer).
[Rule 135] [Pos cover = 3 Neg cover = 0]
friends(A,u2) :- age(A,adult).
[Rule 136] [Pos cover = 2 Neg cover = 0]
friends(A,u5) :- age(A,adult).
[Rule 137] [Pos cover = 1 Neg cover = 0]
trusts(u1,u5).
[Rule 138] [Pos cover = 1 Neg cover = 0]
trusts(u5,u7).
these rules are shown after calling the induction procedure with this commands:
- read_all(aleph_files).
- induce.
Now I'm wondering how I can store these rules into a txt file automatically.