Explorar o código

Add different uses of range

DricomDragon %!s(int64=5) %!d(string=hai) anos
pai
achega
9d19436326
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      tp/1/multi.lp

+ 6 - 0
tp/1/multi.lp

@@ -1,2 +1,8 @@
 % Define
 p(M2, M4) :- M1 = 1..4, M2 = 2 * M1, M4 = 4 * M1.
+
+q(M1, S) :- M1 = 0..4, S = -1 ** M1.
+
+l(K, I) :- K = 1..4, I = 1..K.
+
+r(1..2,1..4). r(1..4,1..2).