Need help building database using Visual Prolog (beginner)

Here is my database, I need to determine which subjects a certain group studied, how to extract values with double nesting? Help me make a number.


domains

list_ocenok = symbol*
groupcast = groups*
vedomost = vedom*
name_fac, phamily, name, otchestvo,kafedra,predmet1,predmet2,number_fac, number_group = symbol
price, ocenka1, ocenka2 =real
groups = cast (phamily, name, otchestvo,kafedra ,vedomost)
groupstudents = groupstudents (name_fac, number_fac, number_group,groupcast)
vedom = ved(predmet1, ocenka1)

facts

dq1(number_group, number_fac)
min(number_group, groups)

predicates

group (groupstudents)
%q1 (number_group)
q3(number_group)
%q2(number_group)
q31(groupcast)
q32(vedomost)

clauses

group(groupstudents("Informatic","k-090301D","n-6201",[cast("Novikov","Sergey","Dmits","no",[ved("Inform",5)]),cast("Smal","Bob","Dmits","yes",[ved("Program",3)]),cast("Lara","Sara","Vas","no",[ved("Python",2)])])).
group(groupstudents("Scientist","k-050401D","n-6301",[cast("Ivanov","Mihail","Mihs","yes",[ved("Obchestvo",4)]),cast("Smith","Bob","Mihs","yes",[ved("Obchestvo",5)]),cast("Andry","Bob","Dmits","yes",[ved("History",5,)])])).
group(groupstudents("Literatura","k-123456D","n-6212",[cast("Smith","Sergey","Dmits","no",[ved("Liter",5)]),cast("Smith","Bob","Mihs","yes",[ved("Chtenie",4)]),cast("Andry","Bob","Dmits","yes",[ved("Liter",2)])])).
group(groupstudents("Lingvistic","k-066501D","n-5361",[cast("Malcev","Sergey","Dmits","no",[ved("England",4)]),cast("Sart","Bob","Vas","yes",[ved("England",4)]),cast("Andry","Bob","Dmits","yes",[ved("Germany")])])).

This isn’t even Prolog, looks like some Prolog extension (Visual Prolog?).

What exactly are you struggling with?

This is Visual prolog. I need to output all the subjects that a certain group studied. I do not know how to do this because of the humidity that is present. As a result, for the group “n-6301” should output “Obchestvo” and “History”

at startup, delete the line with the group “n-5361” there is an error in it

You do realize that this is a Prolog dialect that is incompatible with SWI-Prolog, right?

Yes, I just don’t know where else to ask.
Can you help with this request ?

I don’t know, this looks like homework. I feel strange doing other people’s homework on their “request”.

Ask at StackOverflow using the tags prolog and visual-prolog, e.g.