LaTeX_AS_Basic.hs revision 7b1dc4100fa5a3afee36f6eb379a067a1a0f7c3c
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettModule : $Header$
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettCopyright : (c) Klaus L�ttich, Christian Maeder and Uni Bremen 2002-2006
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettMaintainer : luettich@tzi.de
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettStability : experimental
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettPortability : portable
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblettlatex printing data types of 'BASIC_SPEC'
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett ( hc_sty_sig_item_keyword
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett , optLatexQuMark
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblettimport Data.Char (toUpper)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettinstance (PrintLaTeX b, PrintLaTeX s, PrintLaTeX f)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett => PrintLaTeX (BASIC_SPEC b s f) where
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett printLatex0 ga (Basic_spec l) =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if null l then braces_latex empty else vcat (map (printLatex0 ga) l)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettinstance (PrintLaTeX b, PrintLaTeX s, PrintLaTeX f) =>
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett PrintLaTeX (BASIC_ITEMS b s f) where
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett printLatex0 ga (Sig_items s) = printLatex0 ga s
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga (Free_datatype l _) =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett fsep_latex [hc_sty_plain_keyword "free"
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett <~> setTab_latex
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett <> hc_sty_plain_keyword ("type"++ pluralS l)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett ,tabbed_nest_latex $ semiAnno_latex ga l]
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblett printLatex0 ga (Sort_gen l _) =
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblett hang_latex (hc_sty_plain_keyword generatedS
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett <~> setTab_latex<> condTypeS) 9 $
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett tabbed_nest_latex $ condBraces
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett (vcat (map (printLatex0 ga) l))
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett where condTypeS =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if isOnlyDatatype then
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett hc_sty_plain_keyword (typeS++pluralS l)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett condBraces d =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if isOnlyDatatype then
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett [x] -> case x of
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett Annoted (Datatype_items l' _) _ lans _ ->
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett vcat (map (printLatex0 ga) lans)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett $$ semiAnno_latex ga l'
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett _ -> error "wrong implementation of isOnlyDatatype"
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett _ -> error "wrong implementation of isOnlyDatatype"
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett else braces_latex d
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett isOnlyDatatype =
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett [x] -> case x of
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett Annoted (Datatype_items _ _) _ _ _ -> True
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga (Var_items l _) =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett hc_sty_plain_keyword (varS++pluralS l) <\+>
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett semiT_latex ga l
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga (Local_var_axioms l f _) =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett hc_sty_axiom "\\forall" <\+> semiT_latex ga l
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett $$ printLatex0Axioms ga f
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga (Axiom_items f _) =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0Axioms ga f
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Ext_BASIC_ITEMS b) = printLatex0 ga b
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy GimblettprintLatex0Axioms :: PrintLaTeX f =>
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett GlobalAnnos -> [Annoted (FORMULA f)] -> Doc
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy GimblettprintLatex0Axioms ga f =
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett vcat $ map (printAnnotedFormula_Latex0 ga) f
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettprintAnnotedFormula_Latex0 :: PrintLaTeX f =>
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett GlobalAnnos -> Annoted (FORMULA f) -> Doc
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy GimblettprintAnnotedFormula_Latex0 ga (Annoted i _ las ras) =
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett let i' = hc_sty_axiom "\\bullet"
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett <\+> set_tabbed_nest_latex (printLatex0 ga i)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett las' = if not $ null las then
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett sp_text 0 "\n" <> printAnnotationList_Latex0 ga las
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett splitAndPrintRAnnos printLatex0
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett printAnnotationList_Latex0
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett (<\+>) (latex_macro "\\`" <>)
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett in {-trace (show i)-} (las' $+$ fsep_latex [i',la] $$ ras')
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblettinstance (PrintLaTeX s, PrintLaTeX f) =>
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett PrintLaTeX (SIG_ITEMS s f) where
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblett printLatex0 ga (Sort_items l _) =
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblett hc_sty_sig_item_keyword ga (sortS++pluralS l) <\+>
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblett set_tabbed_nest_latex (semiAnno_latex ga l)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Op_items l _) =
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett hc_sty_sig_item_keyword ga (opS++pluralS l) <\+>
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett set_tabbed_nest_latex (semiAnno_latex ga l)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Pred_items l _) =
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett hc_sty_sig_item_keyword ga (predS++pluralS l) <\+>
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett set_tabbed_nest_latex (semiAnno_latex ga l)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga (Datatype_items l _) =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett hc_sty_sig_item_keyword ga (typeS++pluralS l) <\+>
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett set_tabbed_nest_latex (semiAnno_latex ga l)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga (Ext_SIG_ITEMS s) = printLatex0 ga s
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettinstance PrintLaTeX f => PrintLaTeX (SORT_ITEM f) where
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga (Sort_decl l _) = commaT_latex ga l
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga (Subsort_decl l t _) =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett hang_latex (commaT_latex ga l) 8 $
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett hc_sty_axiom lessS <\+> printLatex0 ga t
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga (Subsort_defn s v t f _) =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga s <\+> equals_latex <\+>
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett braces_latex (set_tabbed_nest_latex $ fsep
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett [printLatex0 ga v
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett <> colon_latex
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett <\+> printLatex0 ga t,
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett hc_sty_axiom "\\bullet"
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett <\+> set_tabbed_nest_latex (printLatex0 ga f)])
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett printLatex0 ga (Iso_decl l _) =
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett fsep_latex $ punctuate (space_latex<>equals_latex) $
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett map (printLatex0 ga) l
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblettinstance PrintLaTeX f => PrintLaTeX (OP_ITEM f) where
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett printLatex0 ga (Op_decl l t a _) =
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett {-cat [ cat [commaT_latex ga l
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett ,colon_latex <> printLatex0 ga t <> condComma]
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett , if na then empty
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett else commaT_latex ga a
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett if na then ids_sig
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett else setTabWithSpaces_latex 4
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett fsep [ids_sig,
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett tabbed_nest_latex $ commaT_latex ga a]
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett where ids_sig = -- setTabWithSpaces_latex 6 <>
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett fsep [commaT_latex ga l<\+>colon_latex,
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett tabbed_nest_latex (if na then sig
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett else sig <> comma_latex)]
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett sig = printLatex0 ga t
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Op_defn n h term _) =
b34e5090387d45b3a35f88eaa23477a83d2a2962Andy Gimblett setTabWithSpaces_latex 4 <>
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett tab_hang_latex (printLatex0 ga n
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett <> printLatex0 ga h
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett <\+> equals_latex)
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett 4 (printLatex0 ga term)
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblettinstance PrintLaTeX OP_TYPE where
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Op_type Total l s _) =
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett let (arg_types,type_arr) = if null l then (empty,empty)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett else (space_latex <>
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett crossT_latex ga l,
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett hc_sty_axiom "\\rightarrow")
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett result_type = printLatex0 ga s
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett in if isEmpty arg_types then result_type
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett else sep_latex [arg_types,type_arr <\+> result_type]
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Op_type Partial l s _) =
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett (if null l then hc_sty_axiom quMark
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett else space_latex
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett <> crossT_latex ga l
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett <\+>hc_sty_axiom ("\\rightarrow" ++ quMark))
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett <\+> printLatex0 ga s
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy GimblettoptLatexQuMark :: FunKind -> Doc
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy GimblettoptLatexQuMark Partial = hc_sty_axiom quMark
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy GimblettoptLatexQuMark Total = empty
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettinstance PrintLaTeX OP_HEAD where
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Op_head k l s _) =
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett (if null l then empty
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett else parens_latex (semiT_latex ga l))
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett <> colon_latex <> optLatexQuMark k
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett <\+> printLatex0 ga s
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettinstance PrintLaTeX ARG_DECL where
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett printLatex0 ga (Arg_decl l s _) = commaT_latex ga l
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett <> colon_latex
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett <\+> printLatex0 ga s
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettinstance PrintLaTeX f => PrintLaTeX (OP_ATTR f) where
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 _ (Assoc_op_attr) = hc_sty_id assocS
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett printLatex0 _ (Comm_op_attr) = hc_sty_id commS
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett printLatex0 _ (Idem_op_attr) = hc_sty_id idemS
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Unit_op_attr t) = hc_sty_id unitS <\+> printLatex0 ga t
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettinstance PrintLaTeX f => PrintLaTeX (PRED_ITEM f) where
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett printLatex0 ga (Pred_decl l t _) = commaT_latex ga l
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett <\+> colon_latex <\+> printLatex0 ga t
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett printLatex0 ga (Pred_defn n h f _) =
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett sep_latex [printLatex0 ga n
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett <> printLatex0 ga h
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett <\+> hc_sty_axiom "\\Leftrightarrow",
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga f]
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettinstance PrintLaTeX PRED_TYPE where
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett printLatex0 _ (Pred_type [] _) = parens_latex empty
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett printLatex0 ga (Pred_type l _) = crossT_latex ga l
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettinstance PrintLaTeX PRED_HEAD where
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Pred_head l _) =
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett parens_latex (semiT_latex ga l)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettinstance PrintLaTeX DATATYPE_DECL where
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Datatype_decl s a _) =
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett printLatex0 ga s <\+>
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett (defnS'<> setTab_latex<~>
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett (printLatex0 ga $ head a)<>casl_normal_latex "~":
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett (map (\x -> tabbed_nest_latex (latex_macro
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett "\\hspace*{-0.84mm}"<> ---}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett casl_normal_latex "\\textbar")
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett <~> (printLatex0 ga x)<>casl_normal_latex "~") $
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett where defnS' = hc_sty_axiom defnS
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettinstance PrintLaTeX ALTERNATIVE where
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett printLatex0 ga (Alt_construct k n l _) = tabbed_nest_latex (
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett printLatex0 ga n <> (if null l then case k of
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett Partial -> parens_tab_latex empty
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett else parens_tab_latex ( semiT_latex ga l))
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett <> optLatexQuMark k)
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett printLatex0 ga (Subsorts l _) =
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett sp_text (axiom_width s') s'' <\+> commaT_latex ga l
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett where s' = sortS ++ pluralS l
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett s'' = '\\':map toUpper s' ++ "[ID]"
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblettinstance PrintLaTeX COMPONENTS where
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett printLatex0 ga (Cons_select k l s _) =
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett commaT_latex ga l <> colon_latex <> optLatexQuMark k
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett <> printLatex0 ga s
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett printLatex0 ga (Sort s) = printLatex0 ga s
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblettinstance PrintLaTeX VAR_DECL where
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett printLatex0 ga (Var_decl l s _) = commaT_latex ga l
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett <> colon_latex
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett <\+> printLatex0 ga s
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblettinstance PrintLaTeX f => PrintLaTeX (FORMULA f) where
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett printLatex0 ga (Quantification q l f _) =
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett set_tabbed_nest_latex $ fsep_latex
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett [printLatex0 ga q <\+> semiT_latex ga l ,
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett hc_sty_axiom "\\bullet"
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett <\+> set_tabbed_nest_latex (printLatex0 ga f)]
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett printLatex0 ga (Conjunction fs _) =
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett sep_latex $ punctuate (space_latex <> hc_sty_axiom "\\wedge")
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett $ map (condParensXjunction printLatex0 parens_tab_latex ga) fs
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett{- (sep_latex $ prepand_head $
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett prepPunctuate (hc_sty_axiom "\\wedge" <> space_latex) $
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett map (condParensXjunction printLatex0 parens_tab_latex ga) fs)
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett where prepand_head l = case l of
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett (x:xs) -> (hspace_latex "0.375cm"<>x) : xs-}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett printLatex0 ga (Disjunction fs _) =
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett sep_latex $ punctuate (space_latex <> hc_sty_axiom "\\vee")
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett $ map (condParensXjunction printLatex0 parens_tab_latex ga) fs
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett{- (sep_latex $ prepand_head $
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett prepPunctuate (hc_sty_axiom "\\vee" <> space_latex) $
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett map (condParensXjunction printLatex0 parens_tab_latex ga) fs)
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett where prepand_head l = case l of
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett (x:xs) -> (hspace_latex "0.375cm"<>x): xs-}
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga i@(Implication f g b _) =
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett {-trace pos $ -}
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett hang_latex (condParensImplEquiv printLatex0 parens_tab_latex ga i g False
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett <\+> hc_sty_id "if") 3 $
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett condParensImplEquiv printLatex0 parens_tab_latex ga i f True)
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett hang_latex (condParensImplEquiv printLatex0 parens_tab_latex ga i f False
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett <\+> hc_sty_axiom "\\Rightarrow") 3 $
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett condParensImplEquiv printLatex0 parens_tab_latex ga i g True)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett{- where pos = "Implication: \"=>\": "++show p
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett ++"; left_most_id_of_first_formula: "
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett ++(show $ left_most_pos f )-}
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga e@(Equivalence f g _) =
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett [condParensImplEquiv printLatex0 parens_tab_latex ga e f False
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett <\+> hc_sty_axiom "\\Leftrightarrow",
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett condParensImplEquiv printLatex0 parens_tab_latex ga e g True]
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 ga (Negation f _) = hc_sty_axiom "\\neg" <\+> condParensNeg f parens_latex (printLatex0 ga f)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 _ (True_atom _) = hc_sty_id trueS
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett printLatex0 _ (False_atom _) = hc_sty_id falseS
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett printLatex0 ga (Predication p l _) =
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett let (p_id,isQual) =
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett Pred_name i -> (i,False)