SCG Example Labs Ahmed Abdelmeged Karl Lieberherr.

Slides:



Advertisements
Similar presentations
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Advertisements

Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Lecture 22: April 18 Probabilistic Method. Why Randomness? Probabilistic method: Proving the existence of an object satisfying certain properties without.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
Algorithms and Data Review Fall 2010 Karl Lieberherr 1CS 4800 Fall /7/2010.
Restricted Satisfiability (SAT) Problem
© Love Ekenberg The Algorithm Concept, Big O Notation, and Program Verification Love Ekenberg.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Lesson 6. Refinement of the Operator Model This page describes formally how we refine Figure 2.5 into a more detailed model so that we can connect it.
Restricted Satisfiability (SAT) Problem
Cardinality & Sorting Networks. Cardinality constraint Appears in many practical problems: scheduling, timetabling etc’. Also takes place in the Max-Sat.
T Ball (1 Relation) What Your Robots Do Karl Lieberherr CSU 670 Spring 2009.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Poster Design & Printing by Genigraphics ® The Scientific Community Game Education and Innovation Through Survival in a Virtual World of.
Formal Two Party Debates about Algorithmic Claims or How to Improve and Check your Homework Solutions Karl Lieberherr.
Software Development Developing a MAX-CSP Solver Karl Lieberherr.
The Scientific Community Game for STEM Innovation and Education (STEM: Science, Technology, Engineering and Mathematics) Karl Lieberherr Ahmed Abdelmeged.
MATH 224 – Discrete Mathematics
SDG Mittagsseminar1 Using Artificial Markets to Teach Computer Science Through Trading Robots How to get students interested in algorithms, combinatorial.
CSE314 Database Systems The Relational Algebra and Relational Calculus Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Software Development using artificial markets of constructively egoistic agents Karl Lieberherr 1SD-F09.
Sequences and Summations
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
UBC March The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in MAX-CSP Solving Karl J. Lieberherr Northeastern University.
The Scientific Community Game Education and Innovation Through Survival in a Virtual World of Claims Karl Lieberherr Northeastern University College of.
SCG layers or SCG stages Karl and Yue. Layers of Constraints We can look at the process of game design as a successive layering of constraints on a game.
MSD 2011 Midterm Karl Lieberherr 3/28/20111MSD midterm.
UBC March The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in MAX-CSP Solving Karl J. Lieberherr Northeastern University.
First-Order Logic and Inductive Logic Programming.
Operational Research & ManagementOperations Scheduling Economic Lot Scheduling 1.Summary Machine Scheduling 2.ELSP (one item, multiple items) 3.Arbitrary.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
Review of Propositional Logic Syntax
The Algorithms we use to learn about Algorithms Karl Lieberherr Ahmed Abdelmeged 3/16/20111Open House 2011.
Tommy Messelis * Stefaan Haspeslagh Patrick De Causmaecker *
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
1 First order theories (Chapter 1, Sections 1.4 – 1.5) From the slides for the book “Decision procedures” by D.Kroening and O.Strichman.
Planning as Satisfiability (SAT-Plan). SAT-Plan Translate the planning problem into a satisfiability problem for length n of Plan garb 0 (proposition)present.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Persistent Playgrounds Fall 2011 Managing Software Development 1/27/20161Persistent Playgrounds.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
HSR Help Karl Lieberherr 1/23/20111Asymptotic Growth.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
A Popperian Platform for Programming and Teaching the Global Brain Karl Lieberherr Ahmed Abdelmeged Northeastern University, CCIS, PRL, Boston 6/26/20161.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 04 : Logic.
Approximation algorithms
P & NP.
Richard Anderson Lecture 26 NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
The Scientific Community Game for STEM Innovation and Education
Hard Problems Introduction to NP
ARTIFICIAL INTELLIGENCE
(xy)(yz)(xz)(zy)
NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC
First-Order Logic and Inductive Logic Programming
SCG Court: A Crowdsourcing Platform for Innovation
ICS 353: Design and Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
SAT-Based Area Recovery in Technology Mapping
NP-Completeness Proofs
Richard Anderson Autumn 2006 Lecture 1
Dichotomies in CSP Karl Lieberherr inspired by the paper:
RAIK 283 Data Structures & Algorithms
Karl Lieberherr Ahmed Abdelmeged
The Satisfiability Problem
Presentation transcript:

SCG Example Labs Ahmed Abdelmeged Karl Lieberherr

Structures of SCG These examples are to be read with the SCG paper as background. The best way to represent Domain, Lab and Claim is to have Domain and Lab as top-level classes and Claim nested inside Lab. Lab has a Domain as field to give all claims access to Domain functionality. Instance and Solution are nested inside Domain.

Structures of SCG We use a Java-like syntax but the goal is to use only one or two lines per item for those simple introductory labs.

Domain Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG Lab d : Domain proto: Protocol Claim claim parameters isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim)

Calculus Lab Have your students mastered calculus (minimizing and maximizing functions)? The next lab shows a lab to test their skills.

Lab d: Domain proto: Protocol Claim claim parameters isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim) Domain Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG new SaddlePointLab.Claim(q=0.6) SaddlePoint Instance = [0,1] Solution = [0,1] valid(i,s) = true quality(i,s) = i*s + (1-i)*(1-s 2 ) SaddlePointLab SaddlePoint O:I[0], P:S[1] of I[0] SaddlePointLabClaim q: [0,1] isp(i)=true p(I,S)=d.quality(I[0],S[1])> =q stronger(c2) = q>c2.q distance(c2) = q-c2.q Example: calculus problem NEW

Programming an Algorithm Have your students understood the Gale- Shapley algorithm? Next come two labs where they can demonstrate their skills through their avatar in a full-round-robin tournament. – In the first lab they test each other’s programs to see whether they match each other’s best solution. – In the second lab, they find worst-case inputs.

Domain Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG new GSAtLeastAsGoodAsYouClaim() GaleShapleyBasic Instance = Preferences Solution = Assignment valid(i,s) = s is syntactically correct for i quality(i,s) = s is semantically correct for i 1 if true, 0 if false. GaleShapleyBasicLab GaleShapleyBasic O:I[0], P:S[1] of I[0], O:S[2] of I[0] GSAtLeastAsGoodAsYouClaim none isp(i)=true p(I,S)=d.quality(I[0],S[1])>=d.quality(I[0],S[2]) stronger(c2) = false distance(C2) = 0 Example: GS algorithm Lab d: Domain proto: Protocol Claim claim parameter definitions isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim)

Domain Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG GaleShapley (GS) Instance = Nat //number of people Solution = Preferences valid(i,s) = s is syntactically correct for i quality(i,s) = GS iterations for s and i GaleShapleyWorstCaseLab GaleShapley O:I[0], P:S[1] of I[0] GSWCLClaim n:Nat, q:Nat isp(i)=(i=n) //singleton p(I,S)=d.quality(I[0],S[1])>= q stronger(c2)=this.q>c2.q distance(c2)=this.q-c2.q Example: Worst-Case of GS algorithm Lab d: Domain proto: Protocol Claim claim parameters isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim) new GSWCLClaim(n=10,q=30)

Maximum Satisfiability The next lab is about a paper by David Johnson in the 1970’s which is covered now in some algorithm text books, like Kleinberg and Tardos. The following MaxSat lab covers several skills, such as working with randomized algorithms and then derandomizing them.

Domain Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG Satisfiability CNF Assignment valid(i,s) = all variables in i assigned once quality(i,s) = fraction of satisfied clauses in i MaxSatLab Satisfiability O:I[0], P:S[1] of S[0] MSLClaim q:[0,1], k:Nat (clause length) isp(i)=clauses in i have length >=k p(I,S)=d.quality(I[0],S[1])>=q stronger(c2)=q>c2.q distance(c2)=q-c2.q Example: MaxSat Lab d: Domain proto: Protocol Claim claim parameters isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim) new MSLClaim(q= 1-(1/2 3 ), k=3)

Generalized MaxSat The next lab is based on a paper by Lieberherr and Specker (2012).

Domain Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG BooleanCSP Sequence of Boolean constraints Assignment valid(i,s) = all variables in i assigned once quality(i,s) =fraction of sat. constraints in i BooleanMaxCSPLab BooleanCSP O:I[0], P:S[1] of I[0] GenBooleanMaxSatClaim q:[0,1], r:{R1,R2,…} isp(i)=constraints in i use only r p(I,S)=d.quality(I[0],S[1])>=q stronger(c2)=q>c2.q distance(c2)=q-c2.q Example: Boolean GeneralizedMaxSat = BMaxCSP Lab d: Domain proto: Protocol Claim claim parameters isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim) new GenBooleanMaxSatClaim( q=0.618, r={R1,R2})

Local to Global The next lab is based on several papers inspired by a JACM paper by Lieberherr and Specker in The lab is about studying how local properties of a conjunctive normal form translate into global properties.

Domain Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG BooleanCSP Sequence of Boolean constraints Assignment valid(i,s) = all variables in i assigned once quality(i,s) =fraction of sat. constraints in i BooleanMaxCSPLab BooleanCSP O:I[0], P:S[1] of I[0] BMCLClaim q:[0,1], r:{R1,R2,…}, k:Nat isp(i)=(constraints in i use only r) and (any k constraints in i are satisfiable) p(I,S)=d.quality(i[0],s[1])> =q stronger(c2)=q>c2.q distance(c2)=q-c2.q Example: BooleanMaxCSPLocalGlobal Lab d: Domain proto: Protocol Claim claim parameters isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim) new BMCLClaim( q=0.618, r={R1,R2,R3,R4}, k=2)

Manufacturing Lab The next lab is about an efficient manufacturing problem where raw materials are turned into a product. The lab is underspecified in that the details about the isp function are missing.

Domain Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG SolarCells RawMaterials Product valid(i,s) = only raw materials used quality(i,s) = energy efficiency of s for i SolarCellsLab SolarCells O:I[0], P:S[1] of I[0] SCLClaim q:[0,1], k:Nat (raw material parameter) isp(i)= … p(I,S)=d.quality(I[0],S[1])> q stronger(c2)=q>c2.q distance(c2)=q-c2.q Example: Solar Cells Lab d: Domain proto: Protocol Claim claim parameters isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim) new SCLClaim(q=0.7,k=3)

Sums of Arithmetic Sequences The next labs deal with skills needed to sum arithmetic sequences efficiently. We use the variables and notation introduced on the next slide.

expression in a,d,n using multiplication, addition and division. To simplify, replace (1+2+ … +n) by n*(n+1)/2.

Constructive / Proof only The first lab is constructive in that the solution is an expression which sums the arithmetic sequence efficiently. In the second lab, a specific expression is given and the lab only asks for an inductive proof. Key to the solution for the constructive lab is a reduced lab where the first n natural numbers are added. Formula is on previous slide.

Domain with name Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG ArithmeticSequences2 i=triple (a,d,n: Nat) expression in variables a,d,n valid(i,s) = s uses +,*,/ and vars in i quality(i,s) = 1 if s is correct for i, 0 otherwise Example: Arithmetic Sequences Sum Lab d: Domain proto: Protocol Claim claim parameters isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim) ArithmeticSequencesSumLab ArithmeticSequences2 O:I[0], P:S[1] of I[0], O:S[2] of I[0] ASeqSumALAGAYLClaim i1:Instance isp(i)=(i=i1) p(I,S)=d.quality(I[0],S[1])>=d.quality(I[0],S[2]) stronger(c2)=false distance(c2)=0 new ASeqSumLClaim((a=2,d=3,n=100000))

Domain with name Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG new ASLClaim(sum[k=1..n] 2+3k = 2n+3(n(n+1))/2) ArithmeticSequencesInduction sum[k=1..n] 2+3k = 2n+3(n(n+1))/2 sequence of steps: induction proof valid(i,s) = proof s is syntactically correct quality(i,s) = 1 iff proof is correct ArithmeticSequencesInductionLab ArithmeticSequencesInduction O:I[0], P:S[1] of I[0] ASLClaim i1:Instance isp(i)=(i=i1) //singleton p(I,S)=d.quality(I[0],S[1])=1 stronger(c2)=false distance(c2)=0 Example: Arithmetic Sequences Sum Lab d: Domain proto: Protocol Claim claim parameters isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim)

Highest Safe Rung This is a fun lab which can be formulated in many different ways. Inspired by Kleinberg and Tardos’ Algorithm Design book.

Domain with name Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG HighestSafeRung pair(n,k) decision tree valid(i,s) = s is correct for (n,k) quality(i,s) = depth(s) HighestSafeRungLab HighestSafeRung O:I[0], P:S[1] of I[0] HSRClaim n:Nat,k:Nat,q:Nat isp(i)=(i=(n,k)) // singleton {(n,k)} p(I,S)=d.quality(I[0],S[1])<=q stronger(c2)=q<c2.q distance(c2)=q-c2.q Example: HighestSafeRung lower quality is better Lab d: Domain proto: Protocol Claim claim parameters isp(i:d.Instance) p(I:d.Instance[],S:d.Solution[]) stronger(c2: Claim) distance(c2: Claim) new HSRClaim(n=25,k=2,q=5)

Domain with name Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG LeafCovering Set of trees. Set M=subset of GCP of trees. witness (leaf in GCP) of non-coverage by M valid(i,s) = s is correct for i quality(i,s) = unused Example: LeafCovering Lab with name d: Domain claim parameter definitions instance set predicate refutation predicate protocol stronger(c1,c2: Claim) distance(c1,c2: Claim) Claim with name proponent: Scholar lab : Lab claim parameter values

Domain with name Instance Solution valid(i: Instance, s: Solution) quality(i: Instance, s: Solution) Structures of SCG HSRClaim( Alice, HighestSafeRungLab, 25,2,5) LeafCovering LeafCoveringProblem : Set of trees. Set M=subset of GCP of trees. witness (leaf in GCP) of non-coverage by M Program valid(i,s) = s is correct for i quality(i,s) = unused LeafCoveringLab LeafCovering m: Nat (size of M) instanceSetP(i,m)= |i.M|=m quality(i[0],s[1])<=q O:i[0], P:s[1] of s[0] c1.q>c2.q c1.q-c2.q Example: LeafCovering Lab with name d: Domain claim parameter definitions instance set predicate refutation predicate protocol stronger(c1,c2: Claim) distance(c1,c2: Claim) Claim with name proponent: Scholar lab : Lab claim parameter values

O not per P not per

SCG Truth Table Interpretation no competition: P 0 and O 0 everywhere not fair: the player different from the “not perfect” player loses a point

claimdecoutPOcBaBoBBlame Justification F *asO00PO- Ta F *dsP1P-OO did not refute a claim it disputed TdsP1-OO FarP1POOO failed to support a claim it agreed with T *arP1--O FdrO1P-PP failed to support a claim it proposed T *drO1-OP

claimdecoutPOcBaBoBBlame Justification F *asOpasooasoPO- TasO--- F *dsPpdspodspP-OO did not refute a claim it disputed TdsP-OO FarPparpoarpPOOO failed to support a claim it agreed with T *arP--O FdrOpdroodroP-PP failed to support a claim it proposed T *drO-OP