Question: ( * ##################################################### ### PLEASE DO NOT DISTRIBUTE SOLUTIONS PUBLICLY ### ##################################################### * ) Set Default Goal Selector ! . Require Import Coq.Strings.Ascii.
#####################################################
### PLEASE DO NOT DISTRIBUTE SOLUTIONS PUBLICLY ###
#####################################################
Set Default Goal Selector
Require Import Coq.Strings.Ascii.
Require Import Coq.Lists.List.
From Turing Require Import Lang.
From Turing Require Import Util.
From Turing Require Import Regex.
Import Lang.Examples.
Import LangNotations.
Import ListNotations.
Import RegexNotations.
Open Scope langscope.
Open Scope charscope.
Show that 'aba' is accepted the the following regular expression.
Theorem ex:
a; b; ain rstar a ;; bc ;; rstar a
Proof.
Admitted.
Show that bb is rejected by the following regular expression.
Theorem ex:
~ b; bin rstar a ;; bc ;; rstar a
Proof.
Admitted.
Function size counts how many operators were used in a regular
expression. Show that c ;; can be written using a single
regular expression constructor.
Theorem ex:
exists r size r rstar c ;; rvoid r
Proof.
Admitted.
Given that the following regular expression uses constructors
because size rall
Show that you can find an equivalent regular expression that uses
at most constructors.
Theorem ex:
exists r size r rstar rall rstar c ;; rvoid ;; rstar ab ;; rstar rnil;; c r
Proof.
Admitted.
The following code implements a function that given a string
it returns a regular expression that only accepts that string.
Fixpoint rword' l :
match l with
nil rnil
x :: l rchar x ;; rword' l
end.
Prove that function rword' is correct.
Note that you must copypaste the function to outside of the comment
and in your proof state: exists rword'.
The proof must proceed by induction.
Theorem ex:
forall l exists rword:list ascii regex Accept rword l fun w w l
Proof.
Admitted.
Show that there exists a regular expression with constructs that
recognizes the following language. The idea is to find the smallest
regular expression that recognizes the language.
Theorem ex:
exists rAccept r fun w w a; c w b; c size r
Proof.
Admitted.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
