From 764ce5114e84b11fa897efd19a1f2353473fdf5f Mon Sep 17 00:00:00 2001 From: someone Date: Mon, 4 Jun 2012 11:59:00 +0200 Subject: [PATCH] w and f with working tests --- w.dl | 9 +++++++++ w.test1.dl | 6 +++--- w.test2.dl | 6 +++--- w.test3.dl | 6 +++--- w.test4.dl | 6 +++--- w.test5.dl | 7 +++---- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/w.dl b/w.dl index e69de29..9d27788 100644 --- a/w.dl +++ b/w.dl @@ -0,0 +1,9 @@ +% windmill definition. + +p(C,op,OP) :- not ab(C), windmill(C), c(C,iw,IW), IW < 5, OP = 0. +p(C,op,OP) :- not ab(C), windmill(C), c(C,iw,IW), IW > 40, OP = 0. +p(C,op,OP) :- not ab(C), windmill(C), c(C,i1,I1), I1 = 0, OP = 0. +p(C,op,OP) :- not ab(C), windmill(C), c(C,i1,I1), c_max(C,MAX), c(C,iw,IW), IW >= 5, IW <= 40, I1 > 0, MAX >= I1, OP = I1, #int(OP). +p(C,op,OP) :- not ab(C), windmill(C), c(C,i1,I1), c_max(C,MAX), c(C,iw,IW), IW >= 5, IW <= 40, I1 > 0, I1 > MAX, OP = MAX, #int(OP). + + diff --git a/w.test1.dl b/w.test1.dl index 8cc2977..c0ea4b4 100644 --- a/w.test1.dl +++ b/w.test1.dl @@ -12,12 +12,12 @@ c(w,iw,10). % we test. % expecting i1 to be 5 -expect_c(f,i1,5). +expect_c(w,i1,5). % expecting iw to be 10 -expect_c(f,iw,10). +expect_c(w,iw,10). % and therefore we shall produce 10KW -expect_p(f,op,5). +expect_p(w,op,5). diff --git a/w.test2.dl b/w.test2.dl index fd51099..b436f81 100644 --- a/w.test2.dl +++ b/w.test2.dl @@ -12,12 +12,12 @@ c(w,iw,10). % we test. % expecting i1 to be 0 -expect_c(f,i1,0). +expect_c(w,i1,0). % expecting iw to be 10 -expect_c(f,iw,10). +expect_c(w,iw,10). % and therefore we shall produce 0KW -expect_p(f,op,0). +expect_p(w,op,0). diff --git a/w.test3.dl b/w.test3.dl index d0b2e13..7e72fff 100644 --- a/w.test3.dl +++ b/w.test3.dl @@ -12,12 +12,12 @@ c(w,iw,0). % we test. % expecting i1 to be 5 -expect_c(f,i1,5). +expect_c(w,i1,5). % expecting iw to be 0 -expect_c(f,iw,0). +expect_c(w,iw,0). % and therefore we shall produce 10KW -expect_p(f,op,0). +expect_p(w,op,0). diff --git a/w.test4.dl b/w.test4.dl index 320a53a..a620d2f 100644 --- a/w.test4.dl +++ b/w.test4.dl @@ -12,11 +12,11 @@ c(w,iw,10). % we test. % expecting i1 to be 25 -expect_c(f,i1,25). +expect_c(w,i1,25). % expecting iw to be 10 -expect_c(f,iw,10). +expect_c(w,iw,10). % and therefore we shall produce 20KW as (MAX is 20) -expect_p(f,op,20). +expect_p(w,op,20). diff --git a/w.test5.dl b/w.test5.dl index 0bdadcc..e9f2e65 100644 --- a/w.test5.dl +++ b/w.test5.dl @@ -12,12 +12,11 @@ c(w,iw,50). % we test. % expecting i1 to be 5 -expect_c(f,i1,5). +expect_c(w,i1,5). % expecting iw to be 10 -expect_c(f,iw,50). +expect_c(w,iw,50). % and therefore we shall produce 0KW -expect_p(f,op,0). - +expect_p(w,op,0). -- 2.43.0