BasicTypes(TypeSystem):: ! Type systems ! ------------ ! ! Arnold Neumaier, Peter Schodl and Ferenc Domes ! ! February 9, 2011 ! ! This type system defines the concept of a TypeSystem in a way that it ! comprises both context-free grammars for abstract syntax trees and ! the types needed for efficiently organizing the semantic memory. ! ! Details are given in the types paper (types.pdf). ! The basic types defined there are part of this typesheet. ! The present information will become an appendix of the latter. ! ! Note that a type sheet is just a special version of a record sheet ! in which lots of redundant information is deleted for the sake of ! optimal readability. In particular, each object declared by a line ! starting with '':'' is automatically assumed to be a category, ! namely a union if it has a ''union'' or ''atomic'' field, and a type ! otherwise. ! Present: nothing> ProperType: index> Index = ProperTypesCollection allOf> template=ProperType someOf> allOf=Assembly, someOf=AssemblyLink, optional=Assembly, oneOf=AssemblyLink, someOfType=CatAssembly, index=Assembly, itself=CatCollection, nothingElse=Present, fixed=ObjAssembly, array=Assembly, only=Assembly optional> index=Assembly ! array can be tightened when specified Union: index> Index = Unions allOf> subtypes=ObjCollection, union=CatCollection, parents=UnionCollection optional> complete=Present TypeSystem: index> Index = TypeSystemCollection itself> Category allOf> atomic = ObjCollection Category: union> Union, ProperType Assembly: someOfType> Object=Category ObjAssembly: someOfType> Object=Object ! This does nothing CatAssembly: someOfType> Category=Category AssemblyLink: allOf> entry=Assembly optional> next=AssemblyLink TypeSystemCollection: itself> TypeSystem ProperTypesCollection: itself> ProperTypes ObjCollection: itself> Object CatCollection: itself> Category UnionCollection: itself> Union ! Note that the same production may belong to several categories. ! Also the same category may belong to several grammars (typically ! when these are produced by inheritance using + from simpler grammars). ! but this is possible only if the categories agree in _all_ their ! productions. ! The type checker does not check that the names of all categories ! are distinct; this must be enforced semantically rather than through ! types.