Revising for a course on automated reasoning and I don't quite understand how to answer this question:
Show how the notion of pairs (x, y)
can be defined in higher-order logic using a lambda abstraction. Define a function π1 that returns the first element of such a pair. Finally, show that π1(x, y) = x.
I've found similar questions on stackoverflow, but they're all to do with scheme, which I've never used. An explanation in English/relevant mathematical notation would be appreciated
Pairs or tuples describes Products Domain, is the union of all elements of the set A and all elements of the set B:
Here, A and B are diferent types, so if you for example are in a laguage program like C, Java, you can have pair like
(String, Integer)
,(Char, Boolean)
,(Double, Double)
Now, the function π1, is just a function that takes a pair and returns the first element, this function is called in usually
first
, and that's how it looks likeπ1(x, y) = x
, on the other hand you have second, doing the same thing but returning the second element:When I studied the signature "Characteristics of the programming languages" in college our professor recommended this book, see the chapter Product Domain to understand well all this concepts.