-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating main with latest extension on logical-languages, document in…
…clusion and sCASP handling
- Loading branch information
Showing
17 changed files
with
1,300 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
data | ||
backupdata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
:- module('family_example',[]). | ||
|
||
en("the target language is: prolog. | ||
|
||
the templates are: | ||
*a person* is a parent of *an other person*, | ||
*a person* is a child of *an other person*, | ||
*a person* is male, | ||
*a person* is of opposite sex from *an other person*, | ||
*a person* is female, | ||
*a person* is a grandfather of *an other person*, | ||
*a person* is a father of *an other person*. | ||
|
||
the knowledge base family example includes: | ||
|
||
a person Y is a parent of a person X | ||
if X is a child of Y. | ||
|
||
a person Y is a father of a person X | ||
if X is a child of Y | ||
and Y is male. | ||
|
||
a person X is of opposite sex from a person Y | ||
if X is male | ||
and Y is female. | ||
|
||
a person Y is of opposite sex from a person X | ||
if X is male | ||
and Y is female. | ||
|
||
a person X is a grandfather of a person Z | ||
if X is a father of a person Y | ||
and Y is a parent of Z. | ||
|
||
scenario one is: | ||
john is a child of sue. | ||
john is a child of sam. | ||
jane is a child of sue. | ||
jane is a child of sam. | ||
sue is a child of george. | ||
sue is a child of gina. | ||
john is male. | ||
jane is female. | ||
june is female. | ||
sam is male. | ||
sue is female. | ||
george is male. | ||
|
||
query one is: | ||
jane is a child of sue. | ||
|
||
query two is: | ||
gina is female. | ||
|
||
query three is: | ||
george is a father of sue. | ||
|
||
query four is: | ||
jane is of opposite sex from george. | ||
|
||
query five is: | ||
george is a grandfather of john. | ||
|
||
query six is: | ||
which person is a grandfather of john. | ||
"). | ||
|
||
/** <examples> | ||
?- answer one with one. | ||
?- answer two with one. | ||
?- answer three with one. | ||
?- answer four with one. | ||
?- answer five with one. | ||
?- answer six with one. | ||
?- show prolog. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
:- module('bigger',[]). | ||
|
||
en("the target language is: prolog. | ||
|
||
the templates are: | ||
*an animal* is bigger than *an other animal*, | ||
*an animal* is just bigger than *an other animal*, | ||
|
||
the knowledge base bigger includes: | ||
|
||
an animal X is bigger than an animal Y | ||
if X is just bigger than Y. | ||
|
||
an animal X is bigger than an animal Y | ||
if X is just bigger than an animal Z | ||
and Z is bigger than Y. | ||
|
||
scenario one is: | ||
elephant is just bigger than horse. | ||
horse is just bigger than donkey. | ||
|
||
query one is: | ||
which animal X is bigger than which animal Y. | ||
|
||
"). | ||
|
||
/** <examples> | ||
?- answer one with one. | ||
?- show prolog. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
:- module('cittadinanza_ita+http://tests.com',[]). | ||
|
||
it("il linguaggio destinazione è: scasp. | ||
|
||
i modelli sono: | ||
*una persona* ha la cittadinanza italiana, | ||
*una persona* è padre di *una persona*, | ||
*una persona* è madre di *una persona*, | ||
*una persona* è nato in italia, | ||
*una persona* è apolide, | ||
il padre di *una persona* è sconosciuto, | ||
la madre di *una persona* è sconosciuta, | ||
*una persona* segue la cittadinanza di *una persona*. | ||
|
||
la base di conoscenza cittadinanza_ita include: | ||
una persona A ha la cittadinanza italiana | ||
se una persona B è padre di la persona A | ||
e la persona B ha la cittadinanza italiana. | ||
|
||
scenario giuseppe è: | ||
felice è padre di giuseppe. | ||
tatiana è madre di giuseppe. | ||
felice ha la cittadinanza italiana. | ||
tatiana ha la cittadinanza italiana. | ||
|
||
domanda uno è: | ||
quale persona ha la cittadinanza italiana. | ||
|
||
"). | ||
|
||
/** <examples> | ||
?- answer(uno, with(giuseppe), le(E), R). | ||
?- risposta uno con giuseppe. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
:- module('conjunto',[]). | ||
|
||
es("el lenguaje objetivo es: prolog. | ||
|
||
los predicados son: | ||
*un conjunto* es un subconjunto de *un conjunto*, | ||
*una cosa* es un conjunto, | ||
*una cosa* pertenece a *un conjunto*. | ||
|
||
la base de conocimiento conjunto incluye: | ||
|
||
un conjunto A es un subconjunto de un conjunto B | ||
si el conjunto A es un conjunto | ||
y el conjunto B es un conjunto | ||
y en todos los casos en los que | ||
una cosa pertenece a el conjunto A | ||
es el caso que | ||
la cosa pertenece a el conjunto B. | ||
|
||
escenario uno es: | ||
familia uno es un conjunto. | ||
familia dos es un conjunto. | ||
Roberto pertenece a la familia uno. | ||
Alicia pertenece a la familia uno. | ||
|
||
Alicia pertenece a la familia dos. | ||
|
||
la pregunta uno es: | ||
cuál primera familia es un subconjunto de cuál segunda familia. | ||
|
||
escenario dos es: | ||
[Alicia, Roberto] es un conjunto. | ||
[Alicia] es un conjunto. | ||
|
||
una cosa pertenece a un conjunto | ||
if la cosa is in el conjunto. | ||
|
||
la pregunta dos es: | ||
cuál conjunto es un subconjunto de cuál segundo conjunto. | ||
|
||
"). | ||
|
||
/** <examples> | ||
?- show prolog. | ||
?- responde dos con dos. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
:- module('italian_citizenship_to_include',[]). | ||
|
||
en("the target language is: prolog. % other languages available soon | ||
|
||
the templates are: | ||
*a person* is an italian citizen, | ||
*a person* is the father of *a person*, | ||
*a person* is the mother of *a person*, | ||
*a person* is born in italy, | ||
*a person* is stateless, | ||
*a person* follows the citizenship of *a person*. | ||
|
||
the knowledge base italian_citizenship_to_include includes: | ||
|
||
% Article 1.1(a) | ||
a person A is an italian citizen | ||
if a person B is the father of the person A | ||
and the person B is an italian citizen. | ||
|
||
a person A is an italian citizen | ||
if a person B is the mother of the person A | ||
and the person B is an italian citizen. | ||
|
||
% Article 1.1(b) | ||
a person A is an italian citizen | ||
if the person A is born in italy | ||
and unknown is the father of the person A | ||
and unknown is the mother of the person A. | ||
|
||
a person A is an italian citizen | ||
if the person A is born in italy | ||
and a person F is the father of the person A | ||
and the person F is stateless | ||
and the person M is the mother of the person A | ||
and the person M is stateless. | ||
|
||
a person A is an italian citizen | ||
if the person A is born in italy | ||
and a person F is the father of the person A | ||
and a person M is the mother of the person A | ||
and it is not the case that | ||
the person A follows the citizenship of the person F | ||
and the person A follows the citizenship of the person M. | ||
|
||
% add as many as you need | ||
scenario giuseppe is: | ||
felice is the father of giuseppe. | ||
tatiana is the mother of giuseppe. | ||
felice is an italian citizen. | ||
tatiana is an italian citizen. | ||
|
||
scenario luca is: | ||
luca is born in italy. | ||
unknown is the father of luca. | ||
unknown is the mother of luca. | ||
|
||
% add as many as you need | ||
query one is: | ||
which person is an italian citizen. | ||
|
||
"). | ||
|
||
/** <examples> | ||
?- answer("query one with scenario giuseppe"). | ||
?- answer(one, with(giuseppe), le(E), R). | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
:- module('minicontractv1+http://tests.com',[]). | ||
|
||
en("the target language is: prolog. | ||
% Logical English document | ||
|
||
the templates are: | ||
The terms of the contract are met, | ||
*a contract* is a valid contract, | ||
*a contract* is signed by the service provider, | ||
*a contract* is also signed by the service recipient, | ||
the service is delivered before *a date*, | ||
the service recipient maintains all communication within the confines of *a domain*, | ||
the service recipient delivers requested information before *a date*. | ||
|
||
the knowledge base minicontractv1 includes: | ||
A contract is a valid contract if | ||
the contract is signed by the service provider | ||
and the contract is also signed by the service recipient. | ||
|
||
The terms of the contract are met if | ||
the service is delivered before 2022-06-05T10:00:00 | ||
and the service recipient maintains all communication within the confines of domain | ||
and the service recipient delivers requested information before 2022-06-01T10:00:00. | ||
|
||
scenario one is: | ||
the service is delivered before 2022-06-05T10:00:00. | ||
the service recipient maintains all communication within the confines of domain. | ||
the service recipient delivers requested information before 2022-06-01T10:00:00. | ||
the contract is signed by the service provider. | ||
the contract is also signed by the service recipient. | ||
|
||
query one is: | ||
which contract is a valid contract. | ||
|
||
query two is: | ||
The terms of the contract are met. | ||
|
||
"). | ||
|
||
/** <examples> | ||
?- answer("query one with scenario one"). | ||
?- answer("query two with scenario one"). | ||
?- show prolog. | ||
*/ |
Oops, something went wrong.