Skip to content

Commit 2892477

Browse files
committed
Fix not handling var and number
Code is extremely bad, but at least it looks correct.
1 parent bbb5d5b commit 2892477

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/scryer/cli/issues/incorrect_arithmetics.in/hoist-expr.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
length(Es, L),
2020
repeat,
2121
random_integer(0, L, I),
22-
format("~n% Info: Selected ~dth out of ~d found aritmetic relations that satisfy ~s template:~n", [I,L,Template]),
23-
nth0(I, Es, R).
22+
nth0(I, Es, R),
23+
format("~n% Info: Selected ~dth out of ~d found aritmetic relations that satisfy ~s template:~n\t~w~n", [I,L,Template,R]).
2424

2525
%% Proof-of-concept arithmetic expression expander
2626
%
@@ -41,6 +41,8 @@
4141
proceed(e,e) --> t.
4242
proceed(pi,pi) --> t.
4343
proceed(epsilon,epsilon) --> t.
44+
proceed(A,A) --> {var(A)}.
45+
proceed(A,A) --> {number(A)}.
4446

4547
ey(-A ,A, AR,-AR) --> t.
4648
ey(+A ,A, AR,+AR) --> t.

0 commit comments

Comments
 (0)