Skip to content

Commit

Permalink
add test case for product
Browse files Browse the repository at this point in the history
  • Loading branch information
johsi-k committed Aug 13, 2023
1 parent 9bf3010 commit 3ff142b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
:-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, []).
example(istwice, [scenario([(product_list([_, 2], 'A'):-true)], true)]).
query(null, true).
query(q, is_twice_of(_, _)).
query(q1, between(0, 100, _)).
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
GIVEN,x,IS A,Number,
,y,IS A,Number,
DECIDE,x,is twice of,y,
IF,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.

0 comments on commit 3ff142b

Please sign in to comment.