A partial function is one, that that is only defined on a part of its domain. Haskell gives examples: https://wiki.haskell.org/Partial_functions
My end goal is to express types
$$ \prod_{D:\mathcal{U}} D \qquad\qquad\qquad\qquad \prod_{\mathcal{A}:\mathfrak{A}} \mathcal{L}(\mathcal{A}) $$
- The first type should simply represent sort of (polymorphic) choice functions which accecpt a type and return an element of that Type.
- The second is assuming, that I can express the Type of Automata $\mathfrak{A}$ as well as the language $\mathcal{L}(\mathcal{A})$ accepted by automaton $\mathcal{A}$. Given an Automaton a function with the given pitype should Select a word accepted by it.
As far as I understand, in a basic dependently typed lambda calculus, both types suffer from the same problem: Their elements can never be introduced. Neither is it possible to select an element from the type $\bot$ nor select a word accepted by an automaton that doesn't accept any words.
I was wondering, if partial functions may be a solution to that problem. But how are partial functions are represented in a typed lambda calculus? An easy way I can imagine would be to be to create expressions, that allow the introduction of partial functions, such that there simply are no computation rules for undefined inputs.
So my questions are:
- Does that make any sence, and is it common to solve this kind of problem that way? Is there good literature?
- If the approach seems legit, is it possible to distinguish partial function types $A \rightharpoonup B$ from regular ones $A \to B$?
Note on the purpose: To be honest, I haven't formalized automata in any calculus, since for now I mostly would like to steal the concept and notation of dependent types and use them in my work to get across a concept. But if what i will do isn't completely bogus, it would maybe at least leave open a possibility to formalize things later.
A choice function of type $\prod_{D:\mathcal{U}} D$ is meant to represent user input - which should be non deterministic .. so there would also be no congruence)
- Bonus question: Can non-deterministic functions be represented in a calculus such that this may be expressed?