Sunday, September 18, 2016

Wlodkowic - a new language

I have started implementing a new language based on Perkun. Its name is Wlodkowic (to honor Paweł Włodkowic). It comes as a part of the Perkun package, download Perkun 0.1.2 (from http://sourceforge.net/projects/perkun/) in order to check it.

It is not finished yet, it's just the first milestone. You may run the tests (run "configure" and then "make check"). Its sources are in the directory "src2". Its tests do not require installing (unlike the Perkun tests).

The syntax changes:
  • there are two additional sections - knowledge and apriori
  • the section "knowledge" may contain "unimportant" rules
  • the queries may contain the whole equivalence classes instead of values
I think it is better to see an example. Take a look at the file src2/t8.wlodkowic. Its section "knowledge" (following the "variables" section) contains four "unimportant" rules.

knowledge
{
    unimportant({patient_is_alive=>false},patient_complains_about_x=>[{false,true}]);
    unimportant({patient_is_alive=>false},disease_1=>[{false,true}]);
    unimportant({patient_is_alive=>false},blood_pressure=>[{low,average,high}]);
    unimportant({patient_complains_about_x=>false},blood_pressure=>[{low,average},{high}]);
}


The first one says that if patient is dead we do not care whether he complains about anything. The second and third say the same about disease_1 and blood_pressure. The fourth one is interesting - it says that we only need to distinguish two classes of blood pressure, namely {low, average} and {high} IF THE PATIENT does not complain about x. Note that we use the square brackets ([]) to enclose the equivalence classes.

Wlodkowic is not fully functional yet, but it can print out the visible states and the states. Note that with these "unimportant" rules there are only 11 states, while without them there are 24 states.

The "apriori" section follows the "model" section and it will contain the knowledge about the a-priori beliefs. It is not implemented yet. I thought that Perkun really lacks it and in realistic examples Wlodkowic will have an advantage.

Wlodkowic comes with a companion library (libwlodkowic) which is completely separate from Perkun. I thought it is better this way.

No comments:

Post a Comment