This document discusses mutually recursive data definitions and how they require mutually recursive functions. It provides an example of a mutually recursive data definition for lists of strings (LoSS) and single strings (SoS). It then gives a template for writing mutually recursive functions to operate on these types, and implements the occurs-in? function to check if a string is contained within a LoSS or SoS by using mutual recursion between the occurs-in? and occurs-in-loss? functions. Finally, it suggests some additional "finger exercises" to further practice with these concepts.
Lesson 03 Arbitrarily Recursive Data DefinitionsMitchell Wand
This document discusses mutually recursive data definitions and how they lead to mutual recursion in templates and code. It provides examples of binary trees and ancestor trees, showing how the recursive data definitions require pairs of mutually recursive functions. Tests for recursive functions are also discussed, emphasizing the need to consider how a program could pass tests but still be incorrect, or fail tests but still be correct.
This document discusses different approaches to determining the species of birds from observation data. It presents an example problem of taking bird observations with beak, wing, and belly attributes and determining the species. It then compares using a "truth table" approach with nested conditionals versus a "decision tree" approach, where tests are ordered to narrow down options. The decision tree is generally shorter and more efficient but requires more upfront thinking about test ordering. Thorough testing is emphasized to validate the determination logic works as intended.
Google glass ppt, research with the help of questionnaireaditigoel512
Google Glass is an optical head-mounted display developed by Google that allows users to access the internet and interact with digital content hands-free. It has features like a camera, microphone, touchpad, Bluetooth and WiFi connectivity. A survey was conducted to understand consumer behavior and perceptions towards Google Glass, with questions about demographics, technology usage, purchase considerations, awareness of Glass, and likelihood to buy Glass.
The document provides an overview of glass, including its composition, properties, types, and the manufacturing process. Glass is made primarily from sand, soda ash, and limestone, which are melted together at high temperatures. It has properties such as being hard, transparent, and inert. Common types include soda-lime glass, lead glass, and borosilicate glass. Glass manufacturing involves batch preparation, melting in furnaces, forming, and packaging.
Glass can be produced through float glass processes or glassblowing. Float glass involves floating molten glass on molten tin to produce uniform, flat sheets for modern windows. Glassblowing makes bottles and containers. There are several types of glass like float glass, laminated safety glass, stained glass, tinted glass, and toughened glass. Glass has advantages like various sizes, colors, and being waterproof and rustproof but has disadvantages as it breaks easily and melts at high temperatures. Glass has many applications in buildings as windows, walls, and interior uses due to its light transmission properties.
Micronisers developed Nanokote coatings to provide easy cleaning and protection for glass surfaces like shower screens. Nanokote coatings use nanotechnology to create a durable hydrophobic surface that causes water and other liquids to bead up and run off, keeping surfaces cleaner for longer. The invisible Nanokote coating is scratch resistant and lasts up to 10 years, reducing cleaning needs by 90% and saving water, time and cleaning chemicals.
There are 12 main types of glasses used in construction including laminated glass, toughened glass, fusion glass, mirrors, etched glass, float glass, stained glass, beveled glass, figured glass, cast glass, frameless doors, and tinted glass. Each type has distinct properties like safety qualities, strength, clarity, coloration, or artistic effects. Laminated glass uses an interlayer to stay intact rather than shatter into sharp pieces when broken. Toughened glass similarly breaks into small cubes rather than shards.
Glass is produced by heating silica, lime, and soda or potash to over 10000C. Other ingredients like iron oxide and lead oxide are added to modify properties. Glass consists mainly of silica which is made fusible by alkaline mixtures. Potash makes glass infusible while soda accelerates fusion. Lime provides durability and toughness. Lead oxide adds color. Glass is classified as soda lime, lead, or boro-silicate based on composition. Special forms include sheet, plate, colored, wired, structural, laminated, bulletproof, fiber, foam, and flint glass. Glass has properties like shine, stability, insulation, and transparency and is used widely in construction, decoration, insulation,
Lesson 03 Arbitrarily Recursive Data DefinitionsMitchell Wand
This document discusses mutually recursive data definitions and how they lead to mutual recursion in templates and code. It provides examples of binary trees and ancestor trees, showing how the recursive data definitions require pairs of mutually recursive functions. Tests for recursive functions are also discussed, emphasizing the need to consider how a program could pass tests but still be incorrect, or fail tests but still be correct.
This document discusses different approaches to determining the species of birds from observation data. It presents an example problem of taking bird observations with beak, wing, and belly attributes and determining the species. It then compares using a "truth table" approach with nested conditionals versus a "decision tree" approach, where tests are ordered to narrow down options. The decision tree is generally shorter and more efficient but requires more upfront thinking about test ordering. Thorough testing is emphasized to validate the determination logic works as intended.
Google glass ppt, research with the help of questionnaireaditigoel512
Google Glass is an optical head-mounted display developed by Google that allows users to access the internet and interact with digital content hands-free. It has features like a camera, microphone, touchpad, Bluetooth and WiFi connectivity. A survey was conducted to understand consumer behavior and perceptions towards Google Glass, with questions about demographics, technology usage, purchase considerations, awareness of Glass, and likelihood to buy Glass.
The document provides an overview of glass, including its composition, properties, types, and the manufacturing process. Glass is made primarily from sand, soda ash, and limestone, which are melted together at high temperatures. It has properties such as being hard, transparent, and inert. Common types include soda-lime glass, lead glass, and borosilicate glass. Glass manufacturing involves batch preparation, melting in furnaces, forming, and packaging.
Glass can be produced through float glass processes or glassblowing. Float glass involves floating molten glass on molten tin to produce uniform, flat sheets for modern windows. Glassblowing makes bottles and containers. There are several types of glass like float glass, laminated safety glass, stained glass, tinted glass, and toughened glass. Glass has advantages like various sizes, colors, and being waterproof and rustproof but has disadvantages as it breaks easily and melts at high temperatures. Glass has many applications in buildings as windows, walls, and interior uses due to its light transmission properties.
Micronisers developed Nanokote coatings to provide easy cleaning and protection for glass surfaces like shower screens. Nanokote coatings use nanotechnology to create a durable hydrophobic surface that causes water and other liquids to bead up and run off, keeping surfaces cleaner for longer. The invisible Nanokote coating is scratch resistant and lasts up to 10 years, reducing cleaning needs by 90% and saving water, time and cleaning chemicals.
There are 12 main types of glasses used in construction including laminated glass, toughened glass, fusion glass, mirrors, etched glass, float glass, stained glass, beveled glass, figured glass, cast glass, frameless doors, and tinted glass. Each type has distinct properties like safety qualities, strength, clarity, coloration, or artistic effects. Laminated glass uses an interlayer to stay intact rather than shatter into sharp pieces when broken. Toughened glass similarly breaks into small cubes rather than shards.
Glass is produced by heating silica, lime, and soda or potash to over 10000C. Other ingredients like iron oxide and lead oxide are added to modify properties. Glass consists mainly of silica which is made fusible by alkaline mixtures. Potash makes glass infusible while soda accelerates fusion. Lime provides durability and toughness. Lead oxide adds color. Glass is classified as soda lime, lead, or boro-silicate based on composition. Special forms include sheet, plate, colored, wired, structural, laminated, bulletproof, fiber, foam, and flint glass. Glass has properties like shine, stability, insulation, and transparency and is used widely in construction, decoration, insulation,
There are a lot of operators in Perl 6, so many that it can be called an OOL: operator oriented language. Here I describe most of them from the angle of contexts, which Perl 6 has also much more than Perl 5.
The document describes a WordFilter class that can detect and censor sensitive words in strings. It allows specifying words to censor, and will replace matches with <censored> in the censor method output or return true/false from the detect method. The filter is designed to find and obscure matches without disturbing surrounding context.
Using Regular Expressions and Staying SaneCarl Brown
Presentation I gave to the local http://www.cocoacoder.org/ meeting on using Regular Expression in Cocoa code (although much of it applies to other languages as well).
The document discusses re-inventing query languages, describing tisql as a string-centric query language for Jifty::DBI that allows specifying relations between records and columns without joins. It also covers combining query conditions, different query language features from other systems, and potential advanced features for tisql like subset extraction and boolean logic parsing.
PHP arrays allow storing multiple values in a single variable. There are several types of arrays including numeric, associative, multidimensional, and mixed. Arrays can be created using the array() function or by directly assigning values with indexes. Array elements can be accessed using their index/key and printed. Common array functions include array_merge() to join arrays, array_push() to add elements, and sort functions like sort(), asort(), ksort() to sort arrays.
The document provides an introduction to the CLIPS expert system shell. It discusses CLIPS' components like facts, rules, and the inference engine. It explains how CLIPS uses forward chaining to match facts to rules and fire actions. The objectives are to understand rule-based expert system concepts and apply them using CLIPS.
There are a lot of operators in Perl 6, so many that it can be called an OOL: operator oriented language. Here I describe most of them from the angle of contexts, which Perl 6 has also much more than Perl 5.
The document describes a WordFilter class that can detect and censor sensitive words in strings. It allows specifying words to censor, and will replace matches with <censored> in the censor method output or return true/false from the detect method. The filter is designed to find and obscure matches without disturbing surrounding context.
Using Regular Expressions and Staying SaneCarl Brown
Presentation I gave to the local http://www.cocoacoder.org/ meeting on using Regular Expression in Cocoa code (although much of it applies to other languages as well).
The document discusses re-inventing query languages, describing tisql as a string-centric query language for Jifty::DBI that allows specifying relations between records and columns without joins. It also covers combining query conditions, different query language features from other systems, and potential advanced features for tisql like subset extraction and boolean logic parsing.
PHP arrays allow storing multiple values in a single variable. There are several types of arrays including numeric, associative, multidimensional, and mixed. Arrays can be created using the array() function or by directly assigning values with indexes. Array elements can be accessed using their index/key and printed. Common array functions include array_merge() to join arrays, array_push() to add elements, and sort functions like sort(), asort(), ksort() to sort arrays.
The document provides an introduction to the CLIPS expert system shell. It discusses CLIPS' components like facts, rules, and the inference engine. It explains how CLIPS uses forward chaining to match facts to rules and fire actions. The objectives are to understand rule-based expert system concepts and apply them using CLIPS.
1. Lists of Lists of Lists of ... CS 5010 Program Design Paradigms “Bootcamp” Week 03, Lesson 4 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA 1
2. Lists of Lists of ... strings "alice" "bob" "carole" ("alice" "bob") (("alice" "bob") "carole") ("alice" (("alice" "bob") "dave") "eve")
3. Data Definition An S-expression of Strings (SoS) is either -- a String -- a List of SoS's A List of SoS's (LoSS) is either -- empty -- (cons SoSLoSS)
4. This is mutual recursion SoSLoSS defined in terms of defined in terms of
5. Mutually Recursive Data Definitions One task, one function So: one function per data definition Here, functions come in pairs Write the contracts and purpose statements together, or Write one, and the other one will appear as a wishlist function
7. occurs-in? ;; occurs-in? : Sos String -> Boolean ;; returns true if the given string occurs somewhere in the given sos. ;; occurs-in-loss? : Loss String -> Boolean ;; returns true if the given string occurs somewhere in the given loss.
8. Examples/Tests (check-expect (occurs-in? "alice" "alice") true) (check-expect (occurs-in? "bob" "alice") false) (check-expect (occurs-in? (list "alice" "bob") "cathy") false) (check-expect (occurs-in? (list (list "alice" "bob") "carole") "bob") true) (check-expect (occurs-in? (list "alice" (list (list "alice" "bob") "dave") "eve") "bob") true) See book re list vs. cons
10. Finger Exercises ;; number-of-strings : Sos -> Number ;; number-of-strings-in-loss : Loss -> Number ;; returns the number of strings in the given sos or loss. ;; characters-in : Sos -> Number ;; characters-in-loss : Loss -> Number ;; returns the total number of characters in the strings in the given sos or loss.
11. Summary Trees of structures occur all the time Mutually recursive data definitions Mutual recursion in the data definition leads to mutual recursion in the template Mutual recursion in the template leads to mutual recursion in the code Study the tests: always ask: how could a program pass the tests and still be wrong? always ask: how could a program fail the tests and still be correct?
Editor's Notes
Welcome to Week 3, Lesson 4: Arbitrarily Nested ListsSo far we've dealt with structures, structures with lists in them, and lists of structures.Now let's look at lists of lists.