Correspondence between logic and type theory