[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reply to: [list | sender only]
Re: [ddlm-group] List/table recursion limits?
- To: Nick.Spadaccini@uwa.edu.au, Group finalising DDLm and associated dictionaries <email@example.com>
- Subject: Re: [ddlm-group] List/table recursion limits?
- From: "Herbert J. Bernstein" <firstname.lastname@example.org>
- Date: Sun, 6 Dec 2009 19:01:43 -0500 (EST)
- In-Reply-To: <C7425D54.127D1email@example.com>
- References: <C7425D54.127D1firstname.lastname@example.org>
Function invocations aside, the actual recursive depth for given data file conforming to a set of dictionaries is determined by the types of the list, array and table typed tags in those dictionaries. At the moment, the worst depth seems to be 2 for import lists and 2-D arrays. For Fortrans without dynamic array allocation, you do have to preset such depths (with parameter statements). To detect runaways in the parser, I did a lot of debugging of CIFtbx 4.1.0 with a depth limit of 3, but so as not to have to worry about it in production use, the current limit is set at 20. Fortran is not practical for direct method invocation, so some static depth limit greater than or equal to 3 should suffice for the immediate furuter. For python or C, which are a more appropriate environment for method invocation, there is no need for a specific depth limit, and, as Nick points out, you could end up going very deep, so a hard limit is likely to cause trouble. I would suggest not imposing a specific limit, and leave that as a configuration detail for setting up software to be able to deal with specific scientific domains. Even for Fortran, it is easy enough to change a parameter (in my case MAXDEPTH) when necessary. Regards, Herbert ===================================================== Herbert J. Bernstein, Professor of Computer Science Dowling College, Kramer Science Center, KSC 121 Idle Hour Blvd, Oakdale, NY, 11769 +1-631-244-3035 email@example.com ===================================================== On Mon, 7 Dec 2009, Nick Spadaccini wrote: > > > > On 5/12/09 4:30 AM, "Joe Krahn" <firstname.lastname@example.org> wrote: > >> It may be useful to put practical limits on recursion depth. Maybe 8 is >> sufficient? I suspect that most CIF developers want to keep nesting >> fairly shallow, given that CIF disallows and STAR loop nesting. > > Is it necessary to apply a restriction to the recursive depth? As you say > humans will keep it fairly shallow anyway to keep things clear, but I can > foresee a machine generated data value being quite deep. > > If I was to output as a CIF2 value (not that I would ever do this) the > entire internal representation of a domain dictionary category (and its > attributes), including methods and data file values, it would be a deeply > recursive compound data structure of significant complexity. But it would > all fit in a Table. > > cheers > > Nick > > -------------------------------- > Associate Professor N. Spadaccini, PhD > School of Computer Science & Software Engineering > > The University of Western Australia t: +61 (0)8 6488 3452 > 35 Stirling Highway f: +61 (0)8 6488 1089 > CRAWLEY, Perth, WA 6009 AUSTRALIA w3: www.csse.uwa.edu.au/~nick > MBDP M002 > > CRICOS Provider Code: 00126G > > e: Nick.Spadaccini@uwa.edu.au > > > > > _______________________________________________ > ddlm-group mailing list > email@example.com > http://scripts.iucr.org/mailman/listinfo/ddlm-group > _______________________________________________ ddlm-group mailing list firstname.lastname@example.org http://scripts.iucr.org/mailman/listinfo/ddlm-group
Reply to: [list | sender only]
- Re: [ddlm-group] List/table recursion limits? (Joe Krahn)
- Re: [ddlm-group] List/table recursion limits? (Nick Spadaccini)