Hello! There was a problem studying the prolog lists. This is how a list of items is displayed:

domains t_list=symbol* predicates nondeterm t(t_list) nondeterm show nondeterm print_list(t_list) clauses t_list (["Ρ„ΠΈΠ·ΠΈΠΊΠ°","химия","история"]). t_list (["ΠΌΡƒΠ·Ρ‹ΠΊΠ°","биология"]). print_list([ ]). print_list([X|Y]) :- write(X), nl, print_list(Y). show :- t(X), print_list(X),fail. goal show. 

But then I don’t know what or how to create the facts or not, which would end up with something like this:

 Иванов. ΠŸΡ€Π΅Π΄ΠΌΠ΅Ρ‚Ρ‹ Ρ„ΠΈΠ·ΠΈΠΊΠ° химия история ΠŸΠ΅Ρ‚Ρ€ΠΎΠ². ΠŸΡ€Π΅Π΄ΠΌΠ΅Ρ‚Ρ‹ ΠΌΡƒΠ·Ρ‹ΠΊΠ° биология 

Help me please!)

    1 answer 1

    The question arises, what do dogs have to do with physics, chemistry, history, etc.? :)

    As for the facts, there will be something like

     student("Иванов",["Ρ„ΠΈΠ·ΠΈΠΊΠ°","химия","история"]). student("ΠŸΠ΅Ρ‚Ρ€ΠΎΠ²",["ΠΌΡƒΠ·Ρ‹ΠΊΠ°","биология"]). 

    To get a list of subjects that are of interest, for example, Ivanov, you need to give a query to the student("Иванов",X). How to withdraw this list, I think, will understand.