Use custom operators

This commit is contained in:
2026-02-10 22:18:51 +01:00
parent 21414f75db
commit c82384764c
3 changed files with 72 additions and 63 deletions

View File

@ -18,12 +18,17 @@ fn main()
mult(zero, X, zero).
mult(s(Y), X, Z) :- mult(Y, X, W), add(W, X, Z).
op(10, yfx, +).
op(8, yfx, ^).
op(6, xfy, ::).
op(2, fx, [).
op(2, xf, ]).
op(3, yfx, |).
A + B :- test.
op(8, xfx, ^).
A ^ B + C :- test.
(A::B)::C :- A.
A::B::C :- A.
[Hd|Tl] :- Hd::Tl.
"
.into();