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
1
vote
3 answers

Match last slash if there are at least nth occurrences

I need to replace the last slash if there are 3 or more occurrences. If we've a path like this "/foo/bar/", it should become "/foo/bar". But a path like "/foo/" should not be touched. I tried it with an escaped slash (\/) and a quantifier…
yckart
  • 32,460
  • 9
  • 122
  • 129
1
vote
3 answers

x? quantifer: Why does a non-x give a "zero-length" match?

A quantifier x? means a single or no occurance of x. I am posting a test harness for matching the regex with strings for convenience. I am confused about the regex a? when compared to the string ababaaaab. The output of the program is: Enter your…
Solace
  • 8,612
  • 22
  • 95
  • 183
1
vote
2 answers

Quantifier for Ruby regex grouping

I need a ruby regex to create 11 groups separated by underscores, but to not match at all if there are more than 11 underscores. I also need consecutive underscores to be understood as an "empty" group. Here's what I have so far, which fails to…
raco
  • 67
  • 5
1
vote
1 answer

z3 times out in case of a formula with quantifiers

I am getting timeout on the following example. http://rise4fun.com/Z3/zbOcW Is there any trick to make this work (eg.by reformulating the problem or using triggers)?
dips
  • 1,627
  • 14
  • 25
1
vote
2 answers

how to remember regular expression quantifications?

I have trouble remembering the quantifications, i.e i know what they all mean but does anyone have an easy way to recall which one stands for which ? ? The question mark indicates there is zero or one of the preceding element. * The asterisk…
Ramkumar
  • 143
  • 2
  • 12
1
vote
2 answers

How to use Z3 on formulas with quantifiers over sets?

I have a simple formulas with quantifiers over sets of arrays, Z3(4.3.2) returns "unknown". (assert (forall ((a (Array Int Int)) (b (Array Int Int))) (=> (forall ((i Int)) (= (select a i) (select b i))) (= a b)))) (check-sat) The verbose…
Tianhai Liu
  • 795
  • 5
  • 10
1
vote
1 answer

How to define 'Most' in Isabelle/FOL?

I am trying to augment FOL.thy with the quantifier MOST, which I intend to define as the simple majority, i.e., (MOST x. P(x)) ==> card P(x) > card ~P(x). I am not sure how to modify the FOL.thy file. Under axiomatization, I thought to add: Most ::…
1
vote
2 answers

Just a universally quantified hypotesis in coq proof

Another hard goal (for me, of course) is the following: Goal ~(forall P Q: nat -> Prop, (exists x, P x) /\ (exists x, Q x) -> (exists x, P x /\ Q x)). Proof. I absolutely have no idea of what could I do. If I introduce something, I get a…
1
vote
1 answer

Java regex possesive quantifiers

Given this regex: x[^x]*+x and this input string for matching: xbbbx The result is the matched text xbbbx starting at index 0 and ending at index 5. But, by only changing the last letter x to Z in both the regex and the string, we get this…
Pedja
  • 125
  • 7
1
vote
1 answer

The correct syntax of a quantifier in a regular expression pattern with grep in Solaris?

I have to search in many files with several lines, the lines with a telephone number of exactly ten digits. Examples of the lines: telephoneNumber: 66727166501 telephoneNumber: 6672716650 telephoneNumber: 66727166 telephoneNumber: 6672716651 So…
1
vote
1 answer

Regex: possessive quantifier for the star repetition operator, i.e. \d**

From the GLib Reference Manual, section "Regular expression syntax", subsection "Atomic grouping and possessive quantifiers": Consider the pattern \d+foo when applied to the string 123456bar: after matching all 6 digits and then failing to match…
sp00m
  • 47,968
  • 31
  • 142
  • 252
1
vote
1 answer

Quantifier elimination for enumeration types in Z3

I'm experimenting with quantifier elimination tactic for formulas of enumerated types. I'd like to know if there are any ways of increasing the performance by adjusting the solver somehow. After a brief glance over the source code I concluded that…
Egbert
  • 157
  • 9
1
vote
1 answer

Does Z3 v4.3+ support quantifier elimination for NON-linear arithmetic

I could not find out what kind of quantifier elimination Z3 fully supports. What I have is a universally quantified formula over -in general- non-linear terms. I would like to obtain an equivalent quantifier free formula. Is that possible with…
Friedrich Gretz
  • 535
  • 4
  • 14
1
vote
3 answers

Is there any difference between `{m}` and `{m}?` quantifiers?

Please give an example where the difference between greedy and lazy versions of "repeat-exactly-m-times" quantifier can be seen. The question arose from here and here. If there are no differences then what for the {m}? quantifier exists?
Egor Skriptunoff
  • 23,359
  • 2
  • 34
  • 64
1
vote
1 answer

Tools for quantifier elimination in linear integer arithmetic

Are there any other available (and still supported) SMT tools that perform quantifier elimination for linear integer arithmetic besides Z3? Thanks.
Egbert
  • 157
  • 9