Examples.hs revision b5b5f5a2ebf5297bad207ef8f6621cdf441b75ed
dee396d567b71629f09f7e0692396afff732e33bChristian Maederdol = "%% a simple parthood ontology in OWL\n\
dee396d567b71629f09f7e0692396afff732e33bChristian Maeder \logic OWL\n\
dee396d567b71629f09f7e0692396afff732e33bChristian Maeder \ontology Parthood_OWL =\n\
3f69b6948966979163bdfe8331c38833d5d90ecdChristian Maeder \ ObjectProperty: isPartOf\n\
dee396d567b71629f09f7e0692396afff732e33bChristian Maeder \ ObjectProperty: isProperPartOf\n\
dee396d567b71629f09f7e0692396afff732e33bChristian Maeder \ Characteristics: Asymmetric\n\
dee396d567b71629f09f7e0692396afff732e33bChristian Maeder \ SubPropertyOf: isPartOf\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \%% we cannot specify an object property to be both asymmetric and transitive in OWL. Therefore, we switch to Common Logic\n\
dee396d567b71629f09f7e0692396afff732e33bChristian Maeder \logic CommonLogic\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \ontology Parthood_CL =\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ Parthood_OWL\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ with translation OWL22CommonLogic\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \ (forall (x y z) (if (and (isProperPartOf x y) (isProperPartOf y z))\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \ (isProperPartOf x z)))\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maedercasl :: String
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maedercasl = "spec Strict_Partial_Order =\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \sort Elem\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \pred __<__ : Elem * Elem\n\
6a9b85953df4e29a996536ffc7dbf7ef9dbc64c7Cui Jian \forall x, y, z:Elem\n\
6a9b85953df4e29a996536ffc7dbf7ef9dbc64c7Cui Jian \. not x < x %(irreflexive)%\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \. x < y /\\ y < z => x < z %(transitive)%\n\
dee396d567b71629f09f7e0692396afff732e33bChristian Maeder \%% the following is logically entailed\n\
ad270004874ce1d0697fb30d7309f180553bb315Christian Maeder \. x < y => not y < x %(asymmetric)% %implied\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maederowl = "Prefix: : <http://example.org/>\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \AnnotationProperty: Implied\n\
72ab63869f1e2ade586af4acb9218b46ab25ea9bCui Jian \Class: Person\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \Class: Woman SubClassOf: Person\n\
74d9a385499bf903b24848dff450a153f525bda7Christian Maeder \ObjectProperty: hasChild\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \Class: Mother \n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ EquivalentTo: Woman and hasChild some Person\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \Individual: mary Types: Woman Facts: hasChild john\n\
3bd08499449d7a250c1e297c59f52555d20c5dc2Cui Jian \Individual: john Types: Person\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \Individual: mary \n\
72ab63869f1e2ade586af4acb9218b46ab25ea9bCui Jian \ Types: Annotations: Implied \"true\"^^xsd:boolean\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maederclif :: String
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maederclif = "(cl-text strict_partial_order.clif\n\
e389bfa263e2f58f594903f092731fb18f8a5392Christian Maeder \ (forall (x) (not (< x x))) // irreflexive\n\
c614d41379feab88fe8298e068aa590420c4a018Christian Maeder \ (forall (x y z) (if (and (< x y) (< y z)) (< x z))) // transitive\n\
c614d41379feab88fe8298e068aa590420c4a018Christian Maeder \ (forall (x y) (if (< x y) (not (< y x)))) // asymmetric\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maederpropositional :: String
72ab63869f1e2ade586af4acb9218b46ab25ea9bCui Jianpropositional = "logic Propositional\n\
ef4bd99a054aac95f1bc9191e9972baa2d4e6faaChristian Maeder \spec Raining =\n\
ef4bd99a054aac95f1bc9191e9972baa2d4e6faaChristian Maeder \ props raining, wet_street\n\
ef4bd99a054aac95f1bc9191e9972baa2d4e6faaChristian Maeder \ . raining => wet_street\n\
dee396d567b71629f09f7e0692396afff732e33bChristian Maeder \ %(if raining, the street is wet)%\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \spec Scenario1 = Raining then\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ . not wet_street %(the street is not wet)%\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ . not raining %(it is not raining)% %implied\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \spec Scenario2 = Raining then\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ . wet_street %(the street is wet)%\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ %% the following does not hold...\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ . raining %(hence it must rain...)% %implied\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maederrdf = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \@prefix dc: <http://purl.org/dc/elements/1.1/> .\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \@prefix ex: <http://example.org/stuff/1.0/> .\n\
ef4bd99a054aac95f1bc9191e9972baa2d4e6faaChristian Maeder \<http://www.w3.org/TR/rdf-syntax-grammar>\n\
ef4bd99a054aac95f1bc9191e9972baa2d4e6faaChristian Maeder \ dc:title \"RDF/XML Syntax Specification (Revised)\" ;\n\
dee396d567b71629f09f7e0692396afff732e33bChristian Maeder \ ex:editor [\n\
c614d41379feab88fe8298e068aa590420c4a018Christian Maeder \ ex:fullname \"Dave Beckett\";\n\
c614d41379feab88fe8298e068aa590420c4a018Christian Maeder \ ex:homePage <http://purl.org/net/dajobe/>\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maedertptp :: String
72ab63869f1e2ade586af4acb9218b46ab25ea9bCui Jiantptp = "fof(irreflexive, axiom,\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ ! [X]: (~ less(X, X))).\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \fof(transitive, axiom,\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ ! [X, Y, Z]: ((less(X, Y) & less(Y, Z)) => less(X, Z))).\n\
c614d41379feab88fe8298e068aa590420c4a018Christian Maeder \fof(asYmmetric, conjecture,\n\
c614d41379feab88fe8298e068aa590420c4a018Christian Maeder \ ! [X, Y]: (less(X, Y) => ~ less(Y, X)))."
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maederhascasl :: String
72ab63869f1e2ade586af4acb9218b46ab25ea9bCui Jianhascasl = "logic HasCASL\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \spec Functions =\n\
0f54077ce2753086afc4025f6d282fd66a7a04adChristian Maeder \ ops __o__ : forall a, b, c:Type . \n\
c614d41379feab88fe8298e068aa590420c4a018Christian Maeder \ (b ->? c) * (a ->? b) -> (a ->? c);\n\
6a9b85953df4e29a996536ffc7dbf7ef9dbc64c7Cui Jian \ id : forall a:Type . a ->? a;\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ vars a, b, c : Type;\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ g : b ->? c;\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ f : a ->? b;\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ . g o f = \\ x . g (f x) %(o_def)%\n\
6a9b85953df4e29a996536ffc7dbf7ef9dbc64c7Cui Jian \ . id = \\ x . x %(id_def)%\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ then %implies\n\
6a9b85953df4e29a996536ffc7dbf7ef9dbc64c7Cui Jian \ vars a, b, c , d : Type;\n\
b91b82fd2625c349da6284f252cf4c50a6519650Christian Maeder \ f' : a ->? a;\n\