CarneadesDSL 1.1 → 1.1.0.1
raw patch · 2 files changed
+13/−1 lines, 2 files
Files
- CarneadesDSL.cabal +2/−1
- Language/Carneades/Cyclic.hs +11/−0
CarneadesDSL.cabal view
@@ -1,6 +1,6 @@ name: CarneadesDSL category: Argumentation, Embedded, AI-version: 1.1+version: 1.1.0.1 license: BSD3 cabal-version: >= 1.2 license-file: LICENSE@@ -28,5 +28,6 @@ exposed-modules: Language.Carneades.CarneadesDSL Language.Carneades.ExampleCAES+ Language.Carneades.Cyclic
+ Language/Carneades/Cyclic.hs view
@@ -0,0 +1,11 @@+-- Based on initial code provided by Stefan Sabev+module Language.Carneades.Cyclic(cyclic) where+import Data.Graph.Inductive++cyclic :: (DynGraph g) => g a b -> Bool+cyclic g | not (null leafs) = cyclic (delNodes leafs g)+ | otherwise = not (isEmpty g)+ where leafs = filter (isLeaf g) (nodes g)++isLeaf :: (DynGraph g) => g a b -> Node -> Bool+isLeaf g n = n `notElem` map fst (edges g)