Explorar o código

Indroduce the use of constants

DricomDragon %!s(int64=5) %!d(string=hai) anos
pai
achega
23a4f57d5d
Modificáronse 2 ficheiros con 4 adicións e 1 borrados
  1. 2 1
      tp/1/warm_city.lp
  2. 2 0
      tp/1/warm_custom_const.bash

+ 2 - 1
tp/1/warm_city.lp

@@ -2,7 +2,8 @@
 t(rennes, 4 ; nantes, 5 ; marseille, 8 ; paris, 2).
 
 % Test
-warm(V) :- t(V, T), T > 4.
+#const ts = 4.
+warm(V) :- t(V, T), T > ts.
 
 % Display
 #show warm/1.

+ 2 - 0
tp/1/warm_custom_const.bash

@@ -0,0 +1,2 @@
+#!/bin/bash -x
+clingo warm_city.lp --const ts=6