forked from LogicalContracts/LogicalEnglish
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'LogicalContracts:main' into main
- Loading branch information
Showing
3 changed files
with
122 additions
and
12 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
the templates are: | ||
*a subject* owns *a number* of the sheeps. | ||
*a number* of sheeps do all my subjects together own. | ||
|
||
the knowledge base censusbook includes: | ||
|
||
a number N of sheeps do all my subjects together own | ||
if N is the sum of each other number such that | ||
a subject owns the other number of the sheeps. | ||
|
||
scenario today is: | ||
John Smith owns 1 of the sheeps. | ||
Mary Jones owns 2 of the sheeps. | ||
Elon Musk owns 5626 of the sheeps. | ||
|
||
scenario tomorrow is: | ||
John Smith owns 1 of the sheeps. | ||
Mary Jones owns 3 of the sheeps. | ||
Elon Musk owns 5626 of the sheeps. | ||
|
||
query total is: | ||
which number of sheeps do all my subjects together own. | ||
|
||
query percapita is: | ||
which person owns which number of the sheeps. |
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,39 @@ | ||
:- module(censusbook,[]). | ||
|
||
en("the target language is: prolog. | ||
|
||
the templates are: | ||
*a subject* owns *a number* of the sheeps. | ||
*a number* of sheeps do all my subjects together own. | ||
|
||
the knowledge base censusbook includes: | ||
|
||
a number N of sheeps do all my subjects together own | ||
if N is the sum of each other number such that | ||
a subject owns the other number of the sheeps. | ||
|
||
scenario today is: | ||
John Smith owns 1 of the sheeps. | ||
Mary Jones owns 2 of the sheeps. | ||
Elon Musk owns 5626 of the sheeps. | ||
|
||
scenario tomorrow is: | ||
John Smith owns 1 of the sheeps. | ||
Mary Jones owns 3 of the sheeps. | ||
Elon Musk owns 5626 of the sheeps. | ||
|
||
query total is: | ||
which number of sheeps do all my subjects together own. | ||
|
||
query percapita is: | ||
which person owns which number of the sheeps. | ||
|
||
"). | ||
|
||
/** <examples> | ||
?- answer("total with scenario today"). | ||
?- answer("total with scenario tomorrow"). | ||
?- answer("percapita with scenario today"). | ||
?- answer("percapita with scenario tomorrow"). | ||
?- 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