Solving III

Unfortunately, we don't have a function RADAR.
Instead, we know a = π*r2, which we know is invertible.
(Yields (* (PI (sq radius-circle))) radius-circle area-circle )

We need the rule that adds the possibility of inversion:
<= (Yields ?g ?x ?y)
(Yields ?f ?y ?x)
(Inv-Func ?f ?g ?x )

the rule that inverts functions:
<= (Inv-Func (?f (?const (?h ?h-args))) ?i ?y)
(Invertible ?f (?const (?h ?h-args)) (?h ?h-args) ?g ?g-args ?y)
(Inv-Func ?h ?h-args ?i (?g ?g-args)

with a teminator rule:

(<= (Inv-Func (?f ?x) (?g ?y) ?y) (Invertible ?f ?x ?g ?y))

Plus very few other statements, such as
(Invertible * (?const ?x) ?x / (?y ?const) ?y)
(Invertible sq ?x root ?y)

And we can can get the right plan using √(area/π):
 (DO (CALL-WEB-SERVICE COMPUTE FUNCTION (ROOT (/ (AREA-CIRCLE PI)))
         AREA-CIRCLE RETURN-CIRCUM-RAD RADIUS-CIRCLE)
    (DO (CALL-WEB-SERVICE CIRCUM-RAD CIRCUMFERENCE-CIRCLE 8 AREA-CIRCLE)
      S0) )


Full Code


© 2005 Charles Petrie cjp