Skip to content

Instantly share code, notes, and snippets.

@nickcarenza
Last active February 25, 2019 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickcarenza/1d19100aff34d8bd7331094d5a8039ea to your computer and use it in GitHub Desktop.
Save nickcarenza/1d19100aff34d8bd7331094d5a8039ea to your computer and use it in GitHub Desktop.

Scope Intersection

Observations

Terms in an intersection operation are commutative.

	a ∩ b = b ∩ a

Terms in an intersection operation are associative.

	a ∩ (b ∩ c) = (a ∩ b) ∩ c

Duplicate terms cancel

	a ∩ a = a

If set a is contained in set b, the intersection of them is set a

Adjacent ** should cancel

	**.** = **

If you want to specify 2+

	*.**

Deconstruction

Break down complex scopes into components whose intersection is the original

	a.**.a => a.** ∩ **.a
	a.**.a.** => a.** ∩ **.a.**
	**.a.**.a => **.a.** ∩ **.a
  1. Decontruct

     (a.**.a.**) ∩ (**.a.**.a)
     = (a.** ∩ **.a.**) ∩ (**.a.** ∩ **.a)
    
  2. Deduplicate terms

     (a.** ∩ **.a.**) ∩ (**.a.** ∩ **.a)
     = (a.**) ∩ (**.a.**) ∩ (**.a)
    

Examples

	(a.a.**.**.**.a) ∩ (**.**.a.**.**)
	= 

	(a.**.a.**.a.**.a) ∩ (**.**.a.**.**)
	= 

	() ∩ ()
	= 

	() ∩ ()
	= 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment