Is expression evaluated before assigning type?Proving that $Omega = (lambda x.xx)(lambda x.xx)$ is not typable in the simply typed lambda calculusHas a Dependent Type always a Type?If $f(x)=g(x)$ for all $x:A$, why is it not true that $lambda x.f(x)=lambda x.g(x)$?Proving that $Omega = (lambda x.xx)(lambda x.xx)$ is not typable in the simply typed lambda calculusQuestions regarding well formed expressions in the Theory of typesWikipedia's explanation of the lambda-calclulus form of Curry's paradox makes no senseThe place of lambda abstraction in internal and Mitchell-Bénabou languagesBasic problem with lambda-calculus syntaxHow should I type this lambda expression?Variable Condition in Typed Lambda Calculus“Type dependence” in type theory and category theory?
Why do we use polarized capacitors?
Lied on resume at previous job
Prime joint compound before latex paint?
Denied boarding due to overcrowding, Sparpreis ticket. What are my rights?
(Soft question) does light intensity oscillate really fast since it is a wave?
Why is the design of haulage companies so “special”?
Should the British be getting ready for a no-deal Brexit?
Why was the "bread communication" in the arena of Catching Fire left out in the movie?
Are cabin dividers used to "hide" the flex of the airplane?
Are objects structures and/or vice versa?
How to manage monthly salary
"My colleague's body is amazing"
Find the number of surjections from A to B.
Why airport relocation isn't done gradually?
How can I fix this gap between bookcases I made?
What causes the sudden spool-up sound from an F-16 when enabling afterburner?
Pristine Bit Checking
If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?
Is it wise to hold on to stock that has plummeted and then stabilized?
What happens when a metallic dragon and a chromatic dragon mate?
How to deal with fear of taking dependencies
Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?
Filling an area between two curves
Was there ever an axiom rendered a theorem?
Is expression evaluated before assigning type?
Proving that $Omega = (lambda x.xx)(lambda x.xx)$ is not typable in the simply typed lambda calculusHas a Dependent Type always a Type?If $f(x)=g(x)$ for all $x:A$, why is it not true that $lambda x.f(x)=lambda x.g(x)$?Proving that $Omega = (lambda x.xx)(lambda x.xx)$ is not typable in the simply typed lambda calculusQuestions regarding well formed expressions in the Theory of typesWikipedia's explanation of the lambda-calclulus form of Curry's paradox makes no senseThe place of lambda abstraction in internal and Mitchell-Bénabou languagesBasic problem with lambda-calculus syntaxHow should I type this lambda expression?Variable Condition in Typed Lambda Calculus“Type dependence” in type theory and category theory?
$begingroup$
I am assigning type to an $lambda$-expression: if false then M else N
where if A then B else C
and false
have their usual meanings (read: not specified).
The problem arises because M and N have different types. While clearly the expression evaluates to N & hence should be assigned type(N) but apparently it is expected that for if-else
, the types for B & C should be same.
How to proceed on this? Should I use conjuncted type?
lambda-calculus type-theory
$endgroup$
add a comment |
$begingroup$
I am assigning type to an $lambda$-expression: if false then M else N
where if A then B else C
and false
have their usual meanings (read: not specified).
The problem arises because M and N have different types. While clearly the expression evaluates to N & hence should be assigned type(N) but apparently it is expected that for if-else
, the types for B & C should be same.
How to proceed on this? Should I use conjuncted type?
lambda-calculus type-theory
$endgroup$
$begingroup$
What do you mean by conjuncted type?
$endgroup$
– Potato44
Mar 30 at 12:00
$begingroup$
I may have used the word "conjunction" incorrectly. I'm referring to this answer
$endgroup$
– Sudutt Harne
Mar 31 at 17:41
$begingroup$
That sounds like intersection types. Do you also have union types?
$endgroup$
– Potato44
Mar 31 at 17:42
$begingroup$
No, I don't think we have covered them yet.
$endgroup$
– Sudutt Harne
Mar 31 at 17:46
add a comment |
$begingroup$
I am assigning type to an $lambda$-expression: if false then M else N
where if A then B else C
and false
have their usual meanings (read: not specified).
The problem arises because M and N have different types. While clearly the expression evaluates to N & hence should be assigned type(N) but apparently it is expected that for if-else
, the types for B & C should be same.
How to proceed on this? Should I use conjuncted type?
lambda-calculus type-theory
$endgroup$
I am assigning type to an $lambda$-expression: if false then M else N
where if A then B else C
and false
have their usual meanings (read: not specified).
The problem arises because M and N have different types. While clearly the expression evaluates to N & hence should be assigned type(N) but apparently it is expected that for if-else
, the types for B & C should be same.
How to proceed on this? Should I use conjuncted type?
lambda-calculus type-theory
lambda-calculus type-theory
asked Mar 30 at 5:18
Sudutt HarneSudutt Harne
33
33
$begingroup$
What do you mean by conjuncted type?
$endgroup$
– Potato44
Mar 30 at 12:00
$begingroup$
I may have used the word "conjunction" incorrectly. I'm referring to this answer
$endgroup$
– Sudutt Harne
Mar 31 at 17:41
$begingroup$
That sounds like intersection types. Do you also have union types?
$endgroup$
– Potato44
Mar 31 at 17:42
$begingroup$
No, I don't think we have covered them yet.
$endgroup$
– Sudutt Harne
Mar 31 at 17:46
add a comment |
$begingroup$
What do you mean by conjuncted type?
$endgroup$
– Potato44
Mar 30 at 12:00
$begingroup$
I may have used the word "conjunction" incorrectly. I'm referring to this answer
$endgroup$
– Sudutt Harne
Mar 31 at 17:41
$begingroup$
That sounds like intersection types. Do you also have union types?
$endgroup$
– Potato44
Mar 31 at 17:42
$begingroup$
No, I don't think we have covered them yet.
$endgroup$
– Sudutt Harne
Mar 31 at 17:46
$begingroup$
What do you mean by conjuncted type?
$endgroup$
– Potato44
Mar 30 at 12:00
$begingroup$
What do you mean by conjuncted type?
$endgroup$
– Potato44
Mar 30 at 12:00
$begingroup$
I may have used the word "conjunction" incorrectly. I'm referring to this answer
$endgroup$
– Sudutt Harne
Mar 31 at 17:41
$begingroup$
I may have used the word "conjunction" incorrectly. I'm referring to this answer
$endgroup$
– Sudutt Harne
Mar 31 at 17:41
$begingroup$
That sounds like intersection types. Do you also have union types?
$endgroup$
– Potato44
Mar 31 at 17:42
$begingroup$
That sounds like intersection types. Do you also have union types?
$endgroup$
– Potato44
Mar 31 at 17:42
$begingroup$
No, I don't think we have covered them yet.
$endgroup$
– Sudutt Harne
Mar 31 at 17:46
$begingroup$
No, I don't think we have covered them yet.
$endgroup$
– Sudutt Harne
Mar 31 at 17:46
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Type checking is something that happens before evaluation.
In most common type systems for lambda calculus, including simply typed lambda calculus and System F, if false then M else N
is ill typed if N
and M
have different types. Unless you have been told otherwise you are probably working with one of these.
There are extensions such as union types and certain forms of subtyping that allow if false then M else N
to be well formed with N
and M
having different types.
$endgroup$
$begingroup$
Thanks for the explanation! Could you suggest some books/authoritative references to study this further from?
$endgroup$
– Sudutt Harne
Mar 31 at 18:34
$begingroup$
I haven't read either myself, but two I have seen recommended by others are " Practical Foundations for Programming Languages" by Robert Harper and " Types and Programming Languages" by Benjamin Pierce.
$endgroup$
– Potato44
Mar 31 at 20:43
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3167956%2fis-expression-evaluated-before-assigning-type%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Type checking is something that happens before evaluation.
In most common type systems for lambda calculus, including simply typed lambda calculus and System F, if false then M else N
is ill typed if N
and M
have different types. Unless you have been told otherwise you are probably working with one of these.
There are extensions such as union types and certain forms of subtyping that allow if false then M else N
to be well formed with N
and M
having different types.
$endgroup$
$begingroup$
Thanks for the explanation! Could you suggest some books/authoritative references to study this further from?
$endgroup$
– Sudutt Harne
Mar 31 at 18:34
$begingroup$
I haven't read either myself, but two I have seen recommended by others are " Practical Foundations for Programming Languages" by Robert Harper and " Types and Programming Languages" by Benjamin Pierce.
$endgroup$
– Potato44
Mar 31 at 20:43
add a comment |
$begingroup$
Type checking is something that happens before evaluation.
In most common type systems for lambda calculus, including simply typed lambda calculus and System F, if false then M else N
is ill typed if N
and M
have different types. Unless you have been told otherwise you are probably working with one of these.
There are extensions such as union types and certain forms of subtyping that allow if false then M else N
to be well formed with N
and M
having different types.
$endgroup$
$begingroup$
Thanks for the explanation! Could you suggest some books/authoritative references to study this further from?
$endgroup$
– Sudutt Harne
Mar 31 at 18:34
$begingroup$
I haven't read either myself, but two I have seen recommended by others are " Practical Foundations for Programming Languages" by Robert Harper and " Types and Programming Languages" by Benjamin Pierce.
$endgroup$
– Potato44
Mar 31 at 20:43
add a comment |
$begingroup$
Type checking is something that happens before evaluation.
In most common type systems for lambda calculus, including simply typed lambda calculus and System F, if false then M else N
is ill typed if N
and M
have different types. Unless you have been told otherwise you are probably working with one of these.
There are extensions such as union types and certain forms of subtyping that allow if false then M else N
to be well formed with N
and M
having different types.
$endgroup$
Type checking is something that happens before evaluation.
In most common type systems for lambda calculus, including simply typed lambda calculus and System F, if false then M else N
is ill typed if N
and M
have different types. Unless you have been told otherwise you are probably working with one of these.
There are extensions such as union types and certain forms of subtyping that allow if false then M else N
to be well formed with N
and M
having different types.
answered Mar 31 at 18:14
Potato44Potato44
1185
1185
$begingroup$
Thanks for the explanation! Could you suggest some books/authoritative references to study this further from?
$endgroup$
– Sudutt Harne
Mar 31 at 18:34
$begingroup$
I haven't read either myself, but two I have seen recommended by others are " Practical Foundations for Programming Languages" by Robert Harper and " Types and Programming Languages" by Benjamin Pierce.
$endgroup$
– Potato44
Mar 31 at 20:43
add a comment |
$begingroup$
Thanks for the explanation! Could you suggest some books/authoritative references to study this further from?
$endgroup$
– Sudutt Harne
Mar 31 at 18:34
$begingroup$
I haven't read either myself, but two I have seen recommended by others are " Practical Foundations for Programming Languages" by Robert Harper and " Types and Programming Languages" by Benjamin Pierce.
$endgroup$
– Potato44
Mar 31 at 20:43
$begingroup$
Thanks for the explanation! Could you suggest some books/authoritative references to study this further from?
$endgroup$
– Sudutt Harne
Mar 31 at 18:34
$begingroup$
Thanks for the explanation! Could you suggest some books/authoritative references to study this further from?
$endgroup$
– Sudutt Harne
Mar 31 at 18:34
$begingroup$
I haven't read either myself, but two I have seen recommended by others are " Practical Foundations for Programming Languages" by Robert Harper and " Types and Programming Languages" by Benjamin Pierce.
$endgroup$
– Potato44
Mar 31 at 20:43
$begingroup$
I haven't read either myself, but two I have seen recommended by others are " Practical Foundations for Programming Languages" by Robert Harper and " Types and Programming Languages" by Benjamin Pierce.
$endgroup$
– Potato44
Mar 31 at 20:43
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3167956%2fis-expression-evaluated-before-assigning-type%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
What do you mean by conjuncted type?
$endgroup$
– Potato44
Mar 30 at 12:00
$begingroup$
I may have used the word "conjunction" incorrectly. I'm referring to this answer
$endgroup$
– Sudutt Harne
Mar 31 at 17:41
$begingroup$
That sounds like intersection types. Do you also have union types?
$endgroup$
– Potato44
Mar 31 at 17:42
$begingroup$
No, I don't think we have covered them yet.
$endgroup$
– Sudutt Harne
Mar 31 at 17:46