Mizero / grammatical-framework

Automatically exported from code.google.com/p/grammatical-framework
0 stars 0 forks source link

Cannot use cc on a function with Str lincat #67

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create the following grammars
    abstract Test = {
      cat A ;
      fun aa : A ;
    }
    concrete TestA of Test = {
      lincat A = Str ;
      lin aa = "aa" ;
    }
2. Import TestA
    > i -retain TestA.gf
3. Compute term aa
    > cc aa

What is the expected output? What do you see instead?
Expected:
    "aa"
Actual:
    cannot infer type of constant aa

Original issue reported on code.google.com by gregoire...@gmail.com on 29 Apr 2013 at 2:15

GoogleCodeExporter commented 8 years ago

Original comment by hallg...@chalmers.se on 20 Nov 2013 at 3:43

GoogleCodeExporter commented 8 years ago
The problem appears to be that when you use import -retain, the concrete syntax 
gets reinterpreted as a resource module, which means that GF adds lock fields 
to the linearization types. But this fails if the linearization type is not a 
record type. In this case, GF tries to form the type Str ** { lock_A : {} }.

(Lock fields can be thought of as a way to emulate Haskell's newtype, but it 
only works for record types...)

Original comment by hallg...@chalmers.se on 20 Nov 2013 at 5:21