Fuzzy markup language: Difference between revisions

Content deleted Content added
Lia84 (talk | contribs)
No edit summary
split up paragraphs
 
(37 intermediate revisions by 30 users not shown)
Line 1:
{{Short description|XML-based markup language}}
{{multiple issues|original research=June 2012|unreliable sources=June 2012|more footnotes=June 2012|refimprove=June 2012}}
{{Multiple issues|
{{unreliable sources|date=June 2012}}
{{refimprove|date=June 2012}}
{{original research|date=June 2012}}
{{more footnotes|date=June 2012}}
}}
{{Infobox file format
| name = (FML) Fuzzy Markup Language <!-- For rollover expansion of links in other pages-->
Line 14 ⟶ 20:
| extended from = [[Extensible Markup Language|XML]]
<!-- | extended to = [[XHTML]] -->
| standard = [httphttps://standards.ieee.org/ieee/1855/5418/ IEEE Standards Association (work in progress)1855-2016]
}}
 
Line 20 ⟶ 26:
 
==Overview==
FML was designed and developed by Giovanni Acampora during his Ph.D. course in Computer Science, under the supervision of Prof. Vincenzo Loia, at [[University of Salerno]], Italy, in 2004. The original idea inspired Giovanni Acampora to create FML was the necessity of creating a cooperative fuzzy-based framework aimed at automatically controlling a living environment characterized by a plethora of heterogeneous devices whose interactions were devoted to maximize the human comfort under energy saving constraints. This framework represented one of the first concrete examples of [[AmI|Ambient Intelligence]]. Beyond this pioneering application, the major advantage of using XML to describe a fuzzy system is hardware/software interoperability. Indeed, all that is needed to read an FML file is the appropriate schema for that file, and an FML parser. This markup approach makes it much easier to exchange fuzzy systems between software: for example, a machine learning application could extract fuzzy rules which could then be read directly into a fuzzy inference engine or uploaded into a fuzzy controller. Also, with technologies like [[XSLT]], it is possible to compile the FML into the programming language of your choice, ready for embedding into whatever application you please. As stated by Mike Watts on his popular Computational Intelligence blog:<ref>{{cite web|last=Watts |first=Mike |url=http://computational-intelligence.blogspot.it/2011/05/fuzzy-markup-language.html |title=Computational Intelligence: Fuzzy Markup Language |publisher=Computational-intelligence.blogspot.it |date=2011-05-28 |accessdateaccess-date=2012-06-11}}</ref>
<blockquote>"Although Acampora's motivation for developing FML seems to be to develop embedded fuzzy controllers for ambient intelligence applications, FML could be a real boon for developers of fuzzy rule extraction algorithms: from my own experience during my PhD, I know that having to design a file format and implement the appropriate parsers for rule extraction and fuzzy inference engines can be a real pain, taking as much time as implementing the rule extraction algorithm itself. I would much rather have used something like FML for my work."</blockquote>
 
A complete overview of FML and related applications can be found in the book titled ''On the power of Fuzzy Markup Language''<ref>{{cite book | url=http://link.springer.com/book/10.1007/978-3-642-35488-5/page/1 | title=On the power of Fuzzy Markup Language | series=Studies in Fuzziness and Soft Computing| publisher= Springer| work=Vol.296 | date=2013 | accessdate=January 11, 2013 | editor1-first=Giovanni|editor1-last= Acampora| editor2-first=Vincenzo|editor2-last=Loia| editor3-first=Chang-Shing | editor3-last=Lee| editor4-first=Mei-Hui | editor4-lastname=Wang}}<Acampora2013/ref> edited by Giovanni Acampora, Chang-Shing Lee, Vincenzo Loia and Mei-Hui Wang, and published by Springer in the series ''Studies on Fuzziness and Soft Computing''.
 
==FML at work: syntaxSyntax, grammar and& hardware synthesis==
FML allows fuzzy systems to be coded through a collection of correlated semantic tags capable of modeling the different components of a classical fuzzy controller such as knowledge base, rule base, fuzzy variables and fuzzy rules. Therefore, the FML tags used to build a fuzzy controller represent the set of lexemes used to create fuzzy expressions. In order to design a well-formed XML-based language, an FML context-free grammar is defined by means of a XML Schemaschema which defines name, type and attributes characterized each XML element. However, since an FML program represents only a static view of a fuzzy logic controller, the so-called eXtensible Stylesheet Language Translator (XSLT) is provided to change this static view to a computable version. Indeed, XSLTs modules are able to convert the FML-based fuzzy controller in a general purpose computer language using an XSL file containing the translation description. At this level, the control is executable for the hardware. In short, FML is essentially composed by three layers:
* XML in order to create a new markup language for fuzzy logic control;
* a XML Schema in order to define the legal building blocks;
Line 39 ⟶ 45:
*defuzzification subsystem.
 
In detail, the opening tag of each FML program is <code><FuzzyControllerfuzzySystem></code> which represents the fuzzy controller under modeling. This tag has two attributes: ''name'' and ''ip''. The first attribute permits to specify the name of fuzzy controller and ''ip'' is used to define the ___location of controller in a computer network. The fuzzy knowledge base is defined by means of the tag <code><KnowledgeBase></code> which maintains the set of [[fuzzy conceptsconcept]]s used to model the fuzzy rule base. In order to define the fuzzy
concept related controlled system, <code><KnowledgeBase></code> tag uses a set of nested tags:
*<code><FuzzyVariable></code> defines the fuzzy concept;
*<code><FuzzyTerm></code> defines a linguistic term describing the fuzzy concept;
*a set of tags defining a shape of fuzzy sets are related to fuzzy terms.
The attributes of <code><FuzzyVariable></code> tag are: ''name'', ''scale'', ''domainLeft'', ''domainRight'', ''type'' and, for only an output, ''accumulation'', ''defuzzifier'' and ''defaultValue''. The ''name'' attribute defines the name of fuzzy concept, for instance, ''temperature''; ''scale'' is used to define the scale used to measure the fuzzy concept, for instance, ''Celsius degree''; ''domainLeft'' and ''domainRight'' are used to model the universe of discourse of fuzzy concept, that is, the set of real values related to fuzzy concept, for instance [0°,40°] in the case of Celsius degree; the position of fuzzy concept into rule (consequent part or antecedent part) is defined by ''type'' attribute (input/output); ''accumulation'' attribute defines the method of accumulation that is a method that permits the combination of results of a variable of each rule in a final result; ''defuzzifier'' attribute defines the method used to execute the conversion from a fuzzy set, obtained after aggregation process, into a numerical value to give it in output to system; ''defaultValue'' attribute defines a real value used only when no rule has fired for the variable at issue.
 
As for tag <code><FuzzyTerm></code>, it uses two attributes: ''name'' used to identify the linguistic value associate with fuzzy concept and ''complement'', a boolean attribute that defines, if it is true, it is necessary to consider the complement of membership function defined by given parameters. Fuzzy shape tags, used to complete the definition of fuzzy concept, are:
*<code><TRIANGULARSHAPE></code>
Line 58 ⟶ 65:
*<code><RECTANGULARSHAPE></code>
*<code><SINGLETONSHAPE></code>
Every shaping tag uses a set of attributes which defines the real outline of corresponding fuzzy set. The number of these attributes depends on the chosen fuzzy set shape.
 
In order to make an example, let us consider the ''Tipper Inference System'' described in MathworkMathworks Matlab Fuzzy Logic Toolbox Tutorial. This Mamdani system is used to regulate the tipping in, for example, a restaurant. It has got two variables in input (''food'' and ''service'') and one in output (''tip''). FML code for modeling part of knowledge base of this fuzzy system containing variables ''food'' and ''tip'' is shown below.
 
<sourcesyntaxhighlight lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<FuzzyControllerfuzzySystem name="newSystem" ip="127.0.0.1">
<KnowledgeBase>
<FuzzyVariable name="food" domainleft="0.0" domainright="10.0" scale="" type="input">
<FuzzyTerm name="deliciusdelicious" complement="false">
<LeftLinearShape Param1="5.5" Param2="10.0"/>
</FuzzyTerm>
Line 83 ⟶ 90:
<TriangularShape Param1="0.0" Param2="5.0" Param3="10.0"/>
</FuzzyTerm>
<FuzzyTerm name="generousegenerous" complement="false">
<TriangularShape Param1="10.0" Param2="15.0" Param3="20.0"/>
</FuzzyTerm>
</FuzzyVariable>
</KnowledgeBase>
............
</fuzzySystem>
</FuzzyController>
</syntaxhighlight>
</source>
 
A special tag that can furthermore be used to define a fuzzy shape is <code><UserShape></code>. This tag is used to customize fuzzy shape (custom shape). The custom shape modeling is performed via a set of <code><Point></code> tags that lists the extreme points of geometric area defining the custom fuzzy shape. Obviously, the attributes used in <code><Point></code> tag are x and y coordinates.
 
A special tag that can furthermore be used to define a fuzzy shape is <code><UserShape></code>. This tag is used to customize fuzzy shape (custom shape). The custom shape modeling is performed via a set of <code><Point></code> tags that lists the extreme points of geometric area defining the custom fuzzy shape. Obviously, the attributes used in <code><Point></code> tag are x and y coordinates.
As for rule base component, FML allows to define a set of rule bases, each one of them describes a different behavior of system. The root of each rule base is modeled by <code><RuleBase></code> tag which defines a fuzzy rule set. The <code><RuleBase></code> tag uses five attributes: ''name'', ''type'', ''activationMethod'', ''andMethod'' and ''orMethod''. Obviously, the ''name'' attribute uniquely identifies the rule base. The ''type'' attribute permits to specify the kind of fuzzy controller (Mamdani or TSK) respect to the rule base at issue. The ''activationMethod'' attribute defines the method used to implication process; the ''andMethod'' and ''orMethod'' attribute define, respectively, the ''and'' and ''or'' algorithm to use by default. In order to define the single rule the <code><Rule></code> tag is used. The attributes used by the <code><Rule></code> tag are: ''name'', ''connector'', ''operator'' and ''weight''. The ''name'' attribute permits to identify the rule; ''connector'' is used to define the logical operator used to connect the different clauses in antecedent part (and/or); ''operator'' defines the algorithm to use for chosen connector; ''weight'' defines the importance of rule during inference engine step. The definition of antecedent and consequent rule part is obtained by using <code><Antecedent></code> and <code><Consequent></code> tags. <code><Clause></code> tag is used to model the fuzzy clauses in antecedent and consequent part. This tag use the attribute ''modifier'' to describe a modification to term used in the clause. The possible values for this attribute are: ''above'', ''below'', ''extremely'', ''intensify'', ''more or less'', ''norm'', ''not'', ''plus'', ''slightly'', ''somewhat'', ''very'', ''none''. To complete the definition of fuzzy clause the nested <code><Variable></code> and <code><Term></code> tags have to be used. A sequence of <code><Rule></code> tags realizes a fuzzy rule base.
 
As example, let us consider a Mamdani rule composed by ''(food is rancid) OR (service is very poor)'' as antecedent and ''tip is cheap'' as consequent. The antecedent part is formed by two clauses: ''(food is rancid)'' and ''(service is poor)''. The first antecedent clause uses ''food'' as variable and ''rancid'' as fuzzy term, whereas, the second antecedent clause uses ''service'' as a variable, ''poor'' as fuzzy term and ''very'' as modifier; the consequent clause uses ''tip'' as a fuzzy variable and ''cheap'' as a fuzzy term. The complete rule is:
 
'''IF''' ''(food is rancid)'' '''OR''' ''(service is very poor)'' '''THEN''' ''(tip is cheap)''.
Line 101 ⟶ 109:
Let us see how FML defines a rule base with this rule.
 
<sourcesyntaxhighlight lang="xml">
<RuleBase name="Rulebase1" activationMethod="MIN" andMethod="MIN" orMethod="MAX" type="mamdani">
<Rule name="reg1" connector="or" operator="MAX" weight="1.0">
Line 123 ⟶ 131:
............
</RuleBase>
</syntaxhighlight>
</source>
 
Now, let us see a Takagi-Sugeno-Kang system that regulates the same issue. The most important difference with Mamdani system is the definition of a different output variable ''tip''. The <code><TSKVariable></code> tag is used to define an output variable that can be used in a rule of a Tsk system. This tag has the same attributes of a Mamdani output variable except for the ''domainleft'' and ''domainright'' attribute because a variable of this kind (called tsk-variable) hasn’thasn't a universe of discourse. The nested <code><TSKTerm></code> tag represents a linear function and so it is completely different from <code><FuzzyTerm></code>. The <code><TSKValue></code> tag is used to define the coefficients of linear function. The following crunch of FML code shows the definition of output variable ''tip'' in a Tsk system.
 
<sourcesyntaxhighlight lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<FuzzyControllerfuzzySystem name="newSystem" ip="127.0.0.1">
<KnowledgeBase>
.......
Line 141 ⟶ 149:
<TSKValue>6.0</TSKValue>
</TSKTerm>
<TSKTerm name="generousegenerous" order="1">
<TSKValue>0.6</TSKValue>
<TSKValue>1.3</TSKValue>
Line 149 ⟶ 157:
<KnowledgeBase>
..........
</fuzzySystem >
</FuzzyController>
</syntaxhighlight>
</source>
 
The FML definition of rule base component in a Tsk system doesn’tdoesn't change a lot. The only different thing is that the <code><Clause></code> tag doesn’tdoesn't have the modifier attribute.
 
As example, let us consider a tsk rule composed by ''(food is rancid) OR (service is very poor)'' as antecedent and, as consequent, ''tip=1.9+5.6*food+6.0*service'' that can be written as ''tip is cheap'' in an implicitly way. So the rule can be written in this way:
'''IF''' ''(food is rancid)'' '''OR''' ''(service is very poor)'' '''THEN''' ''(tip is cheap)''.
Line 160 ⟶ 168:
Let us see how FML defines a rule base with this rule.
 
<sourcesyntaxhighlight lang="xml">
<RuleBase name="Rulebase1" activationMethod="MIN" andMethod="MIN" orMethod="MAX" type="tsk">
<Rule name="reg1" connector="or" operator="MAX" weight="1.0">
Line 182 ⟶ 190:
............
</RuleBase>
</syntaxhighlight>
</source>
 
 
 
===FML Grammar===
The FML tags used to build a fuzzy controller represent the set of lexemes used to create fuzzy expressions. However, in order to realize a well-formed XML-based language, an FML context-free grammar is necessary and described in the following. The FML context-free grammar is modeled by XML file in the form of a XML Schema Document (XSD) which expresses the set of rules to which a document must conform in order to be considered a ''valid'' FML document. Based on the previous definition, a portion of the FML XSD regarding the knowledge base definition is given below.
 
<sourcesyntaxhighlight lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
Line 346 ⟶ 352:
..........
</xs:schema>
</syntaxhighlight>
</source>
 
 
===FML Synthesis===
Since an FML program realizes only a static view of a fuzzy system, the so-called eXtensible Stylesheet Language Translator (XSLT) is provided to change this static view to a computable version. In particular, the XSLT technology is used convert a fuzzy controller description into a general-purpose computer language to be computed on several hardware platforms. Currently, a XSLT converting FML program in runnable Java code has been implemented. In this way, thanks to the transparency capabilities provided by Java virtual machines, it is possible to obtain a fuzzy controller modeled in high level way by means of FML and runnable on a plethora of hardware architectures through Java technologies. However, XSLT can be also used for converting FML programs in legacy languages related to a particular hardware or in other general purpose languages.
 
 
==References==
{{reflist}}|refs=
<ref name=Acampora2013>
{{cite book | title=On the power of Fuzzy Markup Language | volume=296
| series=Studies in Fuzziness and Soft Computing
| publisher= Springer| work=Vol.296 | year=2013
| editor1-first=Giovanni|editor1-last= Acampora| editor2-first=Vincenzo|editor2-last=Loia| editor3-first=Chang-Shing | editor3-last=Lee
| editor4-first=Mei-Hui | editor4-last=Wang
| doi=10.1007/978-3-642-35488-5
| isbn=978-3-642-35487-8
}}</ref>
}}
 
==AdditionalFurther sourcesreading==
* {{cite web | url=http://onlinelibrary.wiley.com/doi/10.1002/int.20449/abstractjournal | title=Diet assessment based on type-2 fuzzy ontology and fuzzy markup language | publisherjournal=International Journal of Intelligent Systems | work=Volume 25, Issue 12 | date=December 2010 | accessdate=June 03, 2012 | author=Lee, Chang-Shing; et| alpages=1187–1216|display-authors=etal | doi=10.1002/int.20449 | pagesvolume=1187–121625 | issue=12| s2cid=13570946 }} {{PaywallSubscription required}}
* {{cite web | url=http://www.ripublication.com/ijcirv1/1014.pdf | title=Using FML and Fuzzy Technology in Adaptive Ambient Intelligence Environments | publisher=International Journal of Computational Intelligence Research | work=Vol.1, No.2 | date=2005 | accessdate=June 03, 2012 | author=Acampora, Giovanni and Loia, Vincenzo | pages=171–182}}
* {{Cite journal|last=Acampora|first=G.|author2=Loia, V.|year=2005|title=Fuzzy control interoperability and scalability for adaptive domotic framework|journal= IEEE Transactions on Industrial Informatics|volume=1|issue=2|pages=97–111|doi=10.1109/TII.2005.844431|s2cid=8008285 }}
* {{cite web | url=http://onlinelibrary.wiley.com/doi/10.1002/int.20449/abstract | title=Diet assessment based on type-2 fuzzy ontology and fuzzy markup language | publisher=International Journal of Intelligent Systems | work=Volume 25, Issue 12 | date=December 2010 | accessdate=June 03, 2012 | author=Lee, Chang-Shing; et al. | pages=1187–1216}} {{Paywall}}
* {{Cite journal|last=Acampora|first=G.|coauthorsauthor2=Loia, V.|year=20052008|title=FuzzyA controlproposal interoperabilityof andubiquitous scalabilityfuzzy computing for adaptiveAmbient domotic framework|url=Intelligence|journal= IEEEInformation Transactions on Industrial InformaticsSciences|volume=1178|issue=23|pages=97-111631–646|doi=10.11091016/TIIj.ins.2007.200508.844431023}}
* {{Cite journal|last=Acampora|first=G.|coauthorsauthor2=LoiaWang, VM.-H.|yearauthor3=2008 Lee, C.-S.|titleauthor4=A proposalHsieh, ofK.-L.|author5= ubiquitousHsu, fuzzyC.-Y.|author6= computingChang, C.-C.|year=2010|title=Ontology-based multi-agents for Ambientintelligent Intelligence|url=healthcare applications|journal= InformationJournal Sciencesof Ambient Intelligence and Humanized Computing|volume=1781|issue=32|pages=631-646111–131|doi=10.10161007/j.ins.2007.08.023s12652-010-0011-5|s2cid=35304577 }}
* {{Cite journal|last=Acampora|first=G.|coauthorsauthor2= WangLoia, MV.-H.;|author3= LeeGaeta, CM.-S.; Hsieh, K.-L.; Hsu, C.-Y.;|author4= ChangVasilakos, CA.-CV.|year=2010|title=Ontology-basedInteroperable multi-agentsand adaptive fuzzy services for intelligentambient healthcareintelligence applications|url=|journal= JournalACM ofTransactions Ambienton IntelligenceAutonomous and HumanizedAdaptive ComputingSystems|volume=15|issue=2|pages=111-131|doi=10.10071145/s12652-010-0011-51740600.1740604|pages=1–26|s2cid=14234229 }}
 
[[Category:Markup languages]]