The document discusses constructing a DFA from a regular expression and NFA. It provides an algorithm for the subset construction which works by treating each DFA state as a set of NFA states. Transitions are determined by taking the epsilon closure of the NFA states reachable on the input symbol from the current set of states. An example applies the algorithm to construct the DFA for the regular expression (a/b)n*abb from its NFA.
Parse::Eyapp is a collection of modules
that extends Francois Desarmenien Parse::Yapp 1.05.
Eyapp extends yacc/yapp syntax with
functionalities like named attributes,
EBNF-like expressions, modifiable default action,
automatic abstract syntax tree building,
dynamic conflict resolution,
translation schemes, tree regular expressions,
tree transformations, scope analysis support,
and directed acyclic graphs among others.
This article teaches you the basics of
Compiler Construction using Parse::Eyap to
build a translator from infix expressions to Parrot
Intermediate Representation.
recognizer for a language, Deterministic finite automata, Non-deterministic finite automata, conversion of NFA to DFA, Regular Expression to NFA, Thomsons Construction
Parse::Eyapp is a collection of modules
that extends Francois Desarmenien Parse::Yapp 1.05.
Eyapp extends yacc/yapp syntax with
functionalities like named attributes,
EBNF-like expressions, modifiable default action,
automatic abstract syntax tree building,
dynamic conflict resolution,
translation schemes, tree regular expressions,
tree transformations, scope analysis support,
and directed acyclic graphs among others.
This article teaches you the basics of
Compiler Construction using Parse::Eyap to
build a translator from infix expressions to Parrot
Intermediate Representation.
recognizer for a language, Deterministic finite automata, Non-deterministic finite automata, conversion of NFA to DFA, Regular Expression to NFA, Thomsons Construction
This is the presentation on Syntactic Analysis in NLP.It includes topics like Introduction to parsing, Basic parsing strategies, Top-down parsing, Bottom-up
parsing, Dynamic programming – CYK parser, Issues in basic parsing methods, Earley algorithm, Parsing
using Probabilistic Context Free Grammars.
This is the presentation on Syntactic Analysis in NLP.It includes topics like Introduction to parsing, Basic parsing strategies, Top-down parsing, Bottom-up
parsing, Dynamic programming – CYK parser, Issues in basic parsing methods, Earley algorithm, Parsing
using Probabilistic Context Free Grammars.
This is about a topic of compiler design, LR and SLR parsing algorithm and LR grammar, Canonical collection and Item, Conflict in LR parsing shift reduce. Classification of Bottom up parsing.
This presentation discusses the following topics:
Basic features of R
Exploring R GUI
Data Frames & Lists
Handling Data in R Workspace
Reading Data Sets & Exporting Data from R
Manipulating & Processing Data in R
A study on “Diagnosis Test of Diabetics and Hypertension by AI”, Presentation slides for International Conference on "Life Sciences: Acceptance of the New Normal", St. Aloysius' College, Jabalpur, Madhya Pradesh, India, 27-28 August, 2021
A study on “impact of artificial intelligence in covid19 diagnosis”Dr. C.V. Suresh Babu
A study on “Impact of Artificial Intelligence in COVID-19 Diagnosis”, Presentation slides for International Conference on "Life Sciences: Acceptance of the New Normal", St. Aloysius' College, Jabalpur, Madhya Pradesh, India, 27-28 August, 2021
A study on “impact of artificial intelligence in covid19 diagnosis”Dr. C.V. Suresh Babu
Although the lungs are one of the most vital organs in the body, they are vulnerable to infection and injury. COVID-19 has put the entire world in an unprecedented difficult situation, bringing life to a halt and claiming thousands of lives all across the world. Medical imaging, such as X-rays and computed tomography (CT), is essential in the global fight against COVID-19, and newly emerging artificial intelligence (AI) technologies are boosting the power of imaging tools and assisting medical specialists. AI can improve job efficiency by precisely identifying infections in X-ray and CT images and allowing further measurement. We focus on the integration of AI with X-ray and CT, both of which are routinely used in frontline hospitals, to reflect the most recent progress in medical imaging and radiology combating COVID-19.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Welocme to ViralQR, your best QR code generator.ViralQR
Welcome to ViralQR, your best QR code generator available on the market!
At ViralQR, we design static and dynamic QR codes. Our mission is to make business operations easier and customer engagement more powerful through the use of QR technology. Be it a small-scale business or a huge enterprise, our easy-to-use platform provides multiple choices that can be tailored according to your company's branding and marketing strategies.
Our Vision
We are here to make the process of creating QR codes easy and smooth, thus enhancing customer interaction and making business more fluid. We very strongly believe in the ability of QR codes to change the world for businesses in their interaction with customers and are set on making that technology accessible and usable far and wide.
Our Achievements
Ever since its inception, we have successfully served many clients by offering QR codes in their marketing, service delivery, and collection of feedback across various industries. Our platform has been recognized for its ease of use and amazing features, which helped a business to make QR codes.
Our Services
At ViralQR, here is a comprehensive suite of services that caters to your very needs:
Static QR Codes: Create free static QR codes. These QR codes are able to store significant information such as URLs, vCards, plain text, emails and SMS, Wi-Fi credentials, and Bitcoin addresses.
Dynamic QR codes: These also have all the advanced features but are subscription-based. They can directly link to PDF files, images, micro-landing pages, social accounts, review forms, business pages, and applications. In addition, they can be branded with CTAs, frames, patterns, colors, and logos to enhance your branding.
Pricing and Packages
Additionally, there is a 14-day free offer to ViralQR, which is an exceptional opportunity for new users to take a feel of this platform. One can easily subscribe from there and experience the full dynamic of using QR codes. The subscription plans are not only meant for business; they are priced very flexibly so that literally every business could afford to benefit from our service.
Why choose us?
ViralQR will provide services for marketing, advertising, catering, retail, and the like. The QR codes can be posted on fliers, packaging, merchandise, and banners, as well as to substitute for cash and cards in a restaurant or coffee shop. With QR codes integrated into your business, improve customer engagement and streamline operations.
Comprehensive Analytics
Subscribers of ViralQR receive detailed analytics and tracking tools in light of having a view of the core values of QR code performance. Our analytics dashboard shows aggregate views and unique views, as well as detailed information about each impression, including time, device, browser, and estimated location by city and country.
So, thank you for choosing ViralQR; we have an offer of nothing but the best in terms of QR code services to meet business diversity!
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
A tale of scale & speed: How the US Navy is enabling software delivery from l...
Compiler Design Material 2
1. 10. Explain the process of constructing an NFA from a regular expression. Find NFA for
the expression (a/b)x a/(a/b)(a/b). Convert the obtained NFA into DFA
Ans:
Algorithm for RE to NFA:-
Algorithm : Thomson’s Construction
An NFA from a RE (Regular Expression)
Input : A regular Expression r over an alphabet E.
Output : An NFA N accepting L(r).
Here the following notations and used,
I -- initial state
F -- final state
R -- regular state
N -- NFA
1. For E, Construct the NFA.
E
Start i f
2. For a in E, Construct the NFA.
Start a f
3. suppose N(s) and N(t) are NFA’s for regular expressions S and F
a) For the regular expression S/t, Construct the following composite NFA N(S/t)
E
E
start
i f
E
E
2. b) For the regular expression St, Construct the Composite NFA N(st)
Diagram
c) For the regular expression S*, construct the Composite NFA N(S*)
Diagram
d) For the Parenthesized regular expression (S) , use N(s) itself as the NFA.
The Construction produces an NFA N® with the following properties.
1. N(r) has at most twice as many states as the number of symbols and operators in r.
2. N(r) has exactly one start state and one accepting state. The accepting state has no
out going transitions.
3. Each state of N(r) has either one out going transition on a symbol in E on at most
two out going E- transitions.
Diagram
11. What is a Shift-reduse Parser? Explain in detail the conflicts that may occur during
Shift-reduce Parsing?
Shift-reduse Parsing is a type of bottom up Parsing that Constraint a parse tree for
an input beginning at the leaves and working towards the root conflicts during shift-
reduce Parsing .
Conflicts during Shift-reduce Parsing
The general Shift-reduce technique.
3. • Perform shift action when there is no handle on the stack.
• Perform reduce action when there is a handle on the top of the stack.
There are two problems that this Parser faces.
1. Shift-reduce conflict:
What action to take in case both shift and reduce actions are valid?
2. Reduce-reduce conflict:
Which rule to use for reduction if reduction is possible by more one rule?
These conflicts come either because of ambiguous grammars or parsing method is not
powerful enough.
Examples:
1. Shift reduce conflict:
Consider the grammar E E + E/E * E/id and input id + id * id
Stack Input Action Stack Input Action
$E+E *id$ reduce by E E+E $E+E *id$ Shift
$E *id$ Shift $E+E* id$ Shift
$E* id$ Shift $E+E*id $ reduce by E id
$E*id $ reduce by E id $E+E*E $ reduce by E E*E
$E*E $ reduce by E E*E $E+E $ reduce by E E+E
2. Reduce-reduce Conflict:
Consider the grammar,
M R+R/R+C/R
R C
And input C+C
Stack Input Action Stack Input Action
$ C+C $ Shift $ C+C $ Shift
$C +C$ reduce by R C $ C+C $ reduce by R C
$R +C$ Shift $R +C $ Shift
$R+ C$ Shift $R +C $ Shift
$R+C $ reduce by R C $R+C $ reduce by M R+C
$R+R $ reduce by M R+R $M $
$M $
12. Explain Procedure calls with a suitable eg.
Procedure Calls:
• The procedure or function is such an important and frequently used programming
construct.
• It is imperative for a compiler to generate good code for procedure calls and
returns.
• The run time routine that handle procedure argument passing, calls and returns are
part of the run time support package.
4. • Let us consider a grammar for a simple Procedure call statement.
S call id(E list)
E E list, E
E list E
The translation for a call includes a calling sequence of actions taken on entry to and
exit from each procedure
Calling sequence:
While calling sequence differ, even for implementations of the same language.
• Allocate space for activation record (AR) on stack.
• Evaluate arguments to procedure and make available at known location.
• Save state of calling Procedure used to resume execution after call.
• Save return address (in known location)
• Generate jump to the beginning of the called Procedure.
Return sequences:
The full, actions will take place.
• If the called Procedure is a f2, save the result in a known place.
• Restore the activation record of the calling Procedure.
• Generate a jump to the return address(of calling Procedure)
Syntax Directed Translation Scheme of procedure call
1. S call id (E list) for each item P or queue do emit(‘Param’ P); emit(‘call’ id place)
The code for S , is th code for E list, Which evaluates the arguments, followed by
a param P statement for each argument, followed by a call Statement
2. E list E list , E append E place to end of queue
3. E list E initialize queue to contain only E place
Here queue is emptied and then gets a single pointer to the symbol table location
for the name that denotes the value of E.
1. Transition diagram for relational operators
Diagram
5. 2. Software tools:
* Structure editor
* Pretty printer
* Static checker
* Interpreters
- that analysis the source program
3. Disadvantage of operator precedence parsing
* It is hard to handle tokens like the minns sign which has two different
precedence (unary or binary)
* Only a small class of grammars can be parsed using this technique.
4. Methods of representing a syntax tree.
* Array representation
* Linked list representation
What are the issues of the lexical analyzer?
Lexical analysis Vs parsing
The reasons for separating lexical analysis from parsing are basically software
engineering concerns.
1. Simplicity of Design
When one detects a well defined sub task, it is often good to separate out the task for
eg a parser embedding the conventions for comments and white space is more complex
than one that assume comments and white space have already been removed by a lexical
analyzer
2. Efficiency
With the task separated, it is easier to apply specialized techniques for eg specialized
buffering techniques for reading input characters and processing tokens can significantly
speed up the performance of a compiler
3. Portability
Input alphabet peculiarities and other device specific anomalies can be restricted ti
the lexical analyzer. The representation of special or non standard symbols such as in
Pascal can be isolated in the lexical analysis.
1. Error recovery actions in a lexical analyzer:
* Panic mode recovery
* deleting an extraneous character
* Inserting a missing character
* Replacing incorrect character by a correct
* Transposing two adjacent characters.
2. What is basic block?
6. - Is a sequence of consecutive statements in which flow of control enters at the
beginning and leaves at the end without any halt or possibility of branching except at the
end.
3. Finite automata: The generalized transition diagram for RE is called finite automata.
Conversion of an NFA into a DFA
• An algorithm for constructing from an NFA into a DFA that recognizes the same
language is called the subset construction, it is useful for simulating an NFA by a
computer program.
Algorithm : Subset construction- constructing a DFA from an NFA.
Input : An NFA N
Output : A DFA D accepting the same language
Method : This algorithm constructs a transition table.
D transition for D. Each DFA state is a set of NFA states and we construct D tran
so that D will simulate “ in parallel” all possible moves N can make on a given input
string.
The following operations keep track of sets of NFA states (S represents an NFA
state and T a set of NFA states)
Operation Description
E- closure(S) Set of NFA states reachable from NFA
state S on E-Transitions alone
E- closure(T) Set of NFA states reachable from some
NFA state S in T on E-Transitions alone
Move (T, a) Set of NFA states to which there is a
transition on input symbol a from some
NFA state S in T
• The initial state of D is the set E-closure (S0), Where S0 is the start state of D we
assume each state of D is initially ‘unmarked’. Then perform the algorithm.
Initially E-closure(S0) is the only state in D states and it is unmarked! While there
is an unmarked state T in D states do begin
begin
mark T
for each input symbol a do
begin
U=E-closure (move (T , a ));
If U is not in D states then
add U as an unmarked state to D states;
D Tran [T , a ]=U
end
7. end [ The Subset Construction]
States and transitions are added to D using the subset construction algorithm.
A state of D is an accepting state if it is a set of NFA states containing at least one
accepting state of N.
A simple algorithm to complete E-closure(T) uses a stack to hold states whose
edges have not been checked for E-labeled transitions such a procedure is.
begin
push all states in T on to stack
initialize E-closure(T) to T
while stack is not empty do
begin
pop T, the top element, off of stack;
for each state w with an edge from T to W labeled E do
if w is not in E-closure (T) do
begin
add U to E-closure (T);
push W onto Stack
end
end
end [Computation of E-closure]
eg: Construct DFA for the following NFA
Diagram
NFA for (a/b) n* abb
Solution: The start state of the equivalent DFA is E-closure(0), which is
A = {0,1,2,4,7}
The input symbol alphabet is {a,b}
The subset construction algorithm tells us to mark A and then to compute E-closure
(move (A, a)).
We first compute move (A, a), the set of states of N having transitions on a from
members of A.
Among the states 0,1,2,4 and 7 only 2 and 7 have such transitions to 3 and 8.
So E-closure (move ({0, 1, 2, 4, 7}, a))
=E-closure ({3, 8})
={1,2,3,4,6,7,8}=>call this set as B
9. Dtran [E, b]=c
Since A is the start state and state E is the only accepting state (E contains, the find
state of NFA 10)
States I/P symbol
a b
A B C
B B D
C B C
D B E
*E B C
Transition Diagram (DFA)
Diagram
13. Explain in detail about the error recovery strategies in parsing.
Error-recovery Strategies:
A Parser uses the full, strategies to recover from a synthetic error.
* Panic mode
* Phrase level
* Error Productions
* Global connections.
1. Panic mode recovery
On discovering an error, the parser discards input symbols one at a time until one
of a designated set of synchronizing token is formed without checking for additional
errors.
Eg: for synchronizing tokens are delimiters such as; or end
2. Phrase level recovery
* On discovering an error, a Parser may perform local connection on the
remaining input.
* ie, it may replace a prefix of the remaining input by some string that allows the
parser to continue.
Eg: for local corrections are
- replace a comma by a semicolon
- delete a extra semicolon
- insert a missing semicolon
10. 3. Error Productions
* Parser can be constructed with the extended grammar so that we can generate
appropriate error diagnostic, to indicate the erroneous construct that has been recognized
in the input.
4. Global connections
* There are algorithms for choosing a minimal sequence of changes to obtain
global least cost connections.
* Given an incorrect input string x and grammar G,
* These algorithms will find a parse free for a related string y.
* Such that the number of insertions, deletiuons and changes of tokens required to
transform x into y is as small as possible
14. Regular Expressions:
* Each regular expression denotes a language. A language denoted by regular
expressions is called regular set.
* We use RE to describe tokens of a programming language.
* Token is either a single string or a collection of strings of a certain type.
* An identifier is defined to be a letter followed by zero or more letters & digits.
* In RE notation, it can be write as
identifier=letter (letter/digit)*
* ‘1’(Vertical bar) means ‘or’ ie, Union
‘(‘ ‘)’ used to group sub expressions
‘*’(closure operation) means zero or more instances.
Eg: Keyword = BEGIN|END|IF|THEN|ELSE
Constant = digit+
Relop = <|<=|=< >|>|>=
Identifier = letter(letter|digit)*
* Where letter stands for A|B|C|D………Z
Where digit stands for 0|2|3|…………..9
Suppose r and s REs denoting the language L® & L(s) then,
1. (r)|(s) is a RE denoting L(r)U/L(s)
2. (r)(s) is a RE denoting L(r) L(s)
3. (r)* is a RE denoting (L(r))*
4. (r) is a RE denoting L(r)
* The following table gives the algebric properties of RE,
Axion Description
r/s = s/r 1 is cumulative
r/(s/t)=(r/s)/t 1 is associative
r(s/t)=rs/rt
& concatenation distributes over
(s/t)r=sr/tr
11. er=r
re=r e is the identity element for concatenation
r* =(r/e)* relation between * and e
r** = r** r* is independent
15. Deterministic Finite Automata :( DFA)
* Finite automation is deterministic if,
1. It has no transitions on input E
2. For each state S and input symbol a, there is at most one edge labeled a leaving
S.
* DFAS are easier to simulate by a program than NFAs
* DFA can be exponentially larger than NFA[n states in a NFA controlled
require as many as 2n states in a DFA]
* A DFA can take only one path through the state grapg.
* Completely determined by input.
* It has one transition per input per state & has no E-moves.
* If we use a transition table to represent the transition function of DFA,
then each entry in the transition table is a single state.
* DFA accepting the same language (a/b)*abb
Diagram
* For DFA & NFA we can find accepting the same language.
* The states of the DFA represent subsets of the set of all states of the NFA. This
algorithm is often called the subset construction.
12. * NFA can be implemented using transition table, row for each state
column each input and E
state input symbol
a b
0 {0,1} {0}
1 - {2}
2 - {3}
* Advantage of TT:
it provides fast access to the transitions of a given state on a given character.
* Disadvantage:
It can take up lot of SPACE when input is large most transitions are to the empty
set.
* A path can be represented by sequence of state transitions called moves.
0 a 0 a 1 b 2 b 3
[accepting the input string aabb]
* NFA can have multiple transitions for one I/P ina given state & have E-moves
* NFA can choose whether to make E-moves and which of multiple trasition for a single
I/P to take.
* Actually NFAs do not have free will. If would be more accurate to say an execution of
an NFA marks ‘all’ choice from a set of states to a set of states.
* Acceptance of NFAs
An NFA can be ‘ in multiple states’
1
0 1
0
* Rule: NFA accepts if at least one of its current states is a final state.