Computes the LBD for a given vector of literals.
@param lits the vector of literals
@param e    parameter for incremental mode
@return the LBD
182003
private long computeLBD(final LNGIntVector lits, int e) {
    int end = e;
    long nblevels = 0;
    myflag++;
    if (incremental) {
      if (end == -1)
        end = lits.size();
      long nbDone = 0;
      for (int i = 0; i < lits.size(); i++) {
        if (nbDone >= end)
          break;
        if (isSelector(var(lits.get(i))))
          continue;
        nbDone++;
        int l = v(lits.get(i)).level();
        if (permDiff.get(l) != myflag) {
          permDiff.set(l, myflag);
          nblevels++;
        }
      }
    } else {
      for (int i = 0; i < lits.size(); i++) {
        int l = v(lits.get(i)).level();
        if (permDiff.get(l) != myflag) {
          permDiff.set(l, myflag);
          nblevels++;
        }
      }
    }
    if (!reduceOnSize)
      return nblevels;
    if (lits.size() < reduceOnSizeSize)
      return lits.size();
    return lits.size() + nblevels;
  }
1022495
@SuppressWarnings("static-method")
	protected XExpression _generate(XStringLiteral literal, IAppendable it, IExtraLanguageGeneratorContext context) {
		appendReturnIfExpectedReturnedExpression(it, context);
		it.append("u\"").append(Strings.convertToJavaString(literal.getValue())).append("\""); //$NON-NLS-1$//$NON-NLS-2$
		return literal;
	}
802041
public C4Document update(byte[] body, int flags) throws LiteCoreException {
        return new C4Document(update(handle, body, flags));
    }
1306606
private boolean isRotatable(final int lit) {
        // Unit propagated literals cannot be rotatable
        if (v(var(lit)).reason() != null) {
            return false;
        }
        // A rotatable literal MUST NOT be unit
        for (final MSWatcher watcher : this.watches.get(not(lit))) {
            if (isUnit(lit, watcher.clause())) {
                return false;
            }
        }
        return true;
    }
1299222
protected AIntLiteralExp getIntLiteral(long i)
	{
		AIntLiteralExp number = new AIntLiteralExp();
		ILexIntegerToken literal = new LexIntegerToken(i, null);
		number.setValue(literal);
		return number;
	}
564634
public boolean add(E e) {
        typeCheck(e);

        long oldElements = elements;
        elements |= (1L << ((Enum<?>)e).ordinal());
        return elements != oldElements;
    }
1369815
protected void bumpLit(final int lit) {
        final double maxPriority = 1e300;
        final int idx = Math.abs(lit);
        double oldPriority;
        if (this.scoreIncrement > maxPriority || (oldPriority = this.decisions.priority(idx)) > maxPriority) {
            rescore();
            oldPriority = this.decisions.priority(idx);
        }
        final double newPriority = oldPriority + this.scoreIncrement;
        this.decisions.update(idx, newPriority);
    }
1171708
public final EObject ruleXSetLiteral() throws RecognitionException {
        EObject current = null;

        Token otherlv_1=null;
        Token otherlv_2=null;
        Token otherlv_4=null;
        Token otherlv_6=null;
        EObject lv_elements_3_0 = null;

        EObject lv_elements_5_0 = null;



        	enterRule();

        try {
            // InternalPureXbase.g:2997:2: ( ( () otherlv_1= '#' otherlv_2= '{' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= '}' ) )
            // InternalPureXbase.g:2998:2: ( () otherlv_1= '#' otherlv_2= '{' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= '}' )
            {
            // InternalPureXbase.g:2998:2: ( () otherlv_1= '#' otherlv_2= '{' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= '}' )
            // InternalPureXbase.g:2999:3: () otherlv_1= '#' otherlv_2= '{' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= '}'
            {
            // InternalPureXbase.g:2999:3: ()
            // InternalPureXbase.g:3000:4: 
            {
            if ( state.backtracking==0 ) {

              				current = forceCreateModelElement(
              					grammarAccess.getXSetLiteralAccess().getXSetLiteralAction_0(),
              					current);
              			
            }

            }

            otherlv_1=(Token)match(input,58,FOLLOW_40); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			newLeafNode(otherlv_1, grammarAccess.getXSetLiteralAccess().getNumberSignKeyword_1());
              		
            }
            otherlv_2=(Token)match(input,59,FOLLOW_41); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			newLeafNode(otherlv_2, grammarAccess.getXSetLiteralAccess().getLeftCurlyBracketKeyword_2());
              		
            }
            // InternalPureXbase.g:3014:3: ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )?
            int alt54=2;
            int LA54_0 = input.LA(1);

            if ( ((LA54_0>=RULE_STRING && LA54_0<=RULE_ID)||(LA54_0>=14 && LA54_0<=15)||LA54_0==28||(LA54_0>=44 && LA54_0<=45)||LA54_0==50||(LA54_0>=58 && LA54_0<=59)||LA54_0==61||LA54_0==64||LA54_0==66||(LA54_0>=69 && LA54_0<=80)) ) {
                alt54=1;
            }
            switch (alt54) {
                case 1 :
                    // InternalPureXbase.g:3015:4: ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )*
                    {
                    // InternalPureXbase.g:3015:4: ( (lv_elements_3_0= ruleXExpression ) )
                    // InternalPureXbase.g:3016:5: (lv_elements_3_0= ruleXExpression )
                    {
                    // InternalPureXbase.g:3016:5: (lv_elements_3_0= ruleXExpression )
                    // InternalPureXbase.g:3017:6: lv_elements_3_0= ruleXExpression
                    {
                    if ( state.backtracking==0 ) {

                      						newCompositeNode(grammarAccess.getXSetLiteralAccess().getElementsXExpressionParserRuleCall_3_0_0());
                      					
                    }
                    pushFollow(FOLLOW_42);
                    lv_elements_3_0=ruleXExpression();

                    state._fsp--;
                    if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      						if (current==null) {
                      							current = createModelElementForParent(grammarAccess.getXSetLiteralRule());
                      						}
                      						add(
                      							current,
                      							"elements",
                      							lv_elements_3_0,
                      							"org.eclipse.xtext.xbase.Xbase.XExpression");
                      						afterParserOrEnumRuleCall();
                      					
                    }

                    }


                    }

                    // InternalPureXbase.g:3034:4: (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )*
                    loop53:
                    do {
                        int alt53=2;
                        int LA53_0 = input.LA(1);

                        if ( (LA53_0==57) ) {
                            alt53=1;
                        }


                        switch (alt53) {
                    	case 1 :
                    	    // InternalPureXbase.g:3035:5: otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) )
                    	    {
                    	    otherlv_4=(Token)match(input,57,FOLLOW_3); if (state.failed) return current;
                    	    if ( state.backtracking==0 ) {

                    	      					newLeafNode(otherlv_4, grammarAccess.getXSetLiteralAccess().getCommaKeyword_3_1_0());
                    	      				
                    	    }
                    	    // InternalPureXbase.g:3039:5: ( (lv_elements_5_0= ruleXExpression ) )
                    	    // InternalPureXbase.g:3040:6: (lv_elements_5_0= ruleXExpression )
                    	    {
                    	    // InternalPureXbase.g:3040:6: (lv_elements_5_0= ruleXExpression )
                    	    // InternalPureXbase.g:3041:7: lv_elements_5_0= ruleXExpression
                    	    {
                    	    if ( state.backtracking==0 ) {

                    	      							newCompositeNode(grammarAccess.getXSetLiteralAccess().getElementsXExpressionParserRuleCall_3_1_1_0());
                    	      						
                    	    }
                    	    pushFollow(FOLLOW_42);
                    	    lv_elements_5_0=ruleXExpression();

                    	    state._fsp--;
                    	    if (state.failed) return current;
                    	    if ( state.backtracking==0 ) {

                    	      							if (current==null) {
                    	      								current = createModelElementForParent(grammarAccess.getXSetLiteralRule());
                    	      							}
                    	      							add(
                    	      								current,
                    	      								"elements",
                    	      								lv_elements_5_0,
                    	      								"org.eclipse.xtext.xbase.Xbase.XExpression");
                    	      							afterParserOrEnumRuleCall();
                    	      						
                    	    }

                    	    }


                    	    }


                    	    }
                    	    break;

                    	default :
                    	    break loop53;
                        }
                    } while (true);


                    }
                    break;

            }

            otherlv_6=(Token)match(input,60,FOLLOW_2); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			newLeafNode(otherlv_6, grammarAccess.getXSetLiteralAccess().getRightCurlyBracketKeyword_4());
              		
            }

            }


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
527444
protected CLVar var(final int lit) {
        final int idx = Math.abs(lit);
        assert 0 < idx && idx < this.vars.size();
        return this.vars.get(idx);
    }
39155
private void addBackboneLiteral(final int lit) {
        this.backboneMap.put(var(lit), sign(lit) ? Tristate.FALSE : Tristate.TRUE);
        this.assumptions.push(lit);
    }
402061
def expect_lit(char, buf, pos):
    """"""
    if pos >= len(buf) or buf[pos] != char:
        return None, len(buf)
    return char, pos+1
918253
def get_lb(self):
        """"""

        cell_left = CellBorders(self.cell_attributes,
                                *self.cell.get_left_key_rect())
        return cell_left.get_b()
47085
public LongToken visitLong(EditsElement e) throws IOException {
    return (LongToken)visit(tokenizer.read(new LongToken(e)));
  }
1105279
public static Object toData(Literal lit) {
    if (lit == null) throw new IllegalArgumentException("Can't convert null literal");
    if (lit instanceof TypedLiteral) return toData((TypedLiteral)lit);
    // Untyped literals are xsd:string
    // Note this isn't strictly correct; language tags will be lost here.
    return lit.getLexical();
  }
380605
public static int ravelIndex(int[] indices, int[] dims) {
        int c = 0;
        int[] strides = getStrides(dims);
        for (int i=0; i<indices.length; i++) {
            c += strides[i] * indices[i];
        }
        return c;
    }
866321
private void encodeNonRecursive(final LNGVector<Literal> literals) {
    if (literals.size() > 1)
      for (int i = 0; i < literals.size(); i++)
        for (int j = i + 1; j < literals.size(); j++)
          this.result.addClause(literals.get(i).negate(), literals.get(j).negate());
  }
702069
public final EObject ruleXListLiteral() throws RecognitionException {
        EObject current = null;

        Token otherlv_1=null;
        Token otherlv_2=null;
        Token otherlv_4=null;
        Token otherlv_6=null;
        EObject lv_elements_3_0 = null;

        EObject lv_elements_5_0 = null;



        	enterRule();

        try {
            // InternalSARL.g:13869:2: ( ( () otherlv_1= '#' otherlv_2= '[' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= ']' ) )
            // InternalSARL.g:13870:2: ( () otherlv_1= '#' otherlv_2= '[' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= ']' )
            {
            // InternalSARL.g:13870:2: ( () otherlv_1= '#' otherlv_2= '[' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= ']' )
            // InternalSARL.g:13871:3: () otherlv_1= '#' otherlv_2= '[' ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )? otherlv_6= ']'
            {
            // InternalSARL.g:13871:3: ()
            // InternalSARL.g:13872:4: 
            {
            if ( state.backtracking==0 ) {

              				current = forceCreateModelElement(
              					grammarAccess.getXListLiteralAccess().getXListLiteralAction_0(),
              					current);
              			
            }

            }

            otherlv_1=(Token)match(input,106,FOLLOW_90); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			newLeafNode(otherlv_1, grammarAccess.getXListLiteralAccess().getNumberSignKeyword_1());
              		
            }
            otherlv_2=(Token)match(input,55,FOLLOW_132); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			newLeafNode(otherlv_2, grammarAccess.getXListLiteralAccess().getLeftSquareBracketKeyword_2());
              		
            }
            // InternalSARL.g:13886:3: ( ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )* )?
            int alt330=2;
            int LA330_0 = input.LA(1);

            if ( ((LA330_0>=RULE_STRING && LA330_0<=RULE_RICH_TEXT_START)||(LA330_0>=RULE_HEX && LA330_0<=RULE_DECIMAL)||LA330_0==25||(LA330_0>=28 && LA330_0<=29)||LA330_0==36||(LA330_0>=39 && LA330_0<=40)||(LA330_0>=42 && LA330_0<=45)||(LA330_0>=48 && LA330_0<=49)||LA330_0==51||LA330_0==55||(LA330_0>=60 && LA330_0<=63)||(LA330_0>=67 && LA330_0<=68)||(LA330_0>=73 && LA330_0<=75)||(LA330_0>=78 && LA330_0<=96)||LA330_0==106||LA330_0==129||(LA330_0>=131 && LA330_0<=140)) ) {
                alt330=1;
            }
            switch (alt330) {
                case 1 :
                    // InternalSARL.g:13887:4: ( (lv_elements_3_0= ruleXExpression ) ) (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )*
                    {
                    // InternalSARL.g:13887:4: ( (lv_elements_3_0= ruleXExpression ) )
                    // InternalSARL.g:13888:5: (lv_elements_3_0= ruleXExpression )
                    {
                    // InternalSARL.g:13888:5: (lv_elements_3_0= ruleXExpression )
                    // InternalSARL.g:13889:6: lv_elements_3_0= ruleXExpression
                    {
                    if ( state.backtracking==0 ) {

                      						newCompositeNode(grammarAccess.getXListLiteralAccess().getElementsXExpressionParserRuleCall_3_0_0());
                      					
                    }
                    pushFollow(FOLLOW_111);
                    lv_elements_3_0=ruleXExpression();

                    state._fsp--;
                    if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      						if (current==null) {
                      							current = createModelElementForParent(grammarAccess.getXListLiteralRule());
                      						}
                      						add(
                      							current,
                      							"elements",
                      							lv_elements_3_0,
                      							"org.eclipse.xtext.xbase.Xbase.XExpression");
                      						afterParserOrEnumRuleCall();
                      					
                    }

                    }


                    }

                    // InternalSARL.g:13906:4: (otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) ) )*
                    loop329:
                    do {
                        int alt329=2;
                        int LA329_0 = input.LA(1);

                        if ( (LA329_0==32) ) {
                            alt329=1;
                        }


                        switch (alt329) {
                    	case 1 :
                    	    // InternalSARL.g:13907:5: otherlv_4= ',' ( (lv_elements_5_0= ruleXExpression ) )
                    	    {
                    	    otherlv_4=(Token)match(input,32,FOLLOW_45); if (state.failed) return current;
                    	    if ( state.backtracking==0 ) {

                    	      					newLeafNode(otherlv_4, grammarAccess.getXListLiteralAccess().getCommaKeyword_3_1_0());
                    	      				
                    	    }
                    	    // InternalSARL.g:13911:5: ( (lv_elements_5_0= ruleXExpression ) )
                    	    // InternalSARL.g:13912:6: (lv_elements_5_0= ruleXExpression )
                    	    {
                    	    // InternalSARL.g:13912:6: (lv_elements_5_0= ruleXExpression )
                    	    // InternalSARL.g:13913:7: lv_elements_5_0= ruleXExpression
                    	    {
                    	    if ( state.backtracking==0 ) {

                    	      							newCompositeNode(grammarAccess.getXListLiteralAccess().getElementsXExpressionParserRuleCall_3_1_1_0());
                    	      						
                    	    }
                    	    pushFollow(FOLLOW_111);
                    	    lv_elements_5_0=ruleXExpression();

                    	    state._fsp--;
                    	    if (state.failed) return current;
                    	    if ( state.backtracking==0 ) {

                    	      							if (current==null) {
                    	      								current = createModelElementForParent(grammarAccess.getXListLiteralRule());
                    	      							}
                    	      							add(
                    	      								current,
                    	      								"elements",
                    	      								lv_elements_5_0,
                    	      								"org.eclipse.xtext.xbase.Xbase.XExpression");
                    	      							afterParserOrEnumRuleCall();
                    	      						
                    	    }

                    	    }


                    	    }


                    	    }
                    	    break;

                    	default :
                    	    break loop329;
                        }
                    } while (true);


                    }
                    break;

            }

            otherlv_6=(Token)match(input,56,FOLLOW_2); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			newLeafNode(otherlv_6, grammarAccess.getXListLiteralAccess().getRightSquareBracketKeyword_4());
              		
            }

            }


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }