Skip to content

Commit

Permalink
Merge pull request #888 from AmpersandTarski/development
Browse files Browse the repository at this point in the history
Release 3.13.0
  • Loading branch information
hanjoosten authored Jan 18, 2019
2 parents 9dfc6db + d22ffcb commit 013e578
Show file tree
Hide file tree
Showing 65 changed files with 1,600 additions and 1,292 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ miscellaneous/AmpersandBackup.jgfns
.settings/org.eclipse.wst.common.project.facet.core.xml
.settings/org.eclipse.php.core.prefs
/.stack-work
\.ghci
/.ghci
/ghcid.txt

6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sudo: required
language: php

php:
- 7.0
- 7.1

cache:
directories:
Expand Down Expand Up @@ -127,7 +127,7 @@ install:
- |
case "$BUILD" in
stack)
stack --no-terminal --install-ghc $ARGS test --only-dependencies
stack --no-terminal --install-ghc $ARGS test --only-dependencies --flag ampersand:buildAll
;;
cabal)
cabal --version
Expand All @@ -143,7 +143,7 @@ script:
- |
case "$BUILD" in
stack)
./travis_long stack --no-terminal --test --local-bin-path=dist --copy-bins $ARGS build
./travis_long stack --no-terminal --test --local-bin-path=dist --copy-bins $ARGS build --flag ampersand:buildAll
;;
cabal)
./travis_long cabal test
Expand Down
52 changes: 26 additions & 26 deletions AmpersandData/FormalAmpersand/AST.ifc
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ BOX [ Signature: I[Signature]

INTERFACE PropertyRule FOR Ampersand : I[PropertyRule]
BOX [ "declaredthrough": declaredthrough[PropertyRule*Property]
, "propertyRule~" : propertyRule[Relation*PropertyRule]~ LINKTO INTERFACE "Relation"
]
, "propertyRule~" : propertyRule[Relation*PropertyRule]~ LINKTO INTERFACE "Relation"
]


INTERFACE Isa FOR Ampersand : I[Isa]
Expand All @@ -143,29 +143,29 @@ BOX [ "gens~" : gens[Context*Isa]~

INTERFACE Relation FOR Ampersand : I[Relation]
BOX [ "declared in context" : declaredIn[Relation*Context]
, "decMean" : decMean[Relation*Meaning]
, "decprL" : decprL[Relation*String]
, "decprM" : decprM[Relation*String]
, "decprR" : decprR[Relation*String]
, "propertyRule" : propertyRule[Relation*PropertyRule]
, "purpose" : purpose[Relation*Purpose]
, "name" : name[Relation*RelationName]
, "prop" : prop[Relation*Property]
, "sign" : sign[Relation*Signature]
, "source" : source[Relation*Concept]
-- , "srcAtt" : srcAtt[Relation*SqlAttribute]
, "target" : target[Relation*Concept]
-- , "tgtAtt" : tgtAtt[Relation*SqlAttribute]
, "bind~" : bind[BindedRelation*Relation]~
, "declared in pattern" : declaredIn[Relation*Pattern]
, "declared in context (outside a pattern)" : ctxds[Relation*Context]
-- , "in~" : in[Pair*Relation]~
-- BOX <SHCOLS->
-- [ lAtom : lAtom
-- , rAtom : rAtom
-- ]
, "valid in (context)" : valid[Relation*Context]
-- , "relsInPlug~" : relsInPlug[Plug*Relation]~
, "decMean" : decMean[Relation*Meaning]
, "decprL" : decprL[Relation*String]
, "decprM" : decprM[Relation*String]
, "decprR" : decprR[Relation*String]
, "propertyRule" : propertyRule[Relation*PropertyRule]
, "purpose" : purpose[Relation*Purpose]
, "name" : name[Relation*RelationName]
, "prop" : prop[Relation*Property]
, "sign" : sign[Relation*Signature]
, "source" : source[Relation*Concept]
-- , "srcAtt" : srcAtt[Relation*SqlAttribute]
, "target" : target[Relation*Concept]
-- , "tgtAtt" : tgtAtt[Relation*SqlAttribute]
, "bind~" : bind[BindedRelation*Relation]~
, "declared in pattern" : declaredIn[Relation*Pattern]
, "declared in context (outside a pattern)" : ctxds[Relation*Context]
-- , "in~" : in[Pair*Relation]~
-- BOX <SHCOLS->
-- [ lAtom : lAtom
-- , rAtom : rAtom
-- ]
, "valid in (context)" : valid[Relation*Context]
-- , "relsInPlug~" : relsInPlug[Plug*Relation]~
]

{-
Expand Down
16 changes: 16 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Release notes of Ampersand

## v3.13.0 (18 january 2019)

* Update prototype framework to v1.1.0. See [releases](https://github.com/AmpersandTarski/Prototype/releases) for more information
* Add 'public' folder in prototype directory to better distinguish between public and non-public scripts. If used, requires change in 'customizations' folder
* [Issue #616](https://github.com/AmpersandTarski/Ampersand/issues/616) Add missing TType 'Object' to parser
* [Issue #792](https://github.com/AmpersandTarski/Ampersand/issues/792) Add possibility to extend TXT in interfaces
* [Issue #862](https://github.com/AmpersandTarski/Ampersand/issues/862) Bugfix in generated SQL in several cases where CLASSIFY statements were involved in combination with relations with the INJ property.
* [Issue #865](https://github.com/AmpersandTarski/Ampersand/issues/865) Another bugfix in the generated SQL
* [Issue #873](https://github.com/AmpersandTarski/Ampersand/issues/873) It is now possible to provide warnings in the output while generating a script. Several warnings are now generated as well when appropriate.
* Only run composer install when clean install of prototype framework is downloaded
* Removed --dev switch as alias of self-explanatory --ignore-invariant-violations
* Improved output of any invariant violations or signals for initial population
* Improved use of compiler when no prototype is requested (reporting violations, testing specific rules and rap population output are possible)
* Improved use of compiler when no script is provided (e.g. for --sampleConfigFile)
* [Issue #879](https://github.com/AmpersandTarski/Ampersand/issues/879) Bugfix in the meatgrinder. Also a big performance win in generating meta-stuff.

## v3.12.0 (21 december 2018)

* [Issue #855](https://github.com/AmpersandTarski/Ampersand/issues/855) Minor enhancement in CLASSIFY statement
Expand Down
22 changes: 16 additions & 6 deletions ampersand.cabal
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: ampersand
version: 3.12.0
version: 3.13.0
author: Stef Joosten
maintainer: [email protected]
synopsis: Toolsuite for automated design of enterprise information systems.
description: You can define your business processes by means of rules, written in Relation Algebra.
homepage: http://ampersandtarski.github.io/
category: Database Design
stability: alpha
cabal-version: >= 2.0
cabal-version: 2.0
tested-with: GHC == 8.4.3
build-type: Custom
license: GPL
Expand All @@ -19,6 +19,11 @@ bug-reports: https://github.com/AmpersandTarski/ampersand/issues
data-files:
LICENSE

Flag buildAll
Description: Build both ampersand and ampPreProc.
Default: False
Manual: True

custom-setup
setup-depends: base == 4.11.*,
bytestring == 0.10.*,
Expand Down Expand Up @@ -186,13 +191,18 @@ executable ampersand
ampersand

executable ampPreProc
hs-source-dirs: preProcApp
main-is: Main.hs
hs-source-dirs: app
main-is: AmpPreProc.hs
default-language: Haskell2010
ghc-options: -Wall -threaded
default-extensions:NoImplicitPrelude
build-depends: base == 4.11.*,
ampersand
if flag(buildAll)
build-depends: base == 4.11.*,
containers == 0.5.*,
ampersand
buildable: True
else
buildable: False

Test-Suite regression-test
type: exitcode-stdio-1.0
Expand Down
3 changes: 2 additions & 1 deletion preProcApp/Main.hs → app/AmpPreProc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import Ampersand
import System.Environment
import Ampersand.Input.PreProcessor
import Ampersand.Basics.UTF8 (readUTF8File)
import qualified Data.Set as Set

main :: IO ()
main =
do
filename:defs <- getArgs;
input <- readUTF8File filename
inputString <- return $ either id id input
putStr $ either show id (preProcess' filename defs inputString) ++ "\n"
putStr $ either show id (preProcess' filename (Set.fromList defs) inputString) ++ "\n"
36 changes: 27 additions & 9 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,38 @@ import qualified Data.List.NonEmpty as NEL (toList)
main :: IO ()
main =
do opts <- getOptions
if showVersion opts || showHelp opts --HJO 20161127 TODO: There are more commands that do not
-- need a single filename to be specified,
-- like --sampleConfigFile. Currently, this
-- does not work properly. A more generic
-- approach for handling those options should
-- be thought of.
then mapM_ putStr (helpNVersionTexts ampersandVersionStr opts)
else do { verboseLn opts $ ampersandVersionStr
sequence_ . map snd . filter fst $ actionsWithoutScript opts -- There are commands that do not need a single filename to be speciied
case fileName opts of
Just _ -> do -- An Ampersand script is provided that can be processed
{ putStrLn "Processing your model..."
; gMulti <- createMulti opts
; case gMulti of
Errors err ->
exitWith . NoValidFSpec . intersperse (replicate 30 '=')
. fmap showErr . NEL.toList $ err
Checked multi ->
Checked multi ws -> do
showWarnings ws
generateAmpersandOutput multi
putStrLn "Finished processing your model"
putStrLn . ("Your script has no errors " ++) $
case ws of
[] -> "and no warnings"
[_] -> ", but one warning was found"
_ -> ", but "++show (length ws)++" warnings were found"
}
Nothing -> -- No Ampersand script is provided
if or (map fst $ actionsWithoutScript opts)
then verboseLn opts $ "No further actions, because no ampersand script is provided"
else putStrLn "No ampersand script provided. Use --help for usage information"

where
actionsWithoutScript :: Options -> [(Bool, IO())]
actionsWithoutScript options =
[ ( test options , putStrLn $ "Executable: " ++ show (dirExec options) )
, ( showVersion options || verboseP options , putStrLn $ versionText options )
, ( genSampleConfigFile options , writeConfigFile )
, ( showHelp options , putStrLn $ usageInfo' options )
]

versionText :: Options -> String
versionText opts = preVersion opts ++ ampersandVersionStr ++ postVersion opts
1 change: 1 addition & 0 deletions src/Ampersand/ADL1.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import Ampersand.ADL1.Expression
( primitives,subExpressions,Expressions
, notCpl, isCpl, isEEps, isMp1, isFlipped
, isPos, isNeg
, isFitForCrudC ,isFitForCrudR ,isFitForCrudU ,isFitForCrudD
, deMorganERad, deMorganECps, deMorganEUni, deMorganEIsc
, exprIsc2list, exprUni2list, exprCps2list, exprRad2list, exprPrd2list
, insParentheses)
Expand Down
67 changes: 67 additions & 0 deletions src/Ampersand/ADL1/Expression.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Ampersand.ADL1.Expression (
,subst
,primitives, subExpressions, isMp1, isEEps, isEDcD
,isPos,isNeg, deMorganERad, deMorganECps, deMorganEUni, deMorganEIsc, notCpl, isCpl, isFlipped
,isFitForCrudC ,isFitForCrudR ,isFitForCrudU ,isFitForCrudD
,exprIsc2list, exprUni2list, exprCps2list, exprRad2list, exprPrd2list
,insParentheses)
where
Expand Down Expand Up @@ -147,6 +148,72 @@ isFlipped EFlp{} = True
isFlipped (EBrk e) = isFlipped e
isFlipped _ = False

-- | Function to determine that the expression
-- could be used to create a new atom in its target concept
isFitForCrudC :: Expression -> Bool
isFitForCrudC expr =
case expr of
EDcD{} -> True
EFlp e -> isFitForCrudC e
EBrk e -> isFitForCrudC e
EEps _ _ -> False
EDcI{} -> True -- TODO: set to False when functionality of +menu is adapted from I[Cpt] to V[SESSION*Cpt] expressions (see Issue #884)
EMp1{} -> False
EDcV{} -> True
ECps ( (EEps _ _), e ) -> isFitForCrudC e
ECps ( e , (EEps _ _)) -> isFitForCrudC e
ECps ( _ , _ ) -> True
EEqu{} -> True
EInc{} -> True
EIsc{} -> True
EUni{} -> True
EDif{} -> True
ELrs{} -> True
ERrs{} -> True
EDia{} -> True
ERad{} -> True
EPrd{} -> True
EKl0{} -> True
EKl1{} -> True
ECpl{} -> True
-- | Function to determine that the expression
-- could be used to read the population of its target concept
isFitForCrudR :: Expression -> Bool
isFitForCrudR _ = True
-- | Function to determine that the expression
-- could be used to insert or delete a pair in the population of a relation
isFitForCrudU :: Expression -> Bool
isFitForCrudU expr =
case expr of
EDcD{} -> True
EFlp e -> isFitForCrudU e
EBrk e -> isFitForCrudU e
EEps _ _ -> False
EDcI{} -> False
EMp1{} -> False
EDcV{} -> False
ECps ( (EEps _ _), e ) -> isFitForCrudU e
ECps ( e , (EEps _ _)) -> isFitForCrudU e
ECps ( e , EDcI{} ) -> isFitForCrudU e
ECps ( _ , _ ) -> False
EEqu{} -> False
EInc{} -> False
EIsc{} -> False
EUni{} -> False
EDif{} -> False
ELrs{} -> False
ERrs{} -> False
EDia{} -> False
ERad{} -> False
EPrd{} -> False
EKl0{} -> False
EKl1{} -> False
ECpl{} -> False
-- | Function to determine that the expression is simple, that it
-- could be used to update the population of a relation
isFitForCrudD :: Expression -> Bool
isFitForCrudD _ = True


exprIsc2list, exprUni2list, exprCps2list, exprRad2list, exprPrd2list :: Expression -> [Expression]
exprIsc2list (EIsc (l,r)) = exprIsc2list l++exprIsc2list r
Expand Down
Loading

0 comments on commit 013e578

Please sign in to comment.