SlideShare a Scribd company logo
1 of 5
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
 <meta http-equiv="content-type" content="text/html; charset=windows-1250">
 <meta name="generator" content="PSPad editor, www.pspad.com">
 <title></title>
 </head>
 <body>
 <script>
  //****************Sugar*********************
  Function.prototype.method = function (name, func) {
    this.prototype[name] = func;
    return this;
  };

  Function.method('inherits', function (parent) {
  var d = {}, p = (this.prototype = new parent());
  this.method('uber', function uber(name) {
     if (!(name in d)) {
        d[name] = 0;
     }
     var f, r, t = d[name], v = parent.prototype;
     if (t) {
        while (t) {
            v = v.constructor.prototype;
            t -= 1;
        }
        f = v[name];
     } else {
        f = p[name];
        if (f == this[name]) {
            f = v[name];
        }
     }
     d[name] += 1;
     r = f.apply(this, Array.prototype.slice.apply(arguments, [1]));
     d[name] -= 1;
     return r;
  });
  return this;
  });


  Function.method('swiss', function (parent) {
     for (var i = 1; i < arguments.length; i += 1) {
        var name = arguments[i];
        this.prototype[name] = parent.prototype[name];
     }
     return this;
  });
  //******************************************
  //*************LogicEquation object*********
//var resolveKeys = new Array(Equation, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,
W, X, Y, Z);

  function LogicEquation()
  {
    this.resolveKeys = new Array("Equation", "A", "B", "C", "D", "E", "F",
                      "G", "H", "I", "J", "K", "L", "M", "N",
                      "O", "P", "Q", "R", "S", "T", "W", "X",
                      "Y", "Z");
    this.equationProducts = new ListOfLogicProducts();
    this.strEquation;
  }

  LogicEquation.prototype.cons = function(value){
    this.strEquation = value;
  }

  LogicEquation.prototype.getEquation = function(){
    return this.strEquation;
  }

  LogicEquation.method("setEquation", function(value){
   this.strEquation = value;
  });

  LogicEquation.method("getEquationProducts", function(){
   return this.equationProducts.strLogicProducts;
  });

  LogicEquation.method("tokenizeEquation", function(){
   this.equationProducts.cons(this.strEquation.split("+"));
  });

  LogicEquation.method("resolveEquationKeys", function(args){
   for(var ctr=1;ctr<args.length;ctr++)
   {
     var eqKey = args[ctr];
     var tmpRegEx = new RegExp(this.resolveKeys[ctr], "g");
     this.strEquation = this.strEquation.replace(tmpRegEx, eqKey);
   }
  });

  LogicEquation.method("resolveEquation", function(){
    return this.equationProducts.resolve();
  });
  //***************************************************
  //***************ListOfEquationProduct***************
  function ListOfLogicProducts()
  {
    this.logicProducts = [];
    this.strLogicProducts;
  }
ListOfLogicProducts.prototype.cons = function(value){
  for(var ctr=0;ctr<value.length;ctr++)
  {
    this.logicProducts[ctr] = new LogicProduct();
    this.logicProducts[ctr].cons(value[ctr]);
  }
  this.strLogicProducts = value;
}

ListOfLogicProducts.method("resolve", function(){
 var result = false;

 for(var ctr=0;ctr<this.logicProducts.length;ctr++)
 {
   var tmpResult = this.logicProducts[ctr].resolve();

     if(result||tmpResult == true) result = true;
     else result = false;
 }

  return result;
});
//**************************************************
//****************LogicProduct**********************
function LogicProduct()
{
  this.productElements = new ListOfProductElements()//[];
  this.strProductElements;
}

LogicProduct.method("cons", function(value){
 this.productElements.cons(value.replace(/^[|]$/g,""));
 this.strProductElements = value;
});

LogicProduct.prototype.resolve = function(){
  return this.productElements.resolve();
}
//**************************************************
//***************ListOfProductElements**************
function ListOfProductElements()
{
  this.listOfElements;
  this.strListOfElements;
}

ListOfProductElements.prototype.cons = function(value){
  this.listOfElements = value.split("*");
  this.strListOfElements = value;
}
ListOfProductElements.method("resolve", function(){
  var result = true;

    for(var ctr=0;ctr<this.listOfElements.length;ctr++)
    {
      var tmpResult = this.listOfElements[ctr];

      if(/^!/.test(tmpResult))
      {
        var temp = tmpResult.replace(/^!/g, "");
        if(temp == "true") tmpResult = "false";
        else tmpResult = "true";
      }

      if(tmpResult == "true")
      {
        if(result == true) {result = true;}
        else {result = false;}
      }
      else {result = false;}

  }
  return result;
});
//**************************************************
//***************the program************************

function equationAnalyzer(args)
{
  try
  {
    var logEq = new LogicEquation();

     logEq.cons(args[0]);
     //logEq.setEquation("[!true*!false*true]+[true*true*!false]"); //"[A*B*!C]+[A*B*C]"

     //alert(logEq.getEquation());
     //alert(logEq.getEquationProducts());

     logEq.resolveEquationKeys(args);
     logEq.tokenizeEquation();

     alert(logEq.resolveEquation());
    }
    catch(e)
    {
      alert(e.description);
    }
}

function main()
{
var args=new Array()

   args[0]='[!A*!B*C*D*E*F*G*H]+[A*B*!C*D*E*F*G*H]+[A*B*!C*D*E*F*G*H]';
   args[1]=true; //A = true
   args[2]=true; //B = false
   args[3]=false; //C = false
   args[4]=true; //D = true
   args[5]=true; //E = true
   args[6]=true; //F = true
   args[7]=true; //G = true
   args[8]=false; //H = true

    equationAnalyzer(args);
  }
 </script>
 <button TYPE=BUTTON onclick="main()">EvalueLogicEquation
 </button>
 </body>
</html>

More Related Content

What's hot

[Droid knights 2019] Tensorflow Lite 부터 ML Kit, Mobile GPU 활용 까지
[Droid knights 2019] Tensorflow Lite 부터 ML Kit, Mobile GPU 활용 까지[Droid knights 2019] Tensorflow Lite 부터 ML Kit, Mobile GPU 활용 까지
[Droid knights 2019] Tensorflow Lite 부터 ML Kit, Mobile GPU 활용 까지Jeongah Shin
 
How to practice functional programming in react
How to practice functional programming in reactHow to practice functional programming in react
How to practice functional programming in reactNetta Bondy
 
Groovy collection api
Groovy collection apiGroovy collection api
Groovy collection apitrygvea
 
The Ring programming language version 1.6 book - Part 82 of 189
The Ring programming language version 1.6 book - Part 82 of 189The Ring programming language version 1.6 book - Part 82 of 189
The Ring programming language version 1.6 book - Part 82 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 76 of 181
The Ring programming language version 1.5.2 book - Part 76 of 181The Ring programming language version 1.5.2 book - Part 76 of 181
The Ring programming language version 1.5.2 book - Part 76 of 181Mahmoud Samir Fayed
 
TDC2016SP - Código funcional em Java: superando o hype
TDC2016SP - Código funcional em Java: superando o hypeTDC2016SP - Código funcional em Java: superando o hype
TDC2016SP - Código funcional em Java: superando o hypetdc-globalcode
 
とある断片の超動的言語
とある断片の超動的言語とある断片の超動的言語
とある断片の超動的言語Kiyotaka Oku
 
Retrieving data from database using result set (1)
Retrieving data from database using result set (1)Retrieving data from database using result set (1)
Retrieving data from database using result set (1)rishisingh190
 
SparkSQLの構文解析
SparkSQLの構文解析SparkSQLの構文解析
SparkSQLの構文解析ゆり 井上
 
Is java8 a true functional programming language
Is java8 a true functional programming languageIs java8 a true functional programming language
Is java8 a true functional programming languageSQLI
 
Is java8a truefunctionallanguage
Is java8a truefunctionallanguageIs java8a truefunctionallanguage
Is java8a truefunctionallanguageSamir Chekkal
 
Currying and Partial Function Application (PFA)
Currying and Partial Function Application (PFA)Currying and Partial Function Application (PFA)
Currying and Partial Function Application (PFA)Dhaval Dalal
 
Shipping Pseudocode to Production VarnaLab
Shipping Pseudocode to Production VarnaLabShipping Pseudocode to Production VarnaLab
Shipping Pseudocode to Production VarnaLabDobromir Nikolov
 
Ramda, a functional JavaScript library
Ramda, a functional JavaScript libraryRamda, a functional JavaScript library
Ramda, a functional JavaScript libraryDerek Willian Stavis
 
Ramda lets write declarative js
Ramda   lets write declarative jsRamda   lets write declarative js
Ramda lets write declarative jsPivorak MeetUp
 
The Ring programming language version 1.9 book - Part 92 of 210
The Ring programming language version 1.9 book - Part 92 of 210The Ring programming language version 1.9 book - Part 92 of 210
The Ring programming language version 1.9 book - Part 92 of 210Mahmoud Samir Fayed
 

What's hot (20)

Base de-datos
Base de-datosBase de-datos
Base de-datos
 
[Droid knights 2019] Tensorflow Lite 부터 ML Kit, Mobile GPU 활용 까지
[Droid knights 2019] Tensorflow Lite 부터 ML Kit, Mobile GPU 활용 까지[Droid knights 2019] Tensorflow Lite 부터 ML Kit, Mobile GPU 활용 까지
[Droid knights 2019] Tensorflow Lite 부터 ML Kit, Mobile GPU 활용 까지
 
はじめてのGroovy
はじめてのGroovyはじめてのGroovy
はじめてのGroovy
 
How to practice functional programming in react
How to practice functional programming in reactHow to practice functional programming in react
How to practice functional programming in react
 
Groovy collection api
Groovy collection apiGroovy collection api
Groovy collection api
 
The Ring programming language version 1.6 book - Part 82 of 189
The Ring programming language version 1.6 book - Part 82 of 189The Ring programming language version 1.6 book - Part 82 of 189
The Ring programming language version 1.6 book - Part 82 of 189
 
The Ring programming language version 1.5.2 book - Part 76 of 181
The Ring programming language version 1.5.2 book - Part 76 of 181The Ring programming language version 1.5.2 book - Part 76 of 181
The Ring programming language version 1.5.2 book - Part 76 of 181
 
TDC2016SP - Código funcional em Java: superando o hype
TDC2016SP - Código funcional em Java: superando o hypeTDC2016SP - Código funcional em Java: superando o hype
TDC2016SP - Código funcional em Java: superando o hype
 
Clojure functions midje
Clojure functions midjeClojure functions midje
Clojure functions midje
 
とある断片の超動的言語
とある断片の超動的言語とある断片の超動的言語
とある断片の超動的言語
 
Retrieving data from database using result set (1)
Retrieving data from database using result set (1)Retrieving data from database using result set (1)
Retrieving data from database using result set (1)
 
SparkSQLの構文解析
SparkSQLの構文解析SparkSQLの構文解析
SparkSQLの構文解析
 
Is java8 a true functional programming language
Is java8 a true functional programming languageIs java8 a true functional programming language
Is java8 a true functional programming language
 
Is java8a truefunctionallanguage
Is java8a truefunctionallanguageIs java8a truefunctionallanguage
Is java8a truefunctionallanguage
 
Currying and Partial Function Application (PFA)
Currying and Partial Function Application (PFA)Currying and Partial Function Application (PFA)
Currying and Partial Function Application (PFA)
 
Shipping Pseudocode to Production VarnaLab
Shipping Pseudocode to Production VarnaLabShipping Pseudocode to Production VarnaLab
Shipping Pseudocode to Production VarnaLab
 
Ramda, a functional JavaScript library
Ramda, a functional JavaScript libraryRamda, a functional JavaScript library
Ramda, a functional JavaScript library
 
Ramda lets write declarative js
Ramda   lets write declarative jsRamda   lets write declarative js
Ramda lets write declarative js
 
PathOfMostResistance
PathOfMostResistancePathOfMostResistance
PathOfMostResistance
 
The Ring programming language version 1.9 book - Part 92 of 210
The Ring programming language version 1.9 book - Part 92 of 210The Ring programming language version 1.9 book - Part 92 of 210
The Ring programming language version 1.9 book - Part 92 of 210
 

Viewers also liked

Object Oriented Approach Within Siebel Boundaries
Object Oriented Approach Within Siebel BoundariesObject Oriented Approach Within Siebel Boundaries
Object Oriented Approach Within Siebel BoundariesRoman Agaev
 
Common Redirection Mechanism
Common Redirection MechanismCommon Redirection Mechanism
Common Redirection MechanismRoman Agaev
 
It Project And Agile
It Project And AgileIt Project And Agile
It Project And AgileRoman Agaev
 
Guidance 4 Days Configuration
Guidance   4 Days   ConfigurationGuidance   4 Days   Configuration
Guidance 4 Days ConfigurationRoman Agaev
 
Siebel client side integrator (SCSI)
Siebel client side integrator (SCSI)Siebel client side integrator (SCSI)
Siebel client side integrator (SCSI)Roman Agaev
 
Integration Within Several Projects
Integration Within Several ProjectsIntegration Within Several Projects
Integration Within Several ProjectsRoman Agaev
 
Potential Solutions Co Existence
Potential Solutions   Co ExistencePotential Solutions   Co Existence
Potential Solutions Co ExistenceRoman Agaev
 
Siebel deployment
Siebel deploymentSiebel deployment
Siebel deploymentRoman Agaev
 

Viewers also liked (9)

Object Oriented Approach Within Siebel Boundaries
Object Oriented Approach Within Siebel BoundariesObject Oriented Approach Within Siebel Boundaries
Object Oriented Approach Within Siebel Boundaries
 
Common Redirection Mechanism
Common Redirection MechanismCommon Redirection Mechanism
Common Redirection Mechanism
 
It Project And Agile
It Project And AgileIt Project And Agile
It Project And Agile
 
Guidance 4 Days Configuration
Guidance   4 Days   ConfigurationGuidance   4 Days   Configuration
Guidance 4 Days Configuration
 
Design Results
Design ResultsDesign Results
Design Results
 
Siebel client side integrator (SCSI)
Siebel client side integrator (SCSI)Siebel client side integrator (SCSI)
Siebel client side integrator (SCSI)
 
Integration Within Several Projects
Integration Within Several ProjectsIntegration Within Several Projects
Integration Within Several Projects
 
Potential Solutions Co Existence
Potential Solutions   Co ExistencePotential Solutions   Co Existence
Potential Solutions Co Existence
 
Siebel deployment
Siebel deploymentSiebel deployment
Siebel deployment
 

Similar to Logic Equations Resolver J Script

TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionDmitry Sheiko
 
java compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docxjava compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docxpriestmanmable
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs偉格 高
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxwhitneyleman54422
 
JSConf: All You Can Leet
JSConf: All You Can LeetJSConf: All You Can Leet
JSConf: All You Can Leetjohndaviddalton
 
JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)Anders Jönsson
 
Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oopLearningTech
 
Js 单元测试框架介绍
Js 单元测试框架介绍Js 单元测试框架介绍
Js 单元测试框架介绍louieuser
 
Web Optimization Summit: Coding for Performance
Web Optimization Summit: Coding for PerformanceWeb Optimization Summit: Coding for Performance
Web Optimization Summit: Coding for Performancejohndaviddalton
 
Ast transformations
Ast transformationsAst transformations
Ast transformationsHamletDRC
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEDarwin Durand
 
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6FrontDays
 
JavaScript Classes and Inheritance
JavaScript Classes and InheritanceJavaScript Classes and Inheritance
JavaScript Classes and Inheritancemarcheiligers
 
Productaccess m
Productaccess mProductaccess m
Productaccess mAdil Usman
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScriptkvangork
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascriptkvangork
 

Similar to Logic Equations Resolver J Script (20)

Say It With Javascript
Say It With JavascriptSay It With Javascript
Say It With Javascript
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
java compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docxjava compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docx
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
 
JSConf: All You Can Leet
JSConf: All You Can LeetJSConf: All You Can Leet
JSConf: All You Can Leet
 
JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)
 
Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oop
 
Js 单元测试框架介绍
Js 单元测试框架介绍Js 单元测试框架介绍
Js 单元测试框架介绍
 
Web Optimization Summit: Coding for Performance
Web Optimization Summit: Coding for PerformanceWeb Optimization Summit: Coding for Performance
Web Optimization Summit: Coding for Performance
 
Ast transformations
Ast transformationsAst transformations
Ast transformations
 
Week 12 code
Week 12 codeWeek 12 code
Week 12 code
 
Google guava
Google guavaGoogle guava
Google guava
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLE
 
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
 
JavaScript Classes and Inheritance
JavaScript Classes and InheritanceJavaScript Classes and Inheritance
JavaScript Classes and Inheritance
 
Productaccess m
Productaccess mProductaccess m
Productaccess m
 
25-functions.ppt
25-functions.ppt25-functions.ppt
25-functions.ppt
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScript
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascript
 

More from Roman Agaev

Client/Server Paradigm And Its Implementation
Client/Server Paradigm And Its ImplementationClient/Server Paradigm And Its Implementation
Client/Server Paradigm And Its ImplementationRoman Agaev
 
Order Management Plus Integration Topics
Order Management Plus Integration TopicsOrder Management Plus Integration Topics
Order Management Plus Integration TopicsRoman Agaev
 
Workflow Usage Best Practices
Workflow Usage Best PracticesWorkflow Usage Best Practices
Workflow Usage Best PracticesRoman Agaev
 
Workflow On The Fly Monitoring Solution
Workflow On The Fly Monitoring SolutionWorkflow On The Fly Monitoring Solution
Workflow On The Fly Monitoring SolutionRoman Agaev
 
Potential Vpn Solution
Potential Vpn SolutionPotential Vpn Solution
Potential Vpn SolutionRoman Agaev
 
Potential Customer Data Model Solution Telco
Potential Customer Data Model Solution   TelcoPotential Customer Data Model Solution   Telco
Potential Customer Data Model Solution TelcoRoman Agaev
 
General Logging Approach
General Logging ApproachGeneral Logging Approach
General Logging ApproachRoman Agaev
 
General Error Handling Approach
General Error Handling ApproachGeneral Error Handling Approach
General Error Handling ApproachRoman Agaev
 
Common System Parameters
Common System ParametersCommon System Parameters
Common System ParametersRoman Agaev
 
Common Global Parameters
Common Global ParametersCommon Global Parameters
Common Global ParametersRoman Agaev
 
Common Msisdn Resource Number Management
Common Msisdn Resource   Number ManagementCommon Msisdn Resource   Number Management
Common Msisdn Resource Number ManagementRoman Agaev
 
Guidance 4 Days Configuration Presentation
Guidance   4 Days   Configuration   PresentationGuidance   4 Days   Configuration   Presentation
Guidance 4 Days Configuration PresentationRoman Agaev
 
Siebel Web Architecture
Siebel Web ArchitectureSiebel Web Architecture
Siebel Web ArchitectureRoman Agaev
 
Enterprise Integration Application
Enterprise Integration ApplicationEnterprise Integration Application
Enterprise Integration ApplicationRoman Agaev
 

More from Roman Agaev (15)

Client/Server Paradigm And Its Implementation
Client/Server Paradigm And Its ImplementationClient/Server Paradigm And Its Implementation
Client/Server Paradigm And Its Implementation
 
Order Management Plus Integration Topics
Order Management Plus Integration TopicsOrder Management Plus Integration Topics
Order Management Plus Integration Topics
 
Workflow Usage Best Practices
Workflow Usage Best PracticesWorkflow Usage Best Practices
Workflow Usage Best Practices
 
Workflow On The Fly Monitoring Solution
Workflow On The Fly Monitoring SolutionWorkflow On The Fly Monitoring Solution
Workflow On The Fly Monitoring Solution
 
Potential Vpn Solution
Potential Vpn SolutionPotential Vpn Solution
Potential Vpn Solution
 
Potential Customer Data Model Solution Telco
Potential Customer Data Model Solution   TelcoPotential Customer Data Model Solution   Telco
Potential Customer Data Model Solution Telco
 
General Logging Approach
General Logging ApproachGeneral Logging Approach
General Logging Approach
 
General Error Handling Approach
General Error Handling ApproachGeneral Error Handling Approach
General Error Handling Approach
 
Common System Parameters
Common System ParametersCommon System Parameters
Common System Parameters
 
Common Global Parameters
Common Global ParametersCommon Global Parameters
Common Global Parameters
 
Common Msisdn Resource Number Management
Common Msisdn Resource   Number ManagementCommon Msisdn Resource   Number Management
Common Msisdn Resource Number Management
 
Guidance 4 Days Configuration Presentation
Guidance   4 Days   Configuration   PresentationGuidance   4 Days   Configuration   Presentation
Guidance 4 Days Configuration Presentation
 
Analysis
AnalysisAnalysis
Analysis
 
Siebel Web Architecture
Siebel Web ArchitectureSiebel Web Architecture
Siebel Web Architecture
 
Enterprise Integration Application
Enterprise Integration ApplicationEnterprise Integration Application
Enterprise Integration Application
 

Recently uploaded

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Recently uploaded (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

Logic Equations Resolver J Script

  • 1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <meta name="generator" content="PSPad editor, www.pspad.com"> <title></title> </head> <body> <script> //****************Sugar********************* Function.prototype.method = function (name, func) { this.prototype[name] = func; return this; }; Function.method('inherits', function (parent) { var d = {}, p = (this.prototype = new parent()); this.method('uber', function uber(name) { if (!(name in d)) { d[name] = 0; } var f, r, t = d[name], v = parent.prototype; if (t) { while (t) { v = v.constructor.prototype; t -= 1; } f = v[name]; } else { f = p[name]; if (f == this[name]) { f = v[name]; } } d[name] += 1; r = f.apply(this, Array.prototype.slice.apply(arguments, [1])); d[name] -= 1; return r; }); return this; }); Function.method('swiss', function (parent) { for (var i = 1; i < arguments.length; i += 1) { var name = arguments[i]; this.prototype[name] = parent.prototype[name]; } return this; }); //****************************************** //*************LogicEquation object*********
  • 2. //var resolveKeys = new Array(Equation, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, W, X, Y, Z); function LogicEquation() { this.resolveKeys = new Array("Equation", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "W", "X", "Y", "Z"); this.equationProducts = new ListOfLogicProducts(); this.strEquation; } LogicEquation.prototype.cons = function(value){ this.strEquation = value; } LogicEquation.prototype.getEquation = function(){ return this.strEquation; } LogicEquation.method("setEquation", function(value){ this.strEquation = value; }); LogicEquation.method("getEquationProducts", function(){ return this.equationProducts.strLogicProducts; }); LogicEquation.method("tokenizeEquation", function(){ this.equationProducts.cons(this.strEquation.split("+")); }); LogicEquation.method("resolveEquationKeys", function(args){ for(var ctr=1;ctr<args.length;ctr++) { var eqKey = args[ctr]; var tmpRegEx = new RegExp(this.resolveKeys[ctr], "g"); this.strEquation = this.strEquation.replace(tmpRegEx, eqKey); } }); LogicEquation.method("resolveEquation", function(){ return this.equationProducts.resolve(); }); //*************************************************** //***************ListOfEquationProduct*************** function ListOfLogicProducts() { this.logicProducts = []; this.strLogicProducts; }
  • 3. ListOfLogicProducts.prototype.cons = function(value){ for(var ctr=0;ctr<value.length;ctr++) { this.logicProducts[ctr] = new LogicProduct(); this.logicProducts[ctr].cons(value[ctr]); } this.strLogicProducts = value; } ListOfLogicProducts.method("resolve", function(){ var result = false; for(var ctr=0;ctr<this.logicProducts.length;ctr++) { var tmpResult = this.logicProducts[ctr].resolve(); if(result||tmpResult == true) result = true; else result = false; } return result; }); //************************************************** //****************LogicProduct********************** function LogicProduct() { this.productElements = new ListOfProductElements()//[]; this.strProductElements; } LogicProduct.method("cons", function(value){ this.productElements.cons(value.replace(/^[|]$/g,"")); this.strProductElements = value; }); LogicProduct.prototype.resolve = function(){ return this.productElements.resolve(); } //************************************************** //***************ListOfProductElements************** function ListOfProductElements() { this.listOfElements; this.strListOfElements; } ListOfProductElements.prototype.cons = function(value){ this.listOfElements = value.split("*"); this.strListOfElements = value; }
  • 4. ListOfProductElements.method("resolve", function(){ var result = true; for(var ctr=0;ctr<this.listOfElements.length;ctr++) { var tmpResult = this.listOfElements[ctr]; if(/^!/.test(tmpResult)) { var temp = tmpResult.replace(/^!/g, ""); if(temp == "true") tmpResult = "false"; else tmpResult = "true"; } if(tmpResult == "true") { if(result == true) {result = true;} else {result = false;} } else {result = false;} } return result; }); //************************************************** //***************the program************************ function equationAnalyzer(args) { try { var logEq = new LogicEquation(); logEq.cons(args[0]); //logEq.setEquation("[!true*!false*true]+[true*true*!false]"); //"[A*B*!C]+[A*B*C]" //alert(logEq.getEquation()); //alert(logEq.getEquationProducts()); logEq.resolveEquationKeys(args); logEq.tokenizeEquation(); alert(logEq.resolveEquation()); } catch(e) { alert(e.description); } } function main() {
  • 5. var args=new Array() args[0]='[!A*!B*C*D*E*F*G*H]+[A*B*!C*D*E*F*G*H]+[A*B*!C*D*E*F*G*H]'; args[1]=true; //A = true args[2]=true; //B = false args[3]=false; //C = false args[4]=true; //D = true args[5]=true; //E = true args[6]=true; //F = true args[7]=true; //G = true args[8]=false; //H = true equationAnalyzer(args); } </script> <button TYPE=BUTTON onclick="main()">EvalueLogicEquation </button> </body> </html>