SlideShare a Scribd company logo
1 of 16
COMM 166 Final Research Proposal Guidelines
The proposal should contain well-developed sections (Put clear
titles on the top of each section) of your outline that you
submitted earlier. The proposal should have seven (7) major
sections:
1. Introduction: A brief overview of all your sections. Approx.
one page
2. A summary of the literature review. In this section you would
summarize the previous research (summarize at least 8-10
scholarly research articles), and also your field data collection
results (if it was connected to your proposal topic). Also
indicate the gaps in the previous research, including your pilot
study, and the need for your research study. Please devote
around three pages in reviewing the previous research and
finding the gaps.
3. Arising from the literature review, write the Purpose
Statement of your research (purpose statement should have all
its parts clearly written. Follow the examples from textbook).
4. Identify two to three main hypotheses or research questions
(based on the quantitative/qualitative research design). Also
give some of your supporting research questions. Follow the
examples from textbook.
5. Describe the research strategy of inquiry and methods that
you would use and why. The method part should be the
substantial part of your paper, around three pages. Define your
knowledge claims, strategies, and methods from the textbook
(and cite), why you chose them, and how you will conduct the
research in detail.
6. A page on the significance of your study.
7. A complete reference list of your sources in APA style.
The total length of the paper should be between 8-10 pages
(excluding the reference and cover pages).
If you have further questions, please do not hesitate to contact
me.
Best wishes
Dev
mportant notes about grading:
1. Compiler errors: All code you submit must compile.
Programs that do not compile will receive an automatic zero. If
you run out of time, it is better to comment out the parts that do
not compile, than hand in a more complete file that does not
compile.
2. Late assignments: You must submit your code before the
deadline. Verify on Sakai that you have submitted the correct
version. If you submit the incorrect version before the deadline
and realize that you have done so after the deadline, we will
only grade the version received before the deadline.
A Prolog interpreter
In this project, you will implement a Prolog interpreter
in OCaml.
If you want to implement the project in Python, download the
source code here and follow the README file. Parsing
functions and test-cases are provided.
Pseudocode
Your main task is to implement the non-deterministic abstract
interpreter covered in the lecture Control in Prolog.
The pseudocode of the abstract interpreter is in the lecture note.
Bonus
There is also a bonus task for implementing
a deterministic Prolog interpreter with support for backtracking
(recover from bad choices) and choice points (produce multiple
results). Please refer to the lecture notes Programming with
Lists and Control in Prolog for more details about this
algorithm. Bonus will only be added to projects implmented in
OCaml.
How to Start (OCaml):
1. Download the source code here.
2. You will need to implement your code in final/src/final.ml.
We give detailed instructions on the functions that you need to
implement below. You only need to implement functions
with raise (Failure "Not implemented"). Delete this line after
implementation is done.
3. The test-cases (also seen below) are provided
in final/test/public.ml (if using Dune) and final/main.ml (if
using Make).
4. To compile and run your implementation, we provide two
options:
Option (1): Using Dune: type dune runtest -f in the command-
line window under final directory.
Option (2): Using Make: First, to compile the code,
type make in the command-line window under final directory.
Second, to run the code, type ./main.byte in the command-line
window under final directory.
Randomness
Because randomness is the key to the success of the non-
deterministic abstract interpreter (please see the lecture
note Control in Prologto find why), we first initialize the
randomness generator with a random seed chosen in a system-
dependent way.
In [ ]:
openStdlib
let _ = Random.self_init ()
Abstract Syntax Tree
To implement the abstract interpreter, we will start with the
definition of prolog terms (i.e. abstract syntax tree).
In [ ]:
type term =
| Constantof string (* Prolog constants, e.g.,
rickard, ned, robb, a, b, ... *)
| Variableof string (* Prolog variables, e.g., X, Y,
Z, ... *)
| Functionof string * term list (* Prolog functions, e.g.,
append(X, Y, Z), father(rickard, ned),
ancestor(Z, Y), cons (H, T)
abbreviated as [H|T] in SWI-Prolog, ...
The first component of Function is
the name of the function,
whose parameters are in a term list,
the second component of Function.*)
A Prolog program consists of clauses and goals. A clausecan be
either a fact or a rule.
A Prolog rule is in the shape of head :- body. For example,
ancestor(X, Y) :- father(X, Z), ancestor(Z, Y).
In the above rule (also called a clause), ancestor(X, Y) is
the headof the rule, which is a Prolog Function defined in the
type termabove. The rule's body is a list of terms: father(X,
Z) and ancestor(Z, Y). Both are Prolog Functions.
A Prolog fact is simply a Function defined in the type term. For
example,
father(rickard, ned).
In the above fact (also a clause), we say rickard is ned's father.
A Prolog goal (also called a query) is a list of Prolog Functions,
which is typed as a list of terms. For example,
?- ancestor(rickard, robb), ancestor(X, robb).
In the above goal, we are interested in two queries which are
Prolog Functions: ancestor(rickard, robb) and ancestor(X, robb).
In [ ]:
type head = term (* The head of a rule is a Prolog
Function *)
type body = term list (* The body of a rule is a list of Prolog
Functions *)
type clause = Factof head | Ruleof head * body (* A rule is in
the shape head :- body *)
type program = clause list (* A program consists of a list of
clauses in which we have either rules or facts. *)
type goal = term list (* A goal is a query that consists of a
few functions *)
The following stringification functions should help you debug
the interpreter.
In [ ]:
letrec string_of_f_list f tl =
let _, s = List.fold_left (fun (first, s) t ->
let prefix = if first then "" else s ^ ", " in
false, prefix ^ (f t)) (true,"") tl
in
s
(* This function converts a Prolog term (e.g. a constant,
variable or function) to a string *)
letrec string_of_term t =
match t with
| Constant c -> c
| Variable v -> v
| Function (f,tl) ->
f ^ "(" ^ (string_of_f_list string_of_term tl) ^ ")"
(* This function converts a list of Prolog terms, separated by
commas, to a string *)
let string_of_term_list fl =
string_of_f_list string_of_term fl
(* This function converts a Prolog goal (query) to a string *)
let string_of_goal g =
"?- " ^ (string_of_term_list g)
(* This function converts a Prolog clause (e.g. a rule or a fact)
to a string *)
let string_of_clause c =
match c with
| Fact f -> string_of_term f ^ "."
| Rule (h,b) -> string_of_term h ^ " :- " ^ (string_of_term_list
b) ^ "."
(* This function converts a Prolog program (a list of clauses),
separated by n, to a string *)
let string_of_program p =
letrec loop p acc =
match p with
| [] -> acc
| [c] -> acc ^ (string_of_clause c)
| c::t -> loop t (acc ^ (string_of_clause c) ^ "n")
in loop p ""
Below are more helper functions for you to easily construct a
Prolog program using the defined data types:
In [ ]:
let var v = Variable v (* helper function to construct a
Prolog Variable *)
let const c = Constant c (* helper function to construct a
Prolog Constant *)
let func f l = Function (f,l) (* helper function to construct a
Prolog Function *)
let fact f = Fact f (* helper function to construct a
Prolog Fact *)
let rule h b = Rule (h,b) (* helper function to construct a
Prolog Rule *)
Problem 1
In this problem, you will implement the function:
occurs_check : term -> term -> bool
occurs_check v t returns true if the Prolog Variable voccurs in t.
Please see the lecture note Control in Prolog to revisit the
concept of occurs-check.
Hint: You don't need to use pattern matching to
deconstruct v (type term) to compare the string value of v with
that of another variable. You can compare two Variables via
structural equality, e.g. Variable "s" = Variable "s".
Therefore, if t is a variable, it suffices to use v = t to make the
equality checking. Note that you should use = rather than == for
testing structural equality.
In [ ]:
letrec occurs_check v t =
(* YOUR CODE HERE *)
raise (Failure "Not implemented")
Examples and test-cases.
In [ ]:
assert (occurs_check (var "X") (var "X"))
assert (not (occurs_check (var "X") (var "Y")))
assert (occurs_check (var "X") (func "f" [var "X"]))
assert (occurs_check (var "E") (func "cons" [const "a"; const
"b"; var "E"]))
The last test-case above was taken from the example we used to
illustrate the occurs-check problem in the lecture note Control
in Prolog.
?- append([], E, [a,b | E]).
Here the occurs_check function asks whether the Variable E
appears on the Function term func "cons" [const "a"; const "b";
var "E"]. The return value should be true.
Problem 2
Implement the following functions which return the variables
contained in a term or a clause (e.g. a rule or a fact):
variables_of_term : term -> VarSet.t
variables_of_clause : clause -> VarSet.t
The result must be saved in a data structure of type VarSet that
is instantiated from OCaml Set module. The type of each
element (a Prolog Variable) in the set is term as defined above
(VarSet.t = term).
You may want to use VarSet.singleton t to return a singletion
set containing only one element t, use VarSet.empty to represent
an empty variable set, and use VarSet.union t1 t2 to merge two
variable sets t1 and t2.
In [ ]:
moduleVarSet = Set.Make(structtype t = term let compare =
Stdlib.compare end)
(* API Docs for Set : https://caml.inria.fr/pub/docs/manual-
ocaml/libref/Set.S.html *)
letrec variables_of_term t =
(* YOUR CODE HERE *)
raise (Failure "Not implemented")
let variables_of_clause c =
(* YOUR CODE HERE *)
raise (Failure "Not implemented")
Examples and test-cases:
In [ ]:
(* The variables in a function f (X, Y, a) is [X; Y] *)
assert (VarSet.equal (variables_of_term (func "f" [var "X"; var
"Y"; const "a"]))
(VarSet.of_list [var "X"; var "Y"]))
(* The variables in a Prolog fact p (X, Y, a) is [X; Y] *)
assert (VarSet.equal (variables_of_clause (fact (func "p" [var
"X"; var "Y"; const "a"])))
(VarSet.of_list [var "X"; var "Y"]))
(* The variables in a Prolog rule p (X, Y, a) :- q (a, b, a) is [X;
Y] *)
assert (VarSet.equal (variables_of_clause (rule (func "p" [var
"X"; var "Y"; const "a"])
[func "q" [const "a"; const "b"; const "a"]]))
(VarSet.of_list [var "X"; var "Y"]))
Problem 3
The value of type term Substitution.t is a OCaml map whose key
is of type term and value is of type term. It is a map from
variables to terms. Implement substitution functions that takes
a term Substitution.t and uses that to perform the substitution:
substitute_in_term : term Substitution.t -> term -> term
substitute_in_clause : term Substitution.t -> clause -> clause
See the lecture note Control in Prolog to revisit the concept of
substitution. For
example, �={�/�,�/�,�/�(�,�)}σ={X/a,Y/Z,Z/f(a,b)} is
substitution. It is a map from variables X, Y, Z to terms a, Z,
f(a,b). Given a term �=�(�,�,�)E=f(X,Y,Z), the
substitution ��Eσ is �(�,�,�(�,�))f(a,Z,f(a,b)).
You may want to use the Substitution.find_opt t s function. The
function takes a term (variable) t and a substitution map s as
input and returns None if t is not a key in the map s or
otherwise returns Some t' where t' = s[t].
In [ ]:
moduleSubstitution = Map.Make(structtype t = term let compare
= Stdlib.compare end)
(* See API docs for OCaml Map:
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Map.S.html
*)
(* This funtion converts a substitution to a string (for
debugging) *)
let string_of_substitution s =
"{" ^ (
Substitution.fold (
fun v t s ->
match v with
| Variable v -> s ^ "; " ^ v ^ " -> " ^ (string_of_term t)
| Constant _ -> assert false (* Note: substitution maps a
variable to a term! *)
| Function _ -> assert false (* Note: substitution maps a
variable to a term! *)
) s ""
) ^ "}"
letrec substitute_in_term s t =
(* YOUR CODE HERE *)
raise (Failure "Not implemented")
let substitute_in_clause s c =
(* YOUR CODE HERE *)
raise (Failure "Not implemented")
Examples and test-cases:
In [ ]:
(* We create a substitution map s = [Y/0, X/Y] *)
let s =
Substitution.add (var "Y") (const "0") (Substitution.add (var
"X") (var "Y") Substitution.empty)
(* Function substitution - f (X, Y, a) [Y/0, X/Y] = f (Y, 0, a) *)
assert (substitute_in_term s (func "f" [var "X"; var "Y"; const
"a"]) =
func "f" [var "Y"; const "0"; const "a"])
(* Fact substitution - p (X, Y, a) [Y/0, X/Y] = p (Y, 0, a) *)
assert (substitute_in_clause s (fact (func "p" [var "X"; var "Y";
const "a"])) =
(fact (func "p" [var "Y"; const "0"; const "a"])))
(* Given a Prolog rule, p (X, Y, a) :- q (a, b, a), after doing
substitution [Y/0, X/Y],
we have p (Y, 0, a) :- q (a, b, a) *)
assert (substitute_in_clause s (rule (func "p" [var "X"; var "Y";
const "a"]) [func "q" [const "a"; const "b"; const "a"]]) =
(rule (func "p" [var "Y"; const "0"; const "a"]) [func "q"
[const "a"; const "b"; const "a"]]))
Problem 4
Implementing the function:
unify : term -> term -> term Substitution.t
The function returns a unifier of the given terms. The function
should raise the exception raise Not_unfifiable, if the given
terms are not unifiable (Not_unfifiable is a declared exception
in final.ml). You may find the pseudocode of unify in the
lecture note Control in Prolog useful.
As in problem 3, you will need to use module
Substitutionbecause unification is driven by subsititution. ( See
API docs for OCaml
Map: https://caml.inria.fr/pub/docs/manual-
ocaml/libref/Map.S.html)
You may want to use substitute_in_term to implement the first
and second lines of the pseudocode.
You may want to use Substitution.empty for an empty
subsitution map, Substitution.singleton v t for creating a new
subsitution map that contains a single substitution [v/t],
and Substitution.add v t s to add a new substitution [v/t] to an
existing substitution map s (this function may help implement
the ∪ ∪ operation in the pseudocode). You may also want to
use Substitution.map for the �θ[X/Y] operation in the
pseudocode. This operation applies the subsitition [X/Y] to each
term in the valuesof the substitution map �θ (the keys of the
substitution map �θ remain unchanged). Subsitution.map f
s returns a new substitution map with the same keys as the input
substitution map s, where the associated term t for each key
of s has been replaced by the result of the application of f to t.
Use List.fold_left2 to implement the fold_left function in the
pseudocode (https://caml.inria.fr/pub/docs/manual-
ocaml/libref/List.html).
In [ ]:
exceptionNot_unifiable
let unify t1 t2 =
(* YOUR CODE HERE *)
raise (Failure "Not implemented")
Examples and test-cases:
In [ ]:
(* A substitution that can unify variable X and variable Y: {X-
>Y} or {Y->X} *)
assert ((unify (var "X") (var "Y")) = Substitution.singleton (var
"Y") (var "X") ||
(unify (var "X") (var "Y")) = Substitution.singleton (var
"X") (var "Y"))
(* A substitution that can unify variable Y and variable X: {X-
>Y} pr {Y->X} *)
assert ((unify (var "Y") (var "X")) = Substitution.singleton (var
"X") (var "Y") ||
(unify (var "Y") (var "X")) = Substitution.singleton (var
"Y") (var "X"))
(* A substitution that can unify variable Y and variable Y:
empty set *)
assert (unify (var "Y") (var "Y") = Substitution.empty)
(* A substitution that can unify constant 0 and constant 0:
empty set *)
assert (unify (const "0") (const "0") = Substitution.empty)
(* A substitution that can unify constant 0 and variable Y: {Y-
>0} *)
assert (unify (const "0") (var "Y") = Substitution.singleton (var
"Y") (const "0"))
(* Cannot unify two distinct constants *)
assert (
match unify (const "0") (const "1") with
| _ -> false
| exceptionNot_unifiable -> true)
(* Cannot unify two functions with distinct function symbols *)
assert (
match unify (func "f" [const "0"]) (func "g" [const "1"]) with
| _ -> false
| exceptionNot_unifiable -> true)
(* A substitution that can unify function f(X) and function f(Y):
{X->Y} or {Y->X} *)
assert (unify (func "f" [var "X"]) (func "f" [var "Y"]) =
Substitution.singleton (var "X") (var "Y") ||
unify (func "f" [var "X"]) (func "f" [var "Y"]) =
Substitution.singleton (var "Y") (var "X"))
In [ ]:
(* A substitution that can unify function f(X,Y,Y) and function
f(Y,Z,a): {X->a;Y->a;Z->a} *)
let t1 = Function("f", [Variable "X"; Variable "Y"; Variable
"Y"])
let t2 = Function("f", [Variable "Y"; Variable "Z"; Constant
"a"])
let u = unify t1 t2
let _ = assert (string_of_substitution u = "{; X -> a; Y -> a; Z -
> a}")
Problem 5
We first define a function freshen that given a clause, returns a
clause where are the variables have been renamed with fresh
variables. This function will be used for the
clause renaming operation in the implementation
of nondet_query.
In [ ]:
let counter = ref 0
let fresh () =
let c = !counter in
counter := !counter + 1;
Variable ("_G" ^ string_of_int c)
let freshen c =
let vars = variables_of_clause c in
let s = VarSet.fold (fun v s -> Substitution.add v (fresh()) s)
vars Substitution.empty in
substitute_in_clause s c
For example,
In [ ]:
let c = (rule (func "p" [var "X"; var "Y"; const "a"]) [func "q"
[var "X"; const "b"; const "a"]])
(* The string representation of a rule c is p(X, Y, a) :- q(X, b,
a). *)
let _ = print_endline (string_of_clause c)
(* After renaming, the string representation is p(_G0, _G1, a) :-
q(_G0, b, a).
X is replaced by _G0 and Y is replaced by _G1. *)
let _ = print_endline (string_of_clause (freshen c))
The main task of problem 5 is to implement a nondeterministic
Prolog interpreter.
Following the pseudocode Abstract interpreter in the lecture
note Control in Prolog to implement the interpreter:
nondet_query : clause list -> term list -> term list
where
· the first argument is the program which is a list of clauses
(rules and facts).
· the second argument is the goal which is a list of terms.
The function returns a list of terms (results), which is an
instance of the original goal and is a logical consequence of
the program. See tests cases for examples.
Please follow the pseudocode, which means you need to have
two recursive functions in your implementation
of nondet_query. For the goal order, choose randomly; for the
rule order, choose randomly from the facts that can be unified
with the chosen goal and the rules that whose head can be
unified with the chosen goal. Please see the lecture note Control
in Prolog to find why. You may find the function Random.int
n useful. This function can randomly return an integer
within [0, n).
In [ ]:
let nondet_query program goal =
(* YOUR CODE HERE *)
raise (Failure "Not implemented")
Examples and Test-cases:
(1) Our first example is the House Stark program (lecture
note Prolog Basics).
In [ ]:
(* Define the House Stark program:
father(rickard, ned).
father(ned, robb).
ancestor(X, Y) :- father(X, Y).
ancestor(X, Y) :- father(X, Z), ancestor(Z, Y).
*)
let ancestor x y = func "ancestor" [x;y]
let father x y = func "father" [x;y]
let father_consts x y = father (Constant x) (Constant y)
let f1 = Fact (father_consts "rickard" "ned")
let f2 = Fact (father_consts "ned" "robb")
let r1 = Rule (ancestor (var "X") (var "Y"), [father (var "X")
(var "Y")])
let r2 = Rule (ancestor (var "X") (var "Y"), [father (var "X")
(var "Z"); ancestor (var "Z") (var "Y")])
let pstark = [f1;f2;r1;r2]
let _ = print_endline ("Program:n" ^ (string_of_program
pstark))
(* Define a goal (query):
?- ancestor(rickard, robb)
The solution is the query itself.
*)
let g = [ancestor (const "rickard") (const "robb")]
let _ = print_endline ("Goal:n" ^ (string_of_goal g))
let g' = nondet_query pstark g
let _ = print_endline ("
Solution
:n" ^ (string_of_goal g'))
let _ = assert (g' = [ancestor (const "rickard") (const "robb")])
(* Define a goal (query):
?- ancestor(X, robb)
The solution can be either ancestor(ned, robb) or
ancestor(rickard, robb)
*)
let g = [ancestor (var "X") (const "robb")]
let _ = print_endline ("Goal:n" ^ (string_of_goal g))
let g' = nondet_query pstark g
let _ = print_endline ("

More Related Content

Similar to COMM 166 Final Research Proposal GuidelinesThe proposal should.docx

PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...Maulik Borsaniya
 
The program reads data from two files, itemsList-0x.txt and .docx
The program reads data from two files, itemsList-0x.txt and .docxThe program reads data from two files, itemsList-0x.txt and .docx
The program reads data from two files, itemsList-0x.txt and .docxoscars29
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experiencedzynofustechnology
 
Python programming variables and comment
Python programming variables and commentPython programming variables and comment
Python programming variables and commentMalligaarjunanN
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01Wingston
 
maXbox Starter 36 Software Testing
maXbox Starter 36 Software TestingmaXbox Starter 36 Software Testing
maXbox Starter 36 Software TestingMax Kleiner
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packagesAjay Ohri
 
Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxfredharris32
 
Functions in C++
Functions in C++Functions in C++
Functions in C++home
 
(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_iNico Ludwig
 
Introduction To Programming with Python-1
Introduction To Programming with Python-1Introduction To Programming with Python-1
Introduction To Programming with Python-1Syed Farjad Zia Zaidi
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersAlessandro Sanino
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG Greg.Helton
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2Prerna Sharma
 
Ecs 10 programming assignment 4 loopapalooza
Ecs 10 programming assignment 4   loopapaloozaEcs 10 programming assignment 4   loopapalooza
Ecs 10 programming assignment 4 loopapaloozaJenniferBall44
 
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...vekariyakashyap
 
Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)Hermann Hueck
 

Similar to COMM 166 Final Research Proposal GuidelinesThe proposal should.docx (20)

Slides chapters 28-32
Slides chapters 28-32Slides chapters 28-32
Slides chapters 28-32
 
Turbo prolog 2.0 basics
Turbo prolog 2.0 basicsTurbo prolog 2.0 basics
Turbo prolog 2.0 basics
 
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
 
The program reads data from two files, itemsList-0x.txt and .docx
The program reads data from two files, itemsList-0x.txt and .docxThe program reads data from two files, itemsList-0x.txt and .docx
The program reads data from two files, itemsList-0x.txt and .docx
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experienced
 
08 -functions
08  -functions08  -functions
08 -functions
 
Python programming variables and comment
Python programming variables and commentPython programming variables and comment
Python programming variables and comment
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
maXbox Starter 36 Software Testing
maXbox Starter 36 Software TestingmaXbox Starter 36 Software Testing
maXbox Starter 36 Software Testing
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packages
 
Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docx
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i
 
Introduction To Programming with Python-1
Introduction To Programming with Python-1Introduction To Programming with Python-1
Introduction To Programming with Python-1
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to Gophers
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2
 
Ecs 10 programming assignment 4 loopapalooza
Ecs 10 programming assignment 4   loopapaloozaEcs 10 programming assignment 4   loopapalooza
Ecs 10 programming assignment 4 loopapalooza
 
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
 
Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)
 

More from monicafrancis71118

1. Discuss Blockchains potential application in compensation system.docx
1. Discuss Blockchains potential application in compensation system.docx1. Discuss Blockchains potential application in compensation system.docx
1. Discuss Blockchains potential application in compensation system.docxmonicafrancis71118
 
1. Describe the characteristics of the aging process. Explain how so.docx
1. Describe the characteristics of the aging process. Explain how so.docx1. Describe the characteristics of the aging process. Explain how so.docx
1. Describe the characteristics of the aging process. Explain how so.docxmonicafrancis71118
 
1. Dis. 7Should we continue to collect data on race and .docx
1. Dis. 7Should we continue to collect data on race and .docx1. Dis. 7Should we continue to collect data on race and .docx
1. Dis. 7Should we continue to collect data on race and .docxmonicafrancis71118
 
1. Differentiate crisis intervention from other counseling therapeut.docx
1. Differentiate crisis intervention from other counseling therapeut.docx1. Differentiate crisis intervention from other counseling therapeut.docx
1. Differentiate crisis intervention from other counseling therapeut.docxmonicafrancis71118
 
1. Despite our rational nature, our ability to reason well is ofte.docx
1. Despite our rational nature, our ability to reason well is ofte.docx1. Despite our rational nature, our ability to reason well is ofte.docx
1. Despite our rational nature, our ability to reason well is ofte.docxmonicafrancis71118
 
1. Describe the ethical challenges faced by organizations operating .docx
1. Describe the ethical challenges faced by organizations operating .docx1. Describe the ethical challenges faced by organizations operating .docx
1. Describe the ethical challenges faced by organizations operating .docxmonicafrancis71118
 
1. Describe in your own words the anatomy of a muscle.  This sho.docx
1. Describe in your own words the anatomy of a muscle.  This sho.docx1. Describe in your own words the anatomy of a muscle.  This sho.docx
1. Describe in your own words the anatomy of a muscle.  This sho.docxmonicafrancis71118
 
1. Describe how your attitude of including aspects of health literac.docx
1. Describe how your attitude of including aspects of health literac.docx1. Describe how your attitude of including aspects of health literac.docx
1. Describe how your attitude of including aspects of health literac.docxmonicafrancis71118
 
1. Choose a behavior (such as overeating, shopping, Internet use.docx
1. Choose a behavior (such as overeating, shopping, Internet use.docx1. Choose a behavior (such as overeating, shopping, Internet use.docx
1. Choose a behavior (such as overeating, shopping, Internet use.docxmonicafrancis71118
 
1. Case 3-4 Franklin Industries’ Whistleblowing (a GVV Case)Natali.docx
1. Case 3-4 Franklin Industries’ Whistleblowing (a GVV Case)Natali.docx1. Case 3-4 Franklin Industries’ Whistleblowing (a GVV Case)Natali.docx
1. Case 3-4 Franklin Industries’ Whistleblowing (a GVV Case)Natali.docxmonicafrancis71118
 
1. Cryptography is used to protect confidential data in many areas. .docx
1. Cryptography is used to protect confidential data in many areas. .docx1. Cryptography is used to protect confidential data in many areas. .docx
1. Cryptography is used to protect confidential data in many areas. .docxmonicafrancis71118
 
1. Compare and contrast steganography and cryptography.2. Why st.docx
1. Compare and contrast steganography and cryptography.2. Why st.docx1. Compare and contrast steganography and cryptography.2. Why st.docx
1. Compare and contrast steganography and cryptography.2. Why st.docxmonicafrancis71118
 
1. Date September 13, 2017 – September 15, 2017 2. Curr.docx
1. Date September 13, 2017 – September 15, 2017 2. Curr.docx1. Date September 13, 2017 – September 15, 2017 2. Curr.docx
1. Date September 13, 2017 – September 15, 2017 2. Curr.docxmonicafrancis71118
 
1. compare and contrast predictive analytics with prescriptive and d.docx
1. compare and contrast predictive analytics with prescriptive and d.docx1. compare and contrast predictive analytics with prescriptive and d.docx
1. compare and contrast predictive analytics with prescriptive and d.docxmonicafrancis71118
 
1. Creating and maintaining relationships between home and schoo.docx
1. Creating and maintaining relationships between home and schoo.docx1. Creating and maintaining relationships between home and schoo.docx
1. Creating and maintaining relationships between home and schoo.docxmonicafrancis71118
 
1. Compare and contrast Strategic and Tactical Analysis and its .docx
1. Compare and contrast Strategic and Tactical Analysis and its .docx1. Compare and contrast Strategic and Tactical Analysis and its .docx
1. Compare and contrast Strategic and Tactical Analysis and its .docxmonicafrancis71118
 
1. Coalition ProposalVaccination Policy for Infectious Disease P.docx
1. Coalition ProposalVaccination Policy for Infectious Disease P.docx1. Coalition ProposalVaccination Policy for Infectious Disease P.docx
1. Coalition ProposalVaccination Policy for Infectious Disease P.docxmonicafrancis71118
 
1. Company Description and Backgrounda. Weight Watchers was cr.docx
1. Company Description and Backgrounda. Weight Watchers was cr.docx1. Company Description and Backgrounda. Weight Watchers was cr.docx
1. Company Description and Backgrounda. Weight Watchers was cr.docxmonicafrancis71118
 
1. Come up with TWO movie ideas -- as in for TWO screenplays that .docx
1. Come up with TWO movie ideas -- as in for TWO screenplays that .docx1. Come up with TWO movie ideas -- as in for TWO screenplays that .docx
1. Come up with TWO movie ideas -- as in for TWO screenplays that .docxmonicafrancis71118
 
1. Choose a case for the paper that interests you. Most choose a .docx
1. Choose a case for the paper that interests you.  Most choose a .docx1. Choose a case for the paper that interests you.  Most choose a .docx
1. Choose a case for the paper that interests you. Most choose a .docxmonicafrancis71118
 

More from monicafrancis71118 (20)

1. Discuss Blockchains potential application in compensation system.docx
1. Discuss Blockchains potential application in compensation system.docx1. Discuss Blockchains potential application in compensation system.docx
1. Discuss Blockchains potential application in compensation system.docx
 
1. Describe the characteristics of the aging process. Explain how so.docx
1. Describe the characteristics of the aging process. Explain how so.docx1. Describe the characteristics of the aging process. Explain how so.docx
1. Describe the characteristics of the aging process. Explain how so.docx
 
1. Dis. 7Should we continue to collect data on race and .docx
1. Dis. 7Should we continue to collect data on race and .docx1. Dis. 7Should we continue to collect data on race and .docx
1. Dis. 7Should we continue to collect data on race and .docx
 
1. Differentiate crisis intervention from other counseling therapeut.docx
1. Differentiate crisis intervention from other counseling therapeut.docx1. Differentiate crisis intervention from other counseling therapeut.docx
1. Differentiate crisis intervention from other counseling therapeut.docx
 
1. Despite our rational nature, our ability to reason well is ofte.docx
1. Despite our rational nature, our ability to reason well is ofte.docx1. Despite our rational nature, our ability to reason well is ofte.docx
1. Despite our rational nature, our ability to reason well is ofte.docx
 
1. Describe the ethical challenges faced by organizations operating .docx
1. Describe the ethical challenges faced by organizations operating .docx1. Describe the ethical challenges faced by organizations operating .docx
1. Describe the ethical challenges faced by organizations operating .docx
 
1. Describe in your own words the anatomy of a muscle.  This sho.docx
1. Describe in your own words the anatomy of a muscle.  This sho.docx1. Describe in your own words the anatomy of a muscle.  This sho.docx
1. Describe in your own words the anatomy of a muscle.  This sho.docx
 
1. Describe how your attitude of including aspects of health literac.docx
1. Describe how your attitude of including aspects of health literac.docx1. Describe how your attitude of including aspects of health literac.docx
1. Describe how your attitude of including aspects of health literac.docx
 
1. Choose a behavior (such as overeating, shopping, Internet use.docx
1. Choose a behavior (such as overeating, shopping, Internet use.docx1. Choose a behavior (such as overeating, shopping, Internet use.docx
1. Choose a behavior (such as overeating, shopping, Internet use.docx
 
1. Case 3-4 Franklin Industries’ Whistleblowing (a GVV Case)Natali.docx
1. Case 3-4 Franklin Industries’ Whistleblowing (a GVV Case)Natali.docx1. Case 3-4 Franklin Industries’ Whistleblowing (a GVV Case)Natali.docx
1. Case 3-4 Franklin Industries’ Whistleblowing (a GVV Case)Natali.docx
 
1. Cryptography is used to protect confidential data in many areas. .docx
1. Cryptography is used to protect confidential data in many areas. .docx1. Cryptography is used to protect confidential data in many areas. .docx
1. Cryptography is used to protect confidential data in many areas. .docx
 
1. Compare and contrast steganography and cryptography.2. Why st.docx
1. Compare and contrast steganography and cryptography.2. Why st.docx1. Compare and contrast steganography and cryptography.2. Why st.docx
1. Compare and contrast steganography and cryptography.2. Why st.docx
 
1. Date September 13, 2017 – September 15, 2017 2. Curr.docx
1. Date September 13, 2017 – September 15, 2017 2. Curr.docx1. Date September 13, 2017 – September 15, 2017 2. Curr.docx
1. Date September 13, 2017 – September 15, 2017 2. Curr.docx
 
1. compare and contrast predictive analytics with prescriptive and d.docx
1. compare and contrast predictive analytics with prescriptive and d.docx1. compare and contrast predictive analytics with prescriptive and d.docx
1. compare and contrast predictive analytics with prescriptive and d.docx
 
1. Creating and maintaining relationships between home and schoo.docx
1. Creating and maintaining relationships between home and schoo.docx1. Creating and maintaining relationships between home and schoo.docx
1. Creating and maintaining relationships between home and schoo.docx
 
1. Compare and contrast Strategic and Tactical Analysis and its .docx
1. Compare and contrast Strategic and Tactical Analysis and its .docx1. Compare and contrast Strategic and Tactical Analysis and its .docx
1. Compare and contrast Strategic and Tactical Analysis and its .docx
 
1. Coalition ProposalVaccination Policy for Infectious Disease P.docx
1. Coalition ProposalVaccination Policy for Infectious Disease P.docx1. Coalition ProposalVaccination Policy for Infectious Disease P.docx
1. Coalition ProposalVaccination Policy for Infectious Disease P.docx
 
1. Company Description and Backgrounda. Weight Watchers was cr.docx
1. Company Description and Backgrounda. Weight Watchers was cr.docx1. Company Description and Backgrounda. Weight Watchers was cr.docx
1. Company Description and Backgrounda. Weight Watchers was cr.docx
 
1. Come up with TWO movie ideas -- as in for TWO screenplays that .docx
1. Come up with TWO movie ideas -- as in for TWO screenplays that .docx1. Come up with TWO movie ideas -- as in for TWO screenplays that .docx
1. Come up with TWO movie ideas -- as in for TWO screenplays that .docx
 
1. Choose a case for the paper that interests you. Most choose a .docx
1. Choose a case for the paper that interests you.  Most choose a .docx1. Choose a case for the paper that interests you.  Most choose a .docx
1. Choose a case for the paper that interests you. Most choose a .docx
 

Recently uploaded

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

Recently uploaded (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 

COMM 166 Final Research Proposal GuidelinesThe proposal should.docx

  • 1. COMM 166 Final Research Proposal Guidelines The proposal should contain well-developed sections (Put clear titles on the top of each section) of your outline that you submitted earlier. The proposal should have seven (7) major sections: 1. Introduction: A brief overview of all your sections. Approx. one page 2. A summary of the literature review. In this section you would summarize the previous research (summarize at least 8-10 scholarly research articles), and also your field data collection results (if it was connected to your proposal topic). Also indicate the gaps in the previous research, including your pilot study, and the need for your research study. Please devote around three pages in reviewing the previous research and finding the gaps. 3. Arising from the literature review, write the Purpose Statement of your research (purpose statement should have all its parts clearly written. Follow the examples from textbook). 4. Identify two to three main hypotheses or research questions (based on the quantitative/qualitative research design). Also give some of your supporting research questions. Follow the examples from textbook. 5. Describe the research strategy of inquiry and methods that you would use and why. The method part should be the substantial part of your paper, around three pages. Define your knowledge claims, strategies, and methods from the textbook (and cite), why you chose them, and how you will conduct the research in detail. 6. A page on the significance of your study.
  • 2. 7. A complete reference list of your sources in APA style. The total length of the paper should be between 8-10 pages (excluding the reference and cover pages). If you have further questions, please do not hesitate to contact me. Best wishes Dev mportant notes about grading: 1. Compiler errors: All code you submit must compile. Programs that do not compile will receive an automatic zero. If you run out of time, it is better to comment out the parts that do not compile, than hand in a more complete file that does not compile. 2. Late assignments: You must submit your code before the deadline. Verify on Sakai that you have submitted the correct version. If you submit the incorrect version before the deadline and realize that you have done so after the deadline, we will only grade the version received before the deadline. A Prolog interpreter In this project, you will implement a Prolog interpreter in OCaml. If you want to implement the project in Python, download the source code here and follow the README file. Parsing functions and test-cases are provided. Pseudocode Your main task is to implement the non-deterministic abstract interpreter covered in the lecture Control in Prolog. The pseudocode of the abstract interpreter is in the lecture note. Bonus
  • 3. There is also a bonus task for implementing a deterministic Prolog interpreter with support for backtracking (recover from bad choices) and choice points (produce multiple results). Please refer to the lecture notes Programming with Lists and Control in Prolog for more details about this algorithm. Bonus will only be added to projects implmented in OCaml. How to Start (OCaml): 1. Download the source code here. 2. You will need to implement your code in final/src/final.ml. We give detailed instructions on the functions that you need to implement below. You only need to implement functions with raise (Failure "Not implemented"). Delete this line after implementation is done. 3. The test-cases (also seen below) are provided in final/test/public.ml (if using Dune) and final/main.ml (if using Make). 4. To compile and run your implementation, we provide two options: Option (1): Using Dune: type dune runtest -f in the command- line window under final directory. Option (2): Using Make: First, to compile the code, type make in the command-line window under final directory. Second, to run the code, type ./main.byte in the command-line window under final directory. Randomness Because randomness is the key to the success of the non- deterministic abstract interpreter (please see the lecture note Control in Prologto find why), we first initialize the randomness generator with a random seed chosen in a system- dependent way. In [ ]: openStdlib let _ = Random.self_init () Abstract Syntax Tree
  • 4. To implement the abstract interpreter, we will start with the definition of prolog terms (i.e. abstract syntax tree). In [ ]: type term = | Constantof string (* Prolog constants, e.g., rickard, ned, robb, a, b, ... *) | Variableof string (* Prolog variables, e.g., X, Y, Z, ... *) | Functionof string * term list (* Prolog functions, e.g., append(X, Y, Z), father(rickard, ned), ancestor(Z, Y), cons (H, T) abbreviated as [H|T] in SWI-Prolog, ... The first component of Function is the name of the function, whose parameters are in a term list, the second component of Function.*) A Prolog program consists of clauses and goals. A clausecan be either a fact or a rule. A Prolog rule is in the shape of head :- body. For example, ancestor(X, Y) :- father(X, Z), ancestor(Z, Y). In the above rule (also called a clause), ancestor(X, Y) is the headof the rule, which is a Prolog Function defined in the type termabove. The rule's body is a list of terms: father(X, Z) and ancestor(Z, Y). Both are Prolog Functions. A Prolog fact is simply a Function defined in the type term. For example, father(rickard, ned). In the above fact (also a clause), we say rickard is ned's father. A Prolog goal (also called a query) is a list of Prolog Functions, which is typed as a list of terms. For example, ?- ancestor(rickard, robb), ancestor(X, robb). In the above goal, we are interested in two queries which are Prolog Functions: ancestor(rickard, robb) and ancestor(X, robb). In [ ]: type head = term (* The head of a rule is a Prolog Function *)
  • 5. type body = term list (* The body of a rule is a list of Prolog Functions *) type clause = Factof head | Ruleof head * body (* A rule is in the shape head :- body *) type program = clause list (* A program consists of a list of clauses in which we have either rules or facts. *) type goal = term list (* A goal is a query that consists of a few functions *) The following stringification functions should help you debug the interpreter. In [ ]: letrec string_of_f_list f tl = let _, s = List.fold_left (fun (first, s) t -> let prefix = if first then "" else s ^ ", " in false, prefix ^ (f t)) (true,"") tl in s (* This function converts a Prolog term (e.g. a constant, variable or function) to a string *) letrec string_of_term t = match t with | Constant c -> c | Variable v -> v | Function (f,tl) -> f ^ "(" ^ (string_of_f_list string_of_term tl) ^ ")" (* This function converts a list of Prolog terms, separated by commas, to a string *) let string_of_term_list fl = string_of_f_list string_of_term fl (* This function converts a Prolog goal (query) to a string *)
  • 6. let string_of_goal g = "?- " ^ (string_of_term_list g) (* This function converts a Prolog clause (e.g. a rule or a fact) to a string *) let string_of_clause c = match c with | Fact f -> string_of_term f ^ "." | Rule (h,b) -> string_of_term h ^ " :- " ^ (string_of_term_list b) ^ "." (* This function converts a Prolog program (a list of clauses), separated by n, to a string *) let string_of_program p = letrec loop p acc = match p with | [] -> acc | [c] -> acc ^ (string_of_clause c) | c::t -> loop t (acc ^ (string_of_clause c) ^ "n") in loop p "" Below are more helper functions for you to easily construct a Prolog program using the defined data types: In [ ]: let var v = Variable v (* helper function to construct a Prolog Variable *) let const c = Constant c (* helper function to construct a Prolog Constant *) let func f l = Function (f,l) (* helper function to construct a Prolog Function *) let fact f = Fact f (* helper function to construct a Prolog Fact *) let rule h b = Rule (h,b) (* helper function to construct a Prolog Rule *) Problem 1 In this problem, you will implement the function: occurs_check : term -> term -> bool
  • 7. occurs_check v t returns true if the Prolog Variable voccurs in t. Please see the lecture note Control in Prolog to revisit the concept of occurs-check. Hint: You don't need to use pattern matching to deconstruct v (type term) to compare the string value of v with that of another variable. You can compare two Variables via structural equality, e.g. Variable "s" = Variable "s". Therefore, if t is a variable, it suffices to use v = t to make the equality checking. Note that you should use = rather than == for testing structural equality. In [ ]: letrec occurs_check v t = (* YOUR CODE HERE *) raise (Failure "Not implemented") Examples and test-cases. In [ ]: assert (occurs_check (var "X") (var "X")) assert (not (occurs_check (var "X") (var "Y"))) assert (occurs_check (var "X") (func "f" [var "X"])) assert (occurs_check (var "E") (func "cons" [const "a"; const "b"; var "E"])) The last test-case above was taken from the example we used to illustrate the occurs-check problem in the lecture note Control in Prolog. ?- append([], E, [a,b | E]). Here the occurs_check function asks whether the Variable E appears on the Function term func "cons" [const "a"; const "b"; var "E"]. The return value should be true. Problem 2 Implement the following functions which return the variables contained in a term or a clause (e.g. a rule or a fact): variables_of_term : term -> VarSet.t variables_of_clause : clause -> VarSet.t The result must be saved in a data structure of type VarSet that is instantiated from OCaml Set module. The type of each element (a Prolog Variable) in the set is term as defined above
  • 8. (VarSet.t = term). You may want to use VarSet.singleton t to return a singletion set containing only one element t, use VarSet.empty to represent an empty variable set, and use VarSet.union t1 t2 to merge two variable sets t1 and t2. In [ ]: moduleVarSet = Set.Make(structtype t = term let compare = Stdlib.compare end) (* API Docs for Set : https://caml.inria.fr/pub/docs/manual- ocaml/libref/Set.S.html *) letrec variables_of_term t = (* YOUR CODE HERE *) raise (Failure "Not implemented") let variables_of_clause c = (* YOUR CODE HERE *) raise (Failure "Not implemented") Examples and test-cases: In [ ]: (* The variables in a function f (X, Y, a) is [X; Y] *) assert (VarSet.equal (variables_of_term (func "f" [var "X"; var "Y"; const "a"])) (VarSet.of_list [var "X"; var "Y"])) (* The variables in a Prolog fact p (X, Y, a) is [X; Y] *) assert (VarSet.equal (variables_of_clause (fact (func "p" [var "X"; var "Y"; const "a"]))) (VarSet.of_list [var "X"; var "Y"])) (* The variables in a Prolog rule p (X, Y, a) :- q (a, b, a) is [X; Y] *) assert (VarSet.equal (variables_of_clause (rule (func "p" [var "X"; var "Y"; const "a"]) [func "q" [const "a"; const "b"; const "a"]])) (VarSet.of_list [var "X"; var "Y"])) Problem 3 The value of type term Substitution.t is a OCaml map whose key
  • 9. is of type term and value is of type term. It is a map from variables to terms. Implement substitution functions that takes a term Substitution.t and uses that to perform the substitution: substitute_in_term : term Substitution.t -> term -> term substitute_in_clause : term Substitution.t -> clause -> clause See the lecture note Control in Prolog to revisit the concept of substitution. For example, �={�/�,�/�,�/�(�,�)}σ={X/a,Y/Z,Z/f(a,b)} is substitution. It is a map from variables X, Y, Z to terms a, Z, f(a,b). Given a term �=�(�,�,�)E=f(X,Y,Z), the substitution ��Eσ is �(�,�,�(�,�))f(a,Z,f(a,b)). You may want to use the Substitution.find_opt t s function. The function takes a term (variable) t and a substitution map s as input and returns None if t is not a key in the map s or otherwise returns Some t' where t' = s[t]. In [ ]: moduleSubstitution = Map.Make(structtype t = term let compare = Stdlib.compare end) (* See API docs for OCaml Map: https://caml.inria.fr/pub/docs/manual-ocaml/libref/Map.S.html *) (* This funtion converts a substitution to a string (for debugging) *) let string_of_substitution s = "{" ^ ( Substitution.fold ( fun v t s -> match v with | Variable v -> s ^ "; " ^ v ^ " -> " ^ (string_of_term t) | Constant _ -> assert false (* Note: substitution maps a variable to a term! *) | Function _ -> assert false (* Note: substitution maps a variable to a term! *) ) s "" ) ^ "}"
  • 10. letrec substitute_in_term s t = (* YOUR CODE HERE *) raise (Failure "Not implemented") let substitute_in_clause s c = (* YOUR CODE HERE *) raise (Failure "Not implemented") Examples and test-cases: In [ ]: (* We create a substitution map s = [Y/0, X/Y] *) let s = Substitution.add (var "Y") (const "0") (Substitution.add (var "X") (var "Y") Substitution.empty) (* Function substitution - f (X, Y, a) [Y/0, X/Y] = f (Y, 0, a) *) assert (substitute_in_term s (func "f" [var "X"; var "Y"; const "a"]) = func "f" [var "Y"; const "0"; const "a"]) (* Fact substitution - p (X, Y, a) [Y/0, X/Y] = p (Y, 0, a) *) assert (substitute_in_clause s (fact (func "p" [var "X"; var "Y"; const "a"])) = (fact (func "p" [var "Y"; const "0"; const "a"]))) (* Given a Prolog rule, p (X, Y, a) :- q (a, b, a), after doing substitution [Y/0, X/Y], we have p (Y, 0, a) :- q (a, b, a) *) assert (substitute_in_clause s (rule (func "p" [var "X"; var "Y"; const "a"]) [func "q" [const "a"; const "b"; const "a"]]) = (rule (func "p" [var "Y"; const "0"; const "a"]) [func "q" [const "a"; const "b"; const "a"]])) Problem 4 Implementing the function: unify : term -> term -> term Substitution.t The function returns a unifier of the given terms. The function should raise the exception raise Not_unfifiable, if the given terms are not unifiable (Not_unfifiable is a declared exception
  • 11. in final.ml). You may find the pseudocode of unify in the lecture note Control in Prolog useful. As in problem 3, you will need to use module Substitutionbecause unification is driven by subsititution. ( See API docs for OCaml Map: https://caml.inria.fr/pub/docs/manual- ocaml/libref/Map.S.html) You may want to use substitute_in_term to implement the first and second lines of the pseudocode. You may want to use Substitution.empty for an empty subsitution map, Substitution.singleton v t for creating a new subsitution map that contains a single substitution [v/t], and Substitution.add v t s to add a new substitution [v/t] to an existing substitution map s (this function may help implement the ∪ ∪ operation in the pseudocode). You may also want to use Substitution.map for the �θ[X/Y] operation in the pseudocode. This operation applies the subsitition [X/Y] to each term in the valuesof the substitution map �θ (the keys of the substitution map �θ remain unchanged). Subsitution.map f s returns a new substitution map with the same keys as the input substitution map s, where the associated term t for each key of s has been replaced by the result of the application of f to t. Use List.fold_left2 to implement the fold_left function in the pseudocode (https://caml.inria.fr/pub/docs/manual- ocaml/libref/List.html). In [ ]: exceptionNot_unifiable let unify t1 t2 = (* YOUR CODE HERE *) raise (Failure "Not implemented") Examples and test-cases: In [ ]: (* A substitution that can unify variable X and variable Y: {X- >Y} or {Y->X} *) assert ((unify (var "X") (var "Y")) = Substitution.singleton (var
  • 12. "Y") (var "X") || (unify (var "X") (var "Y")) = Substitution.singleton (var "X") (var "Y")) (* A substitution that can unify variable Y and variable X: {X- >Y} pr {Y->X} *) assert ((unify (var "Y") (var "X")) = Substitution.singleton (var "X") (var "Y") || (unify (var "Y") (var "X")) = Substitution.singleton (var "Y") (var "X")) (* A substitution that can unify variable Y and variable Y: empty set *) assert (unify (var "Y") (var "Y") = Substitution.empty) (* A substitution that can unify constant 0 and constant 0: empty set *) assert (unify (const "0") (const "0") = Substitution.empty) (* A substitution that can unify constant 0 and variable Y: {Y- >0} *) assert (unify (const "0") (var "Y") = Substitution.singleton (var "Y") (const "0")) (* Cannot unify two distinct constants *) assert ( match unify (const "0") (const "1") with | _ -> false | exceptionNot_unifiable -> true) (* Cannot unify two functions with distinct function symbols *) assert ( match unify (func "f" [const "0"]) (func "g" [const "1"]) with | _ -> false | exceptionNot_unifiable -> true) (* A substitution that can unify function f(X) and function f(Y): {X->Y} or {Y->X} *) assert (unify (func "f" [var "X"]) (func "f" [var "Y"]) = Substitution.singleton (var "X") (var "Y") || unify (func "f" [var "X"]) (func "f" [var "Y"]) = Substitution.singleton (var "Y") (var "X")) In [ ]:
  • 13. (* A substitution that can unify function f(X,Y,Y) and function f(Y,Z,a): {X->a;Y->a;Z->a} *) let t1 = Function("f", [Variable "X"; Variable "Y"; Variable "Y"]) let t2 = Function("f", [Variable "Y"; Variable "Z"; Constant "a"]) let u = unify t1 t2 let _ = assert (string_of_substitution u = "{; X -> a; Y -> a; Z - > a}") Problem 5 We first define a function freshen that given a clause, returns a clause where are the variables have been renamed with fresh variables. This function will be used for the clause renaming operation in the implementation of nondet_query. In [ ]: let counter = ref 0 let fresh () = let c = !counter in counter := !counter + 1; Variable ("_G" ^ string_of_int c) let freshen c = let vars = variables_of_clause c in let s = VarSet.fold (fun v s -> Substitution.add v (fresh()) s) vars Substitution.empty in substitute_in_clause s c For example, In [ ]: let c = (rule (func "p" [var "X"; var "Y"; const "a"]) [func "q" [var "X"; const "b"; const "a"]]) (* The string representation of a rule c is p(X, Y, a) :- q(X, b, a). *) let _ = print_endline (string_of_clause c) (* After renaming, the string representation is p(_G0, _G1, a) :- q(_G0, b, a).
  • 14. X is replaced by _G0 and Y is replaced by _G1. *) let _ = print_endline (string_of_clause (freshen c)) The main task of problem 5 is to implement a nondeterministic Prolog interpreter. Following the pseudocode Abstract interpreter in the lecture note Control in Prolog to implement the interpreter: nondet_query : clause list -> term list -> term list where · the first argument is the program which is a list of clauses (rules and facts). · the second argument is the goal which is a list of terms. The function returns a list of terms (results), which is an instance of the original goal and is a logical consequence of the program. See tests cases for examples. Please follow the pseudocode, which means you need to have two recursive functions in your implementation of nondet_query. For the goal order, choose randomly; for the rule order, choose randomly from the facts that can be unified with the chosen goal and the rules that whose head can be unified with the chosen goal. Please see the lecture note Control in Prolog to find why. You may find the function Random.int n useful. This function can randomly return an integer within [0, n). In [ ]: let nondet_query program goal = (* YOUR CODE HERE *) raise (Failure "Not implemented") Examples and Test-cases: (1) Our first example is the House Stark program (lecture note Prolog Basics). In [ ]: (* Define the House Stark program: father(rickard, ned). father(ned, robb). ancestor(X, Y) :- father(X, Y).
  • 15. ancestor(X, Y) :- father(X, Z), ancestor(Z, Y). *) let ancestor x y = func "ancestor" [x;y] let father x y = func "father" [x;y] let father_consts x y = father (Constant x) (Constant y) let f1 = Fact (father_consts "rickard" "ned") let f2 = Fact (father_consts "ned" "robb") let r1 = Rule (ancestor (var "X") (var "Y"), [father (var "X") (var "Y")]) let r2 = Rule (ancestor (var "X") (var "Y"), [father (var "X") (var "Z"); ancestor (var "Z") (var "Y")]) let pstark = [f1;f2;r1;r2] let _ = print_endline ("Program:n" ^ (string_of_program pstark)) (* Define a goal (query): ?- ancestor(rickard, robb) The solution is the query itself. *) let g = [ancestor (const "rickard") (const "robb")] let _ = print_endline ("Goal:n" ^ (string_of_goal g)) let g' = nondet_query pstark g let _ = print_endline (" Solution :n" ^ (string_of_goal g')) let _ = assert (g' = [ancestor (const "rickard") (const "robb")])
  • 16. (* Define a goal (query): ?- ancestor(X, robb) The solution can be either ancestor(ned, robb) or ancestor(rickard, robb) *) let g = [ancestor (var "X") (const "robb")] let _ = print_endline ("Goal:n" ^ (string_of_goal g)) let g' = nondet_query pstark g let _ = print_endline ("