anchor.diff:                          |> Option.defaultValue prevConstraints
                   )
   
  -        let intersectConstraints constraints otherConstraints =
  -            invalidOp "Not Implemented"
  +        let intersectConstraints (constraints: Dictionary<Variable, HashSet<Variable> * HashSet<Literal>>) (otherConstraints: Dictionary<Variable, HashSet<Variable> * HashSet<Literal>>) =
  +            constraints.Keys
  +            |> Seq.choose (
  +                fun variable ->
  +                    match otherConstraints.TryGetValue variable with
  +                    | true, (otherVarRestriction, otherLitRestriction) ->
  +                        let (varRestriction, litRestriction) = constraints.[variable]
  +                        let updatedVarRestriction = HashSet<Variable>(varRestriction)
  +                        updatedVarRestriction.IntersectWith otherVarRestriction
  +                        let updatedLitRestriction = HashSet<Literal>(litRestriction)
  +                        updatedLitRestriction.IntersectWith otherLitRestriction
  +                        (variable, (updatedVarRestriction, updatedLitRestriction)) |> Some
  +                    | false, _ ->
  +                        None
  +            )
  +            |> fun x -> Dictionary<_,_>(x |> dict)
   
           let rec buildEqualityConstraints equalityConstraints = function
               | [] ->
  
positive.code:             )
      )
  
  let private processJoin (typeIndexer: TypeIndexer) (leftJoinCondition: SparqlCondition option) (left: BoundCalculusModel) (right: BoundCalculusModel) =
      let isLeftJoin = leftJoinCondition.IsSome
  
      let leftValueBinders = left.Bindings
  
negative.code:             |> Map.union (oneSideValueBinders onlyRightVariables conditionedRightValueBinders)
              |> Map.union procSharedValueBinders
  
          let updatedAssignments =
              procRightModel.Assignments
              |> List.map (
                  fun x ->
                      { x with
                          Expression =
                              {
                                  Condition = conditionToAdd
                                  Expression = x.Expression
                              }
                              |> List.singleton
                              |> Switch
                              |> optimizeRelationalExpression
                      }
              )
  
          {
              Model = 
                  { leftModel with
                      Assignments =
                          leftModel.Assignments @ updatedAssignments
                      Sources =
                          if procRightModel.Sources |> List.isEmpty then
                              leftModel.Sources
                          else
                              leftModel.Sources @ [
                                  LeftOuterJoinModel(
                                      { procRightModel with
                                          Assignments =
                                              match extraAssignment with
                                              | Some a -> a |> List.singleton
                                              | None -> List.empty
                                          Filters = List.empty
                                      },
                                      processedLeftJoinCondition
                                  )
                              ]
                  }
                  |> NotModified
                  |> optimizeCalculusModel
              Bindings = newValueBinders
              Variables = newValueBinders |> Map.keys |> List.ofSeq
          }
      else
          let conditionProc =
              joinConditions
  