diff --git a/lib/haskell/natural4/test/Testcases/LogicalEnglish/and-not/and-not.csv b/lib/haskell/natural4/test/Testcases/LogicalEnglish/and-not/and-not.csv new file mode 100644 index 000000000..275a1c75b --- /dev/null +++ b/lib/haskell/natural4/test/Testcases/LogicalEnglish/and-not/and-not.csv @@ -0,0 +1,5 @@ +GIVEN,x,IS A,Animal +,aquatic animal,IS A,Aquatic animal +DECIDE,x,is an,aquatic animal +IF,,x,lives in water +AND,NOT,x,lives on land diff --git a/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/nonlib-rules.txt b/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/nonlib-rules.txt new file mode 100644 index 000000000..a49f860b7 --- /dev/null +++ b/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/nonlib-rules.txt @@ -0,0 +1,3 @@ +a x is twice of a y +if y is between 0 & 100 +and x is the product of [y, 2]. diff --git a/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/nonlib-templates.txt b/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/nonlib-templates.txt new file mode 100644 index 000000000..7e2a06db5 --- /dev/null +++ b/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/nonlib-templates.txt @@ -0,0 +1 @@ +*a x* is twice of *a y* diff --git a/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/notes/product.pl b/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/notes/product.pl new file mode 100644 index 000000000..9eee1f35f --- /dev/null +++ b/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/notes/product.pl @@ -0,0 +1,11 @@ +:-module('product-prolog', []). +source_lang(en). +local_dict([is_twice_of, A, B], [x-x, y-y], [A, is, twice, of, B]). +local_meta_dict([],[],[]). +prolog_le(verified). +is_twice_of(A, B) :- + between(0, 100, B), + product_list([B, 2], A). +example(null, []). +query(null, true). +query(q, is_twice_of(_, _)). diff --git a/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/product.csv b/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/product.csv new file mode 100644 index 000000000..125b588d3 --- /dev/null +++ b/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/product.csv @@ -0,0 +1,7 @@ +GIVEN,x,IS A,Number, +,y,IS A,Number, +DECIDE,x,is twice of,y, +IF,y,>=,0, +AND,y,<=,100, +AND,x,IS,PRODUCT,y +,,,,2 diff --git a/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/product.le b/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/product.le new file mode 100644 index 000000000..e96d8a880 --- /dev/null +++ b/lib/haskell/natural4/test/Testcases/LogicalEnglish/product-twiceof/product.le @@ -0,0 +1,12 @@ +the target language is: prolog. + +the templates are: + *a x* is twice of *a y*. + +the knowledge base encoding includes: + a x is twice of a y + if y is between 0 & 100 + and x is the product of [y, 2]. + +query q is: + which number is twice of which other number. diff --git a/lib/haskell/natural4/test/Testcases/LogicalEnglish/rpnary-and/rpnary-and.csv b/lib/haskell/natural4/test/Testcases/LogicalEnglish/rpnary-and/rpnary-and.csv new file mode 100644 index 000000000..39f506f9d --- /dev/null +++ b/lib/haskell/natural4/test/Testcases/LogicalEnglish/rpnary-and/rpnary-and.csv @@ -0,0 +1,3 @@ +DECIDE,BoolOne rpnary syntax,IS,&&,fact 1 +,,,,fact 2 +,,,,fact 3 diff --git a/lib/haskell/natural4/test/Testcases/LogicalEnglish/simple-sum/notes/simple-sum.le b/lib/haskell/natural4/test/Testcases/LogicalEnglish/simple-sum/notes/simple-sum.le new file mode 100644 index 000000000..59f1c976c --- /dev/null +++ b/lib/haskell/natural4/test/Testcases/LogicalEnglish/simple-sum/notes/simple-sum.le @@ -0,0 +1,31 @@ +the target language is: prolog. + +the templates are: + *a number* is the sum of *a list*, + the additional savings is *a number*, + the total savings is *a z*, + the initial savings is *a x*, + the additional savings is *a y*. + + +the knowledge base includes: + + % Arithmetic predicates required for sum example + a number is the sum of a list + if number is the sum of each X such that + X is in list. + + the total savings is a z + if the initial savings is a x + and the additional savings is a y + and z is the sum of [x, y]. + +scenario simple is: + the initial savings is 1000. + the additional savings is 337. + +%query q is: +% 0 < 1. + +query totalsavings is: + the total savings is which value. \ No newline at end of file