CarneadesDSL 1.1.0.1 → 1.2
raw patch · 4 files changed
+79/−15 lines, 4 files
Files
- CHANGELOG +9/−0
- CarneadesDSL.cabal +11/−3
- Language/Carneades/CarneadesDSL.lhs +57/−10
- Language/Carneades/ExampleCAES.lhs +2/−2
+ CHANGELOG view
@@ -0,0 +1,9 @@+1.1.0.1 => 1.2+=============+This package version is now compatible with the translation package CarneadesIntoDung. +See http://hackage.haskell.org/package/CarneadesIntoDung/++* Change the use of proof standards to rely on the definition of |PSName|+ to allow for an easier translation.++* Fix the definition of applicability to include all three conditions.
CarneadesDSL.cabal view
@@ -1,14 +1,14 @@ name: CarneadesDSL category: Argumentation, Embedded, AI-version: 1.1.0.1+version: 1.2 license: BSD3-cabal-version: >= 1.2+cabal-version: >= 1.6 license-file: LICENSE author: Bas van Gijzel, Henrik Nilsson maintainer: Bas van Gijzel <bmv@cs.nott.ac.uk> stability: experimental homepage: http://www.cs.nott.ac.uk/~bmv/CarneadesDSL/-copyright: Copyright (C) 2012 Bas van Gijzel+copyright: Copyright (C) 2013 Bas van Gijzel synopsis: An implementation and DSL for the Carneades argumentation model. description: An implementation and domain specific language for the Carneades argumentation model. See Haskell Gets Argumentative in the @@ -18,6 +18,9 @@ code for the cyclicity check. build-type: Simple +Extra-Source-Files:+ CHANGELOG+ Library build-depends: base >= 4 && < 5,@@ -31,3 +34,8 @@ Language.Carneades.Cyclic +source-repository head+ Type: git+ Location: https://github.com/nebasuke/CarneadesDSL++
Language/Carneades/CarneadesDSL.lhs view
@@ -57,7 +57,9 @@ \emph{exceptions}, and a proposition that denotes the \emph{conclusion}: \begin{code} newtype Argument = Arg ([PropLiteral], [PropLiteral], PropLiteral)-\end{code} + deriving Ord +\end{code}+ Arguments are considered equal if their premises, exceptions and conclusion are equal; thus arguments are identified by their logical content. The equality instance for |Argument| (omitted for brevity) takes@@ -162,12 +164,26 @@ Further, as each proposition is associated with a specific proof standard, we need a mapping from propositions to proof standards: \begin{code}-type PropStandard = PropLiteral -> ProofStandard+type PropStandard = PropLiteral -> PSName++data PSName = Scintilla + | Preponderance | ClearAndConvincing + | BeyondReasonableDoubt | DialecticalValidity+ deriving Eq \end{code}++\begin{spec}+psMap :: PSName -> ProofStandard +\end{spec}+ A proof standard is a function that given a proposition $p$, aggregates arguments pro and con $p$ and decides whether it is acceptable or not: \begin{code} type ProofStandard = PropLiteral -> CAES -> Bool++newtype ProofStandardNamed = P (String, PropLiteral -> CAES -> Bool)+instance Eq ProofStandardNamed where+ P (l1, _) == P (l2, _) = l1 == l2 \end{code} This aggregation process will be defined in detail in the next section, but note that it is done relative to a specific CAES, and note the@@ -213,19 +229,37 @@ (Specific proof standards are considered in the next section.) The realisation of applicability and acceptability in Haskell is straightforward:+-- \begin{code}+-- applicable :: Argument -> CAES -> Bool+-- applicable (Arg (prems, excns, _)) caes@(CAES (_, (assumptions, _), _)) + -- = and $ [(p `elem` assumptions) || (p `acceptable` caes) | p <- prems ]+ -- +++ -- [(e `elem` assumptions) `nor` (e `acceptable` caes) | e <- excns ]+ -- where+ -- x `nor` y = not (x || y)+-- acceptable :: PropLiteral -> CAES -> Bool+-- acceptable c caes@(CAES (_, _, standard)) + -- = c `s` caes + -- where P (_, s) = standard c+-- \end{code} \begin{code} applicable :: Argument -> CAES -> Bool-applicable (Arg (prems, excns, _)) caes@(CAES (_, (assumptions, _), _)) - = and $ [(p `elem` assumptions) || (p `acceptable` caes) | p <- prems ]+applicable (Arg (prems, excns, _)) + caes@(CAES (_, (assumptions, _), _)) + = and $ [ p `elem` assumptions || + ( negate p `notElem` assumptions &&+ p `acceptable` caes) | p <- prems ] ++- [(e `elem` assumptions) `nor` (e `acceptable` caes) | e <- excns ]- where- x `nor` y = not (x || y)+ [ (e `notElem` assumptions) &&+ ( negate e `elem` assumptions ||+ not (e `acceptable` caes)) | e <- excns ] acceptable :: PropLiteral -> CAES -> Bool acceptable c caes@(CAES (_, _, standard)) = c `s` caes - where s = standard c+ where s = psMap $ standard c+ + \end{code} @@ -245,7 +279,7 @@ \begin{code} scintilla :: ProofStandard scintilla p caes@(CAES (g, _, _))- = any (`applicable` caes) (getArgs p g) + = any (`applicable` caes) (getArgs p g) \end{code} Preponderance of the evidence additionally requires the maximum weight of@@ -311,7 +345,20 @@ = scintilla p caes && not (scintilla (negate p) caes) \end{code} +%if False+Proof standard names can then be mapped to their according proof standard. +\begin{code}+psMap :: PSName -> ProofStandard +psMap Scintilla = scintilla+psMap Preponderance = preponderance+psMap ClearAndConvincing = clear_and_convincing+psMap BeyondReasonableDoubt = beyond_reasonable_doubt+psMap DialecticalValidity = dialectical_validity+\end{code}+%endif++ \subsection{Convenience functions} We provide a set of functions to facilitate construction of propositions, arguments, argument sets and sets of assumptions. Together with the definitions@@ -491,7 +538,7 @@ mkAssumptions = map mkProp mkArg :: [String] -> [String] -> String -> Argument-mkArg ps es c = Arg ((map mkProp ps), (map mkProp es), (mkProp c))+mkArg ps es c = Arg (map mkProp ps, map mkProp es, mkProp c) \end{code} Globally predefined alpha, beta and gamma.
Language/Carneades/ExampleCAES.lhs view
@@ -74,8 +74,8 @@ the CAES from the argument graph, audience and function |standard|: \begin{code} standard :: PropStandard -standard (_, "intent") = beyond_reasonable_doubt-standard _ = scintilla +standard (_, "intent") = BeyondReasonableDoubt +standard _ = Scintilla caes :: CAES caes = CAES (argSet, audience, standard)