Assume that an environment is a list of terms of the form val(Parm,Val), where Val is the value associated with parameter Parm. You can assume that each parameter only appears once in an environment. An example environment is [val(a,7),val(b,5)].
In cilog, you can use <=
as the base-level implication and
&
as the base-level conjunction. You may need to get a new
version of cilog that has <=
defined as an infix
operator and with number as a built-in predicate. There is a new
version in ~cs322/cilog
. An example meta-interpreter is given
in prove.pl.
cilog: tell f(X,Y) <= Y is 2*a+b*X. cilog: ask pprove(f(3,Z),[val(a,7),val(b,5)]). Answer: pprove(f(3,29),[val(a,7),val(b,5)]). Runtime since last report: 20 ms. [ok,more,how,help]: ok. cilog: ask pprove(f(3,Z),[val(a,5),val(b,7)]). Answer: pprove(f(3,31),[val(a,5),val(b,7)]). Runtime since last report: 10 ms. [ok,more,how,help]: ok. cilog: tell dsp(X,Y) <= Z is X*X*a & Y is Z*Z*b. cilog: ask pprove(dsp(3,Z),[val(a,7),val(b,5)]). Answer: pprove(dsp(3,19845),[val(a,7),val(b,5)]). Runtime since last report: 20 ms. [ok,more,how,help]: ok. cilog: ask pprove(dsp(3,Z),[val(a,5),val(b,7)]). Answer: pprove(dsp(3,14175),[val(a,5),val(b,7)]). Runtime since last report: 10 ms. [ok,more,how,help]: ok.
Imagine you are axiomatizing the wiring in your home and you you have an axiomatization similar to elect.pl given in the text (section 3.2) and available on the web. You are axiomatizing the domain for a new tenant who is going to sublet your home. They need it to determine what may be going wrong with the wiring.
There are some predicates that you will know the definitions for, some that the tenant will know, and some that neither will know. Divide the predicates into these three categories, and suggest what predicates should be made askable, and which should be assumable. Show what the resulting interaction will look like under your division.