Porting ATS1 to ATS2: dealing with dataviewtypes

In minDisjNoCov.datshttps://github.com/bbarker/FALCON/blob/f639705e90fc79a32c9e46df44b17da19d5797b1/minDisjNoCov.dats, the first round of errors suggest something is wrong with functions
accessing dataviewtypes, e.g, the following codeblock has problems (lines
311-328):

fun GREXP_copy(gr: !GREXP): GREXP = case+ gr of
| GRgenes(!g) => let
val x = genes_copy(!g) prval () = fold@ gr
in GRgenes(x) end
| GRconj(!g) => let
val x = genes_copy(!g) prval () = fold@ gr
in GRconj(x) end
| GRdisj(!g) => let
val x = genes_copy(!g) prval () = fold@ gr
in GRdisj(x) end
| GRconj(!lx,!rx) => let
val x = GRconj(GREXP_copy(!lx),GREXP_copy(!rx))
prval () = fold@ gr
in x end
| GRdisj(!lx,!rx) => let
val x = GRdisj(GREXP_copy(!lx),GREXP_copy(!rx))
prval () = fold@ gr
in x end

patscc -tcats /home/brand_000/FBA/FALCON/minDisjNoCov.dats
exec(patsopt --typecheck --dynamic
/home/brand_000/FBA/FALCON/minDisjNoCov.dats)
Hello from ATS2(ATS/Postiats)!
Loading [fixity.ats] starts!
Loading [fixity.ats] finishes!
Loading [basics_pre.sats] starts!
Loading [basics_pre.sats] finishes!
Loading [basics_sta.sats] starts!
Loading [basics_sta.sats] finishes!
Loading [basics_dyn.sats] starts!
Loading [basics_dyn.sats] finishes!
Loading [basics_gen.sats] starts!
Loading [basics_gen.sats] finishes!
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7706(line=312, offs=13) –
7707(line=312, offs=14): error(parsing): the keyword ‘)’ is needed.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7705(line=312, offs=12) –
7706(line=312, offs=13): error(parsing): the syntactic entity [c0lau] is
needed.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7698(line=312, offs=5) –
7705(line=312, offs=12): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7770(line=314, offs=5) –
7772(line=314, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7865(line=317, offs=5) –
7867(line=317, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7956(line=320, offs=5) –
7958(line=320, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 8081(line=324, offs=5) –
8083(line=324, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 8198(line=328, offs=5) –
8200(line=328, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 12821(line=501, offs=13) –
12822(line=501, offs=14): error(parsing): the keyword ‘)’ is needed.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 12820(line=501, offs=12) –
12821(line=501, offs=13): error(parsing): the syntactic entity [c0lau] is
needed.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 12813(line=501, offs=5) –
12819(line=501, offs=11): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13218(line=510, offs=7) –
13220(line=510, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13347(line=515, offs=7) –
13349(line=515, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13480(line=520, offs=7) –
13482(line=520, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13610(line=525, offs=7) –
13612(line=525, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13745(line=529, offs=7) –
13747(line=529, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13855(line=534, offs=5) –
13857(line=534, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 14096(line=539, offs=7) –
14098(line=539, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 14276(line=545, offs=7) –
14278(line=545, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 14461(line=551, offs=7) –
14463(line=551, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 14567(line=554, offs=7) –
14569(line=554, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 14687(line=559, offs=5) –
14689(line=559, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 15042(line=570, offs=5) –
15044(line=570, offs=7): error(parsing): the token is discarded.
exit(ATS): uncaught exception:
_2home_2brand_000_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorException(1025)
exec(patsopt --typecheck --dynamic
/home/brand_000/FBA/FALCON/minDisjNoCov.dats) = 256

Compilation exited abnormally with code 1 at Sat Jan 11 18:49:13

There is some significant difference between ATS1 and ATS2
in terms of dataviewtype handling.

First, you can call datavtype for dataviewtype.

If you are not going to modify a dataviewtype-value, then it should be
handled
as a datatype value. So your function can now be written as follows:

fun GREXP_copy (gr: !GREXP): GREXP =
case+ gr of
| GRgenes (g) => GRgenes (genes_copy (g))
| …On Saturday, January 11, 2014 6:56:07 PM UTC-5, Brandon Barker wrote:

In minDisjNoCov.datshttps://github.com/bbarker/FALCON/blob/f639705e90fc79a32c9e46df44b17da19d5797b1/minDisjNoCov.dats, the first round of errors suggest something is wrong with functions
accessing dataviewtypes, e.g, the following codeblock has problems (lines
311-328):

fun GREXP_copy(gr: !GREXP): GREXP = case+ gr of
| GRgenes(!g) => let
val x = genes_copy(!g) prval () = fold@ gr
in GRgenes(x) end
| GRconj(!g) => let
val x = genes_copy(!g) prval () = fold@ gr
in GRconj(x) end
| GRdisj(!g) => let
val x = genes_copy(!g) prval () = fold@ gr
in GRdisj(x) end
| GRconj(!lx,!rx) => let
val x = GRconj(GREXP_copy(!lx),GREXP_copy(!rx))
prval () = fold@ gr
in x end
| GRdisj(!lx,!rx) => let
val x = GRdisj(GREXP_copy(!lx),GREXP_copy(!rx))
prval () = fold@ gr
in x end

patscc -tcats /home/brand_000/FBA/FALCON/minDisjNoCov.dats
exec(patsopt --typecheck --dynamic
/home/brand_000/FBA/FALCON/minDisjNoCov.dats)
Hello from ATS2(ATS/Postiats)!
Loading [fixity.ats] starts!
Loading [fixity.ats] finishes!
Loading [basics_pre.sats] starts!
Loading [basics_pre.sats] finishes!
Loading [basics_sta.sats] starts!
Loading [basics_sta.sats] finishes!
Loading [basics_dyn.sats] starts!
Loading [basics_dyn.sats] finishes!
Loading [basics_gen.sats] starts!
Loading [basics_gen.sats] finishes!
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7706(line=312, offs=13) –
7707(line=312, offs=14): error(parsing): the keyword ‘)’ is needed.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7705(line=312, offs=12) –
7706(line=312, offs=13): error(parsing): the syntactic entity [c0lau] is
needed.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7698(line=312, offs=5) –
7705(line=312, offs=12): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7770(line=314, offs=5) –
7772(line=314, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7865(line=317, offs=5) –
7867(line=317, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 7956(line=320, offs=5) –
7958(line=320, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 8081(line=324, offs=5) –
8083(line=324, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 8198(line=328, offs=5) –
8200(line=328, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 12821(line=501, offs=13) –
12822(line=501, offs=14): error(parsing): the keyword ‘)’ is needed.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 12820(line=501, offs=12) –
12821(line=501, offs=13): error(parsing): the syntactic entity [c0lau] is
needed.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 12813(line=501, offs=5) –
12819(line=501, offs=11): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13218(line=510, offs=7) –
13220(line=510, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13347(line=515, offs=7) –
13349(line=515, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13480(line=520, offs=7) –
13482(line=520, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13610(line=525, offs=7) –
13612(line=525, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13745(line=529, offs=7) –
13747(line=529, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 13855(line=534, offs=5) –
13857(line=534, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 14096(line=539, offs=7) –
14098(line=539, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 14276(line=545, offs=7) –
14278(line=545, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 14461(line=551, offs=7) –
14463(line=551, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 14567(line=554, offs=7) –
14569(line=554, offs=9): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 14687(line=559, offs=5) –
14689(line=559, offs=7): error(parsing): the token is discarded.
/home/brand_000/FBA/FALCON/minDisjNoCov.dats: 15042(line=570, offs=5) –
15044(line=570, offs=7): error(parsing): the token is discarded.
exit(ATS): uncaught exception:
_2home_2brand_000_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorException(1025)
exec(patsopt --typecheck --dynamic
/home/brand_000/FBA/FALCON/minDisjNoCov.dats) = 256

Compilation exited abnormally with code 1 at Sat Jan 11 18:49:13