{"responseHeader":{"status":0,"QTime":7,"params":{"q":"{!q.op=AND}id:\"108257\"","hl":"true","hl.simple.post":"","hl.fragsize":"5000","fq":"!embargo_tdt:[NOW TO *]","hl.fl":"ocr_t","hl.method":"unified","wt":"json","hl.simple.pre":""}},"response":{"numFound":1,"start":0,"docs":[{"modified_tdt":"2016-11-18T00:00:00Z","thumb_s":"/f1/cd/f1cd76e7bc72efd73f5c95b1573b63bd73e07fd0.jpg","oldid_t":"compsci 16370","setname_s":"ir_computersa","file_s":"/9e/ba/9ebaad3222a75a22c5ead9ca40f8246767c78776.pdf","title_t":"Page 14","ocr_t":"2.1 Development of a Type System We will develop our type system incrementally in the remainder of the chapter. We start with the characteristics that are common to each of the successive refinements. Then the development progresses in four stages: 1) basic type system, 2) basic type system with hierarchy, 3) basic type system with hierarchy and polymorphism, 4) basic type system with heirarchy, polymorphism, and user defined types. This approach allows us to investigate separately the complications caused by both inclusion and parametric polymorphism. Each refinement of the type system will have the following common characteristics. The types of predicates will be declared according to the following grammar: ::= pred() ::= e | , A new grammar for Type will be given with each refinement. In order to be sure the type information is present for a predicate when it is needed, we require that predicates be declared before they are used. We also assume that type information for built-in predicates and functors is available to the type checker. The type checking condition uses the declarations and information on builtins to determine type correctness of all the literals and terms in a program. Given a rule or query, the type checker constructs a series of Want/Have pairs, where each Wanti represents the type constraint that applies to one of the formal parameters of a predicate or constructor, and each Havei represents the type of the corresponding actual parameter. Type correctness is specified in terms of these pairs. 2.2 Basic Type System To begin with, we will need a few basic types. Suppose these types are int and bool. Therefore the grammar for Type is:","restricted_i":0,"id":108257,"created_tdt":"2016-11-18T00:00:00Z","format_t":"application/pdf","parent_i":108288,"_version_":1642982405320998915}]},"highlighting":{"108257":{"ocr_t":[]}}}