F-Limette User Manual
F-Limette[(flimette>F-Limette: Homepage of F-Limette)] is basically an extension of Prolog that adds a temporal aspect as well as Fuzziness[(prolog>http://en.wikipedia.org/wiki/Prolog: Introduction to Prolog from Wikipedia)]. The former allows for the assignment of predicates not only with values {0,1}, but also with real numbers in [0,1]. Thus, concepts such as “little” or “moderate” can be implemented.
Syntax
-
and: »
,
« -
or: »
;
« -
Command Line end: »
.
« -
Implication: »
:-
« (←), »-:
« (→)
> Another F-limette-manual can be found here :[(flimetteman>F-Limette Manual: F-Limette Documentation(pdf) )] .
Examples
# Tips/Tricks # Issue all output without Interaction set(stop, +i). # Always issue one more output set(stop, 1). # Output the next result ;
# Define statements(assertions). The following statement can be interpreted as follows: # assert that at time 0 :has_status(seby, 32) asserta(0 ! has_status(seby, 32)). # similarly: at time 0 : has_status(andy, 33) asserta(0 ! has_status(andy, 33)). asserta(0 ! has_status(davy, 13)). # With different time points asserta(1 ! has_status(andy, 34)). asserta(2 ! has_status(andy, 35)). asserta(3 ! has_status(andy, +i)). # Introduce Fuzziness. If not specified, it defaults to 1. asserta(0.5 | 1 ! has_status(davy, 14)). asserta(0.6 | 1 ! has_status(davy, 13)). asserta(0.9 | 2 ! has_status(davy, 14)). asserta(0.1 | 2 ! has_status(davy, 13)). # Query limette as follows: "with what Fuzziness" | at what timepoint ? which statement statement. # Here: Fuzziness: eps (ε, also works)| timepoint 0 ? Who is 33? eps | 0 ? has_status(_,33). # Expected Answer: andy # Return all those with age > 14 at time point 0 eps | 0 ? has_status(Name,Age), Age > 14. # Find the time point at which there is one with age 35. eps | event findall[L] Name -: has_status(Name,35). # Other Examples eps | event findall[L] Name -: has_status(Name,13). 0.5 | event findall[L] Name -: has_status(Name,13).
Example 2
The following examples are from the book [ [(ref:Schaefer1997)]
Page 153ff:
/* "When is it absolutely true that any car is packed at any location?" */ ?- event parken_an_ort(Pkw,Ort).
F-LIMETTE in Linux
Under Linux,the C++ Source code is available from the Homepage [(ref:Schaefer1997)]. Compile with gcc-4.4 after making the following changes:
limette/Makefile - cd $(RLHOME) && configure + cd $(RLHOME) && ./configure limette/scanner.l + %option noyywrap limString.cc - #include <strstream.h> + #include <strstream> + using namespace std; limString.hh - #include <stream.h> + #include <iostream> + using namespace std; cppmod.cc - #include <stream.h> + #include <iostream> + using namespace std; limTerm.hh - #include <stream.h> + #include <iostream> + using namespace std; + class limSubst; limCommand.hh - #include <strstream.h> + #include <strstream> + using namespace std;
Examples 3 3:Getting Started with F-LIMETTE
Starting and Closing:
user@computer:Limette/limette > ll limette2 -rwxrwxr-x 1 user user 1674968 2011-06-29 19:03 limette2 user@computer:Limette/limette > ./limette2 <0> :-) author. Karl H. Schaefer <0> :-) version. LIMETTE-2 Jun 29 2011 19:03:48 <0> :-) quit. :-| good bye. user@computer:Limette/limette >
Facts and Queries A knowledge base (KB) is a collection of facts. In F-Limette they always look like this: always(bird(chicken)). always(animal(lion)). always(animal(zebra)).
Where always() stands for time from minus infinity to plus infinity, and is just an alias for: -i : +i !
Requests are entered directly into F-Limette, e.g.: bird(chicken).
Note: :- bird(chicken) corresponds to yes even if after entering ”;” even if it follows a no (*the rest of the text s unineteligible for me*)
<0> :-) assertz(always(animal(lion))). <0> :-) assertz(always(animal(zebra))). <0> :-) asserta(always(bird(chicken))). <0> :-) list. 1: -i : +i ! bird(chicken). 2: -i : +i ! animal(lion). 3: -i : +i ! animal(zebra). <1> :-) animal(Var). :- animal(lion); :- animal(zebra); no <2> :-) bird(chicken). :- bird(chicken); no <3> :-) bird(car). no <3> :-) history. <0> animal(Var) [STOPPED] <1> bird(chicken) [STOPPED] <2> bird(car) [STOPPED] <3> :-)
Rules All birds are animals. And that is of course true round the clock That is bird(X) follows from animal(X):
always(animal(X) :- bird(X)).
It is not necessary to always type this. It can be loaded in a File.
user@computer:Limette/limette > more ../Daten/limette_files/test_file.lim always(bird(chicken)). always(animal(lion)). always(animal(zebra)). always(animal(X) :- bird(X)).
The directory specified with cd must be a constant, i.e. start with a lower case character. Be sure to pass the appropriate characters in-between ‘ ‘ e.g. ‘..’, ‘Data’, limette_files or ‘limette_files’
If you add the file name without the .lim extension, the contents of the file are appended to the current module.
user@computer:Limette/limette > ./limette2 <0> :-) pwd. /home/user/Programme/Limette/limette <0> :-) cd('..'). <0> :-) cd('Daten'). <0> :-) cd(limette_files). <0> :-) add('test_file'). <0> :-) list. 1: -i : +i ! bird(chicken). 2: -i : +i ! animal(lion). 3: -i : +i ! animal(zebra). 4: -i : +i ! (animal(_0) :- bird(_0)). <0> :-) animal(chicken). :- animal(chicken); no <1> :-) modules. test_file <1> :-) where. test_file
A few other Parameters can be set. We now want the debug-mode:
The one can gradually “creep” by going through the evaluations or leave the trace to display all the steps at once.
<2> :-) get. alpha = [ 1, 1, 1, 1, 0 ] answer = formula cycles = off debug = off defcheck = on gates = delay limits = +i narrow = off print = normal queue = depth stop = 1 store = proof trace = off memo = off <2> :-) set(debug,on). <2> :-) get(debug). debug = on <2> :-) animal(chicken). ( 8) 1 Call: animal(chicken) : ? :-( debugger command must be one of abort, creep, fail, leap, skip, trace. ( 8) 1 Call: animal(chicken) : trace ( 10) 2 Call: bird(chicken) ( 10) 2 Exit: bird(chicken) ( 8) 1 Exit: animal(chicken) :- animal(chicken); no <3> :-) animal(chicken). ( 13) 1 Call: animal(chicken) : creep ( 15) 2 Call: bird(chicken) : creep ( 15) 2 Exit: bird(chicken) ( 13) 1 Exit: animal(chicken) :- animal(chicken); no
Changes can be saved: File name should not contain illegal characters ‘test_file.lim’.
<4> :-) asserta(always(bird(eagle))). <4> :-) animal(X). :- animal(lion); :- animal(zebra); :- animal(eagle); :- animal(chicken); no <5> :-) where. test_file <5> :-) list(test_file). 1: -i : +i ! bird(eagle). 2: -i : +i ! bird(chicken). 3: -i : +i ! animal(lion). 4: -i : +i ! animal(zebra). 5: -i : +i ! (animal(_0) :- bird(_0)). <5> :-) save(test_file,'test_file.lim'). <5> :-) quit. :-| good bye. user@computer:Limette/limette > more ../Daten/limette_files/test_file.lim -i : +i ! bird(eagle). -i : +i ! bird(chicken). -i : +i ! animal(lion). -i : +i ! animal(zebra). -i : +i ! (animal(_0) :- bird(_0)).
References
<refnotes> notes-separator : none </refnotes>
427 thoughts on “F-Limette User Manual [en]”