I am tasked with extending some existing Prolog code and I have run into an issue with the structure of a complex term. This complex term is passed as a parameter to a Prolog predicate that I am writing. Problem is that I need to extract two lists from this complex term and the structure of the term is not known in advanced or fixed.
Specifically, let's say I have a term "Param" like this:
lam(_G23075,
drs([_G23084], [eq(_G23084, person), ant(_G23084, mask, sg)])+_G23075*_G23084)
The drs term above has the two lists that I would like to extract.
If Param had the drs term only, I could do this:
drs(L1, L2) = Param.
And then L1 and L2 would contain the lists. How could this work with the complex term structure given above?
Cheers,
Martin