I need to construct database using a list of 2-tuples. Database needs to contain information about one company owning another. Each fact representing a company x and a company y will appear as a tuple in database, with the owned company the second element of the tuple and the owning company the first element. For example: Company one owns company two, which owns company three which owns company four.
I did something like this:
database = ("company1","company2"):("company3","company4"):
I want to write an function to check if companyX owns companyY.
>owns "companyX" "companyY"
Is this correct way of setting database?
How should I start this function to show dependencies?