Questions tagged [quantifiers]

In logic, quantification is the binding of a variable ranging over a domain. The variable thereby becomes bound by an operator called a quantifier.

In logic, quantification is the binding of a variable ranging over a domain. The variable thereby becomes bound by an operator called a quantifier.

The two fundamental kinds of quantification in predicate logic are universal quantification and existential quantification.

233 questions
0
votes
1 answer

Regex: How to make range to match minimum possible length?

Regex: [0-9]{6-8}([0-9]{4}) Test Strings: sfad 123456781234 afd sadfa fdads sfd 12345671234 24312 fasdfa dsfafd 221 1234561234 safd safd23 34 Expected: I need the end part 1234 captured in a group on each line. Actual: No matches. :( I would like…
San
  • 3,933
  • 7
  • 34
  • 43
0
votes
1 answer

How to use user input as an Quantifier in Regex in JS?

My attempt was : var re = new RegExp("\w{" + n + "}", "g"); But it didn't seems to work. P.S. - I have searched several questions of Stackoverflow thinking it must have been asked before But I didn't find one, so I asked my question.
0
votes
1 answer

z3py: What is a correct way of asserting a constraint of "something does not exist"

I want to assert a constraint of "something must not exist" in z3py. I tried using "Not(Exists(...))". A simple example is as follows. I want to find a assignment for a and b, so that such c does not exist. from z3 import * s = Solver() a =…
Mark Jin
  • 2,616
  • 3
  • 25
  • 37
0
votes
1 answer

quantifier elimination in z3

I am trying to get z3 to simplify the formula ∃u.(u=x)∧(u=y) to (x=y). I tried: (declare-sort A) (declare-const x A) (declare-const y A) (assert (exists ((u A)) (and (= u x) (= u y)))) (apply (then ctx-solver-simplify qe)) but this does not…
szymtor
  • 167
  • 1
  • 7
0
votes
3 answers

Regex: First word of sentence (following another sentence w/ unknown punctuation)

I need regex that will find the word when in all these sentences and any similar iteration. "This is that." When did it happen? (ending in quotes/or FN call) This is that. When did it happen? (note quotes are gone) This is that. When did it…
ideasandstuff
  • 47
  • 1
  • 7
0
votes
0 answers

How to unify variables in SMT-LIB

I am trying to do this in SMT-LIB, running z3 -smt2 script.smt2 on the script containing these expressions: (set-logic AUFLIA) (declare-fun a () Int) (declare-fun b () Int) (declare-fun c () Int) (declare-fun d () Int) (declare-fun e ()…
ndb
  • 127
  • 1
  • 10
0
votes
2 answers

Regex repetition

I'm trying to perform a regex replacement. Therefor I defined the following expression: ^(?:9903[0]*([0-9]*)){20}$ This Expression should match to 99030000000000000001 99030000000000000011 99030000000000000111 …
0
votes
2 answers

Quantifier in Java {n} is taking n+1 input

public static boolean validateState (String state) { return state.matches( "[1-9]\\d{2}-[1-9]\\d{4}" ) ; } Why this function takes 3 digit before hyphen and 5 after hyphen when i have put 2 and 4 in the brackets? Kindly Help..
Usman
  • 306
  • 1
  • 3
0
votes
1 answer

What is the RegEx for this match?

I am trying to match the number before the semicolon but I can't use a quantifier in my lookbehind so I have no idea how to make this work. The string (yes, there are tab spaces in between "item[##]" and "=")