From Till.Mossakowski at dfki.de Mon Apr 6 11:43:04 2009 From: Till.Mossakowski at dfki.de (Till Mossakowski) Date: Mon, 06 Apr 2009 11:43:04 +0200 Subject: [Hets-devel] Lecture about Institutions, Categories and Hets Message-ID: <49D9CEA8.60909@dfki.de> Dear friends of the Heterogeneous Tool Set (Hets), tomorrow, the following lecture starts, held by Lutz Schr?der and me (in English): "Logics and categories for software engineering and artificial intelligence" http://www.informatik.uni-bremen.de/agbkb/lehre/ss09/logcat/index_e.htm It will introduce in various logics (propositional, description logics, first-order logics) with the formalisation as institutions in mind, and will contain many examples and exercises with Hets. Moreover, also category theory, institutions and structured specifications will be covered. He,ce for all working with Hets, the lecture will provide an interesting and valuable introduction into its foundations. For those who are not able to attend (and for those who attend as well :-): there will be course materials available. All the best, Till -- Till Mossakowski Cartesium, room 2.051 Phone +49-421-218-64226 DFKI GmbH Bremen Fax +49-421-218-9864226 Safe & Secure Cognitive Systems Till.Mossakowski at dfki.de Enrique-Schmidt-Str. 5, D-28359 Bremen http://www.dfki.de/sks/till Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH principal office, *not* the address for mail etc.!!!: Trippstadter Str. 122, D-67663 Kaiserslautern management board: Prof. Wolfgang Wahlster (chair), Dr. Walter Olthoff supervisory board: Prof. Hans A. Aukes (chair) Amtsgericht Kaiserslautern, HRB 2313 From Christian.Maeder at dfki.de Mon Apr 20 14:56:39 2009 From: Christian.Maeder at dfki.de (Christian Maeder) Date: Mon, 20 Apr 2009 14:56:39 +0200 Subject: [Hets-devel] breaking too long lines Message-ID: <49EC7107.2030704@dfki.de> Hi, according the several style guides, lines shouldn't be too long (longer than 78 characters). http://www.cs.caltech.edu/courses/cs11/material/haskell/misc/haskell_style_guide.html http://www.haskell.org/haskellwiki/Programming_guidelines However, I miss hints how to break lines best. Therefore I make some suggestions here and ask for comments. If a "one-liner" does not fit on one line I break the line after "=" rather than breaking the following infix- or prefix-expression. (I break in the same way after "->" or "<-" in case- or do- expressions) (Some people move "=" to the next line, but I only suggest this for proper infix operators, below.) If a "do" or a short "case ... of" or "let ... in" fits, I leave it at the end of the previous line behind "=" ("->" or "<-"). A line should be broken after "do" or "of" (from "case") in order to allow insertions without breaking the layout, provided there is preceding text at all. The following is fine, because there's no text before "do") c x = do y <-... z ... But this is fine, too, if not better: c x = do y <- ... z ... It's not necessary to put "do" (or "let") on a separate line (and care about the indentation of that keyword): c x = do y <-... z ... Because layout may easily break (if b is renamed) and the layout block starts already too far to the right, this is really bad: c b x = unless b $ do y <- ... z ... In many cases a "do" can be moved to the end of the previous line: c b x = unless b $ do y <- ... z What applies to "do" could be applied to "let" as well (and vice versa), but: f x = let y = x + x z = y + y in z does not look as nice as: f x = let y = x + x z = y + y in z And also a "let" (without "in") within a "do" should not be broken after "let". A long infix-expression should be broken _before_ an infix symbol to better indicate it's continuation: f ++ g ++ h f . g $ h x (One should also put spaces around infix operators and should not put unnecessary brackets around prefix applications.) Surely a long prefix expression can be broken anywhere, but I try to break expressions on the top-level and not within too deeply nested sub-expressions: f arg1 arg2 arg3 (longArg4 sa1 sa2 sa3 sa4) arg5 arg6 arg7 After a line break (following "=", "do", "<-", or "->") I try to stay as far to the left as layout permits (using 2 spaces as minimal indentation). I don't care if "=", <-", or "->" of one block line up (which surely is difficult for the top-level module block) and I may put parts of the rhs below parts of the lhs: let longPattern = case bla of Nothing -> "don't know" Just b -> "a longer expression" vN = ... The standard breaking of if-then-else (within "do") is: if ... then ... else ... but I think the following variations are also fine: ... <- if ... then ... else ... if ... then ... else ... By chance I rarely use guards and "where", therefore I give no examples for those expressions. Somewhat tricky I've found are 2 do-expressions connected by an infix-operator within an outer do-expression: do c <- letter do d <- digit return [c, d] <|> do u <- char '_' return [c, u] The line containing "<|> do" is critical to indentation. If "<|> do" is moved (2 columns) to the left it'll be wrong (by chance c will not be in scope). If "<|> do" is moved (3 columns) to the right it'll mean something different, namely parsing and returning a letter and a digit _or_ parsing a letter, a digit, and an underscore, but only return the letter and the underscore. In order to more clearly put the infix operator into the middle I've tried to insert one more space: do c <- letter do d <- digit return [c, d] <|> do u <- char '_' return [c, u] Also the indentation of data types is an issue, because I think, code shouldn't be indented due to long (constructor) names. I've nothing against long names, but one shouldn't try to put blocks to the right of them: data TName = LongConstructorName { selector1 :: C1 , ... } | LongSecondConstructor .... deriving ... Cheers Christian From rendel at cs.au.dk Mon Apr 20 16:44:58 2009 From: rendel at cs.au.dk (Tillmann Rendel) Date: Mon, 20 Apr 2009 16:44:58 +0200 Subject: [Hets-devel] [Haskell-cafe] breaking too long lines In-Reply-To: <49EC7107.2030704@dfki.de> References: <49EC7107.2030704@dfki.de> Message-ID: <49EC8A6A.9050307@cs.au.dk> Christian Maeder wrote: > I've nothing against long names, but one shouldn't try to put blocks > to the right of them. This is very important from my point of view. Indention should not depend on identifier length. However, I make an exception to that rule sometimes for definitions which look like tables (e.g. step functions for abstract machines). > do c <- letter > do d <- digit > return [c, d] > <|> do > u <- char '_' > return [c, u] I try to avoid these, e.g. I would use this instead: do c <- letter choice [ do d <- digit return [c, d] , do u <- char '_' return [c, u] ] Actually, I try to avoid do-blocks, but that's a different story. > data TName = > LongConstructorName > { selector1 :: C1 > , ... } > | LongSecondConstructor > .... > deriving ... I use data Maybe a = Just a | Nothing deriving Show or data Maybe a = Just { fromJust :: a } | Nothing deriving Show However, I would prefer the following Coq-like syntax: data Maybe a = | Just a | Nothing Tillmann From lrpalmer at gmail.com Wed Apr 22 21:03:41 2009 From: lrpalmer at gmail.com (Luke Palmer) Date: Wed, 22 Apr 2009 13:03:41 -0600 Subject: [Hets-devel] [Haskell-cafe] breaking too long lines In-Reply-To: <49EC8A6A.9050307@cs.au.dk> References: <49EC7107.2030704@dfki.de> <49EC8A6A.9050307@cs.au.dk> Message-ID: <7ca3f0160904221203p5c042a44t5786d4099791b865@mail.gmail.com> On Mon, Apr 20, 2009 at 8:44 AM, Tillmann Rendel wrote: > However, I would prefer the following Coq-like syntax: > > data Maybe a = > | Just a > | Nothing Of course, Coq's inductive syntax is just GADT form: Inductive Maybe a := | Just : a -> Maybe a | Nothing : Maybe a. data Maybe a where Just :: a -> Maybe a Nothing :: Maybe a I find GADT syntax much clearer than H98 syntax, so I use it when I'm not being picky about compatibility. :-) (And yes, I know you just meant the optional leading bar) Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christian.Maeder at dfki.de Tue Apr 28 16:18:53 2009 From: Christian.Maeder at dfki.de (Christian Maeder) Date: Tue, 28 Apr 2009 16:18:53 +0200 Subject: [Hets-devel] hets-2009-04-28-installer Message-ID: <49F7104D.7000901@dfki.de> Hi, I've created new hets installers for the current version of hets, because hets requires Isabelle2008, whereas http://isabelle.in.tum.de/ provides now Isabelle2009. The hets-0.93 installers can no longer be used to install Isabelle, because the Isabelle2008 files have been moved. http://www.informatik.uni-bremen.de/agbkb/forschung/formal_methods/CoFI/hets/installation_e.htm Cheers Christian