Querying extensionals

Query extensional predicates with the ?- syntax: check whether a tuple is present, or look up tuples by leaving some components as variables.

A file runs one query; change it to ask another. Swap in ?- pokemon(1, "Bulbasaur", 60). (check: no), ?- pokemon(Id, "Bulbasaur", 45). (look up the ID by name and HP), ?- pokemon(Id, "Bulbasaur", HP). (look up ID and HP), or ?- pokemon(Id, "Bulbasaur", _). (look up the ID, ignoring HP).

Variables are upper-case by convention; _ is the special “don’t-care” variable.