the syntactic entity [s0qua] is needed

105 views
Skip to first unread message

Brandon Barker

unread,
Jan 27, 2014, 6:33:27 PM1/27/14
to ats-lan...@googlegroups.com
Probably a dependent type issue:
I'm trying to transform a list to a list_vt using a functional + linear approach. 

I bet that using templates would be easier, but I should probably continue to try to master this style:

(* ****** ****** *)
extern
fun
grexplst_cnfize_list_vt {n:pos} (gxs: list(grexp, n)): grcnflst

(* ****** ****** *)

implement
grexplst_cnfize_list_vt
  {n} (gxs) = let
var cnfs = list_vt_nil()
//                                                                                                                                                                                                                                             
fun loop {i:nat|i<n}
(gxs: list(grexp, n), i: int i,
cnfs: &list_vt(INV(grcnf), i) >> list_vt(grcnf, i+1)
): void = case+ gxs of
| list_cons (gx, gxs1) => let
  val gx_cnf = grexp_cnfize(gx)
  val () = list_vt_insert_at(cnfs, i, gx_cnf)
in
  loop(gxs1, i+1, cnfs)
end // end of [list_cons]                                                                                                                                                                                                                      
| list_nil () => () //shouldn't be reached                                                                                                                                                                                                     
// end of [loop]                                                                                                                                                                                                                               
val () = loop(gxs, 0, cnfs)
in // in of let                                                                                                                                                                                                                                
  cnfs
end //end of grexplst_cnfize_list_vt                 


/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats: 3606(line=219, offs=19) -- 3608(line=219, offs=21): error(parsing): the syntactic entity [s0qua] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats: 3605(line=219, offs=18) -- 3606(line=219, offs=19): error(parsing): the keyword '}' is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats: 3597(line=219, offs=10) -- 3598(line=219, offs=11): error(parsing): the keyword [=] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats: 3588(line=219, offs=1) -- 3591(line=219, offs=4): error(parsing): the keyword [in] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats: 3556(line=216, offs=15) -- 3559(line=216, offs=18): error(parsing): the syntactic entity [d0exp] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats: 3508(line=214, offs=1) -- 3517(line=214, offs=10): error(parsing): the token is discarded.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats: 3828(line=226, offs=1) -- 3830(line=226, offs=3): error(parsing): the token is discarded.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats: 3970(line=232, offs=1) -- 3972(line=232, offs=3): error(parsing): the token is discarded.


gmhwxi

unread,
Jan 27, 2014, 6:47:14 PM1/27/14
to ats-lan...@googlegroups.com
i<n changes to i < n.
Reply all
Reply to author
Forward
0 new messages