Fast and loose reasoning is morally correct

Functional programmers often reason about programs as if they were written in a total language, expecting the results to carry over to non-total (partial) languages. We justify such reasoning. Two languages are defined, one total and one partial, with identical syntax. The semantics of the partial l...

Full description

Bibliographic Details
Main Authors: Danielsson, N, Hughes, J, Gibbons, J, Jansson, P
Format: Conference item
Published: 2006
_version_ 1797086377218670592
author Danielsson, N
Hughes, J
Gibbons, J
Jansson, P
author_facet Danielsson, N
Hughes, J
Gibbons, J
Jansson, P
author_sort Danielsson, N
collection OXFORD
description Functional programmers often reason about programs as if they were written in a total language, expecting the results to carry over to non-total (partial) languages. We justify such reasoning. Two languages are defined, one total and one partial, with identical syntax. The semantics of the partial language includes partial and infinite values, and all types are lifted, including the function spaces. A partial equivalence relation (PER) is then defined, the domain of which is the total subset of the partial language. For types not containing function spaces the PER relates equal values, and functions are related if they map related values to related values. It is proved that if two closed terms have the same semantics in the total language, then they have related semantics in the partial language. It is also shown that the PER gives rise to a bicartesian closed category which can be used to reason about values in the domain of the relation. Copyright © 2006 ACM.
first_indexed 2024-03-07T02:21:10Z
format Conference item
id oxford-uuid:a3f59020-133a-4496-b0c1-7832d532e496
institution University of Oxford
last_indexed 2024-03-07T02:21:10Z
publishDate 2006
record_format dspace
spelling oxford-uuid:a3f59020-133a-4496-b0c1-7832d532e4962022-03-27T02:30:40ZFast and loose reasoning is morally correctConference itemhttp://purl.org/coar/resource_type/c_5794uuid:a3f59020-133a-4496-b0c1-7832d532e496Symplectic Elements at Oxford2006Danielsson, NHughes, JGibbons, JJansson, PFunctional programmers often reason about programs as if they were written in a total language, expecting the results to carry over to non-total (partial) languages. We justify such reasoning. Two languages are defined, one total and one partial, with identical syntax. The semantics of the partial language includes partial and infinite values, and all types are lifted, including the function spaces. A partial equivalence relation (PER) is then defined, the domain of which is the total subset of the partial language. For types not containing function spaces the PER relates equal values, and functions are related if they map related values to related values. It is proved that if two closed terms have the same semantics in the total language, then they have related semantics in the partial language. It is also shown that the PER gives rise to a bicartesian closed category which can be used to reason about values in the domain of the relation. Copyright © 2006 ACM.
spellingShingle Danielsson, N
Hughes, J
Gibbons, J
Jansson, P
Fast and loose reasoning is morally correct
title Fast and loose reasoning is morally correct
title_full Fast and loose reasoning is morally correct
title_fullStr Fast and loose reasoning is morally correct
title_full_unstemmed Fast and loose reasoning is morally correct
title_short Fast and loose reasoning is morally correct
title_sort fast and loose reasoning is morally correct
work_keys_str_mv AT danielssonn fastandloosereasoningismorallycorrect
AT hughesj fastandloosereasoningismorallycorrect
AT gibbonsj fastandloosereasoningismorallycorrect
AT janssonp fastandloosereasoningismorallycorrect