diff -r a52499e125ce -r 0c1dcdefb515 Quotient-Paper/Paper.thy --- a/Quotient-Paper/Paper.thy Wed May 26 17:55:42 2010 +0200 +++ b/Quotient-Paper/Paper.thy Thu May 27 11:21:37 2010 +0200 @@ -1,3 +1,4 @@ + (*<*) theory Paper imports "Quotient" @@ -157,6 +158,26 @@ *} +subsection {* Higher Order Logic *} + +text {* + + Types: + \begin{eqnarray}\nonumber + @{text "\ ::="} & @{text "\"} & \textrm{(type variable)} \\ \nonumber + @{text "|"} & @{text "(\,\,\)\"} & \textrm{(type construction)} + \end{eqnarray} + + Terms: + \begin{eqnarray}\nonumber + @{text "t ::="} & @{text "x\<^isup>\"} & \textrm{(variable)} \\ \nonumber + @{text "|"} & @{text "c\<^isup>\"} & \textrm{(constant)} \\ \nonumber + @{text "|"} & @{text "t t"} & \textrm{(application)} \\ \nonumber + @{text "|"} & @{text "\x\<^isup>\. t"} & \textrm{(abstraction)} \\ \nonumber + \end{eqnarray} + +*} + section {* Constants *} (* Say more about containers? *) @@ -173,31 +194,26 @@ The operation is additionally able to descend into types for which maps are known. Such maps for most common types (list, pair, sum, - option, \ldots) are described in Homeier, and our algorithm uses the - same kind of maps. Given the raw compound type and the quotient compound - type the Rep/Abs algorithm does: + option, \ldots) are described in Homeier, and we assume that @{text "map"} + is the function that returns a map for a given type. Then REP/ABS is defined + as follows: \begin{itemize} - \item For equal types or free type variables return identity. - - \item For function types recurse, change the Rep/Abs flag to - the opposite one for the domain type and compose the - results with @{term "fun_map"}. - - \item For equal type constructors use the appropriate map function - applied to the results for the arguments. - - \item For unequal type constructors, look in the quotients information - for a quotient type that matches the type constructor, and instantiate - the raw type - appropriately getting back an instantiation environment. We apply - the environment to the arguments and recurse composing it with the - aggregate map function. + \item @{text "ABS(\\<^isub>1, \\<^isub>2)"} = @{text "id"} + \item @{text "REP(\\<^isub>1, \\<^isub>2)"} = @{text "id"} + \item @{text "ABS(\, \)"} = @{text "id"} + \item @{text "REP(\, \)"} = @{text "id"} + \item @{text "ABS(\\<^isub>1\\\<^isub>2,\\<^isub>1\\\<^isub>2)"} = @{text "REP(\\<^isub>1,\\<^isub>1) ---> ABS(\\<^isub>2,\\<^isub>2)"} + \item @{text "REP(\\<^isub>1\\\<^isub>2,\\<^isub>1\\\<^isub>2)"} = @{text "ABS(\\<^isub>1,\\<^isub>1) ---> REP(\\<^isub>2,\\<^isub>2)"} + \item @{text "ABS((\\<^isub>1,\,\\<^isub>n))\, (\\<^isub>1,\,\\<^isub>n))\)"} = @{text "(map \) (ABS(\\<^isub>1,\\<^isub>1)) \ (ABS(\\<^isub>n,\\<^isub>n))"} + \item @{text "REP((\\<^isub>1,\,\\<^isub>n))\, (\\<^isub>1,\,\\<^isub>n))\)"} = @{text "(map \) (REP(\\<^isub>1,\\<^isub>1)) \ (REP(\\<^isub>n,\\<^isub>n))"} + \item @{text "ABS((\\<^isub>1,\,\\<^isub>n))\\<^isub>1, (\\<^isub>1,\,\\<^isub>m))\\<^isub>2)"} = @{text "Abs_\\<^isub>2 \ (map \\<^isub>1) (ABS(\\<^isub>1,\\<^isub>1) \ (ABS(\\<^isub>p,\\<^isub>p)"} provided @{text "\ \\<^isub>2 = (\\<^isub>1\\\<^isub>p)\\<^isub>1 \ \s. s(\s\\<^isub>1)=\s\\<^isub>1 \ s(\s\\<^isub>2)=\s\\<^isub>2"} + \item @{text "REP((\\<^isub>1,\,\\<^isub>n))\\<^isub>1, (\\<^isub>1,\,\\<^isub>m))\\<^isub>2)"} = @{text "(map \\<^isub>1) (REP(\\<^isub>1,\\<^isub>1) \ (REP(\\<^isub>p,\\<^isub>p) \ Rep_\\<^isub>2"} provided @{text "\ \\<^isub>2 = (\\<^isub>1\\\<^isub>p)\\<^isub>1 \ \s. s(\s\\<^isub>1)=\s\\<^isub>1 \ s(\s\\<^isub>2)=\s\\<^isub>2"} \end{itemize} - The first three points above are identical to the algorithm present in - in Homeier's HOL implementation, below is the definition of @{term fconcat} - that shows the last step: + Apart from the last 2 points the definition is same as the one implemented in + in Homeier's HOL package, below is the definition of @{term fconcat} + that shows the last points: @{thm fconcat_def[no_vars]}