Last active
July 23, 2019 11:36
-
-
Save inariksit/58d9fa66306471b406e2f671b57ab443 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract Test = { | |
cat | |
NP ; S ; | |
fun | |
ANP, BNP, CNP : NP ; | |
ConstNP : NP -> NP ; | |
NP2S : NP -> S ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
concrete Test1ABC_makes_difference_Const_is_const of Test = open Prelude in { | |
lincat | |
NP = SS ** {abc : ABC} ; | |
lin | |
ANP = {s = "anp" ; abc = A} ; | |
BNP = {s = "bnp" ; abc = B} ; | |
CNP = {s = "cnp" ; abc = C} ; | |
ConstNP np = np ** {abc = A} ; -- ConstNP is constant, it compiles to 1 concrete fun: NP_* → NP_A | |
NP2S np = {s = -- param ABC makes a difference in NP2S | |
case np.abc of { | |
A => np.s ++ "is an A" ; | |
B => np.s ++ "is a B" ; | |
C => np.s ++ "is a C" | |
} | |
} ; | |
param | |
ABC = A | B | C ; | |
} | |
{- | |
Concrete categories: | |
S_0 | |
NP_1 | |
NP_2 | |
NP_3 | |
(_4 = coercion covering NP_1, NP_2, NP_3) | |
Concrete functions: | |
ANP : NP_1 | |
BNP : NP_2 | |
CNP : NP_3 | |
ConstNP : _4 → NP_1 | |
NP2S : NP_1 → S_0 | |
NP2S : NP_2 → S_0 | |
NP2S : NP_3 → S_0 | |
-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
concrete Test2ABC_makes_difference_Const_isnt_const of Test = open Prelude in { | |
lincat | |
NP = SS ** {abc : ABC} ; | |
lin | |
ANP = {s = "anp" ; abc = A} ; | |
BNP = {s = "bnp" ; abc = B} ; | |
CNP = {s = "cnp" ; abc = C} ; | |
ConstNP np = np ; -- ConstNP isn't actually constant | |
NP2S np = {s = -- param ABC makes a difference | |
case np.abc of { | |
A => np.s ++ "is an A" ; | |
B => np.s ++ "is a B" ; | |
C => np.s ++ "is a C" | |
} | |
} ; | |
param | |
ABC = A | B | C ; | |
} | |
{- | |
Concrete categories: | |
S_0 | |
NP_1 | |
NP_2 | |
NP_3 | |
(no coercions) | |
Concrete functions: | |
ANP : NP_1 | |
BNP : NP_2 | |
CNP : NP_3 | |
ConstNP : NP_1 → NP_1 | |
ConstNP : NP_2 → NP_2 | |
ConstNP : NP_3 → NP_3 | |
NP2S : NP_1 → S_0 | |
NP2S : NP_2 → S_0 | |
NP2S : NP_3 → S_0 | |
-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
concrete Test3ABC_doesnt_make_difference_Const_is_const of Test = open Prelude in { | |
lincat | |
NP = SS ** {abc : ABC} ; | |
lin | |
ANP = {s = "anp" ; abc = A} ; | |
BNP = {s = "bnp" ; abc = B} ; | |
CNP = {s = "cnp" ; abc = C} ; | |
ConstNP np = np ** {abc = A} ; -- Const is const | |
NP2S np = np ; -- param ABC makes no difference | |
param | |
ABC = A | B | C ; | |
} | |
{- | |
Concrete categories: | |
S_0 | |
NP_1 | |
NP_2 | |
NP_3 | |
(_4 = coercion covering NP_1, NP_2, NP_3) | |
Concrete functions: | |
ANP : NP_1 | |
BNP : NP_2 | |
CNP : NP_3 | |
ConstNP : _4 → NP_1 | |
NP2S : _4 → S_0 | |
-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
concrete Test4ABC_doesnt_make_difference_Const_isnt_const of Test = open Prelude in { | |
lincat | |
NP = SS ** {abc : ABC} ; | |
lin | |
ANP = {s = "anp" ; abc = A} ; | |
BNP = {s = "bnp" ; abc = B} ; | |
CNP = {s = "cnp" ; abc = C} ; | |
ConstNP np = np ; -- Const isn't constant | |
NP2S np = np ; -- param ABC makes no difference | |
param | |
ABC = A | B | C ; | |
} | |
{- | |
Concrete categories: | |
S_0 | |
NP_1 | |
NP_2 | |
NP_3 | |
(_4 = coercion covering NP_1, NP_2, NP_3) | |
Concrete functions: | |
ANP : NP_1 | |
BNP : NP_2 | |
CNP : NP_3 | |
ConstNP : NP_1 → NP_1 | |
ConstNP : NP_2 → NP_2 | |
ConstNP : NP_3 → NP_3 | |
NP2S : _4 → S_0 | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment