Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More basic test cases for L4 -> LE #417

Merged
merged 5 commits into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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].
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*a x* is twice of *a y*
Original file line number Diff line number Diff line change
@@ -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(_, _)).
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DECIDE,BoolOne rpnary syntax,IS,&&,fact 1
,,,,fact 2
,,,,fact 3
Original file line number Diff line number Diff line change
@@ -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.
Loading