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

How to precisely identify & work greedy or reluctant quantifiers?

Given: import java.util.regex.*; class Regex2 { public static void main (String args[]) { Pattern p = Pattern.compile(args[0]); Matcher m = p.matcher (args [1]); boolean b = false; while (m. find()) { …
Nilay Panchal
  • 541
  • 6
  • 17
0
votes
2 answers

Groups and quantifiers {m,n}

Is it possible to use quantifiers with groups? For example. I want to match something like: 11% 09% aa% zy% g1% 8b% ... The pattern is: 2 letters or numbers (mixed, or not) and a % ending the string ...
Thom Thom Thom
  • 1,279
  • 1
  • 11
  • 21
0
votes
0 answers

Code rewrite in Z3 with quantifiers

guys I'm writing a model using Microsft Z3 and I need to add the following assertions to it: (declare-const line (Array Int Int)) (assert (and (> (select line 1) 0) (< (select line 1) 4))) (assert (and (> (select line 2) 0) (< (select line 2)…
Daniel
  • 95
  • 8
0
votes
1 answer

Universal qauntification hypothesis in Coq

I want to change the hypothesis H from the form below mL : Map mR : Map H : forall (k : RecType) (e : String.string), MapsTo k e (filter (is_vis_cookie l) mL) <-> MapsTo k e (filter (is_vis_cookie l)…
Khan
  • 303
  • 2
  • 14
0
votes
2 answers

Regex Quantifier on Alternatives(vertical bar "|")

I want to trim a string if it starts and/or ends with foo or bar for example and want to get the inner string in a regex group. For example "fooTestbar" should be "Test", "Test2bar" should be "Test2" and "Test3" should be "Test3". My current regex…
Tearsdontfalls
  • 767
  • 2
  • 13
  • 32
0
votes
1 answer

First Order Logic Statement for Proof. Manipulating Quantifiers

Ok, I have the given relation: If F(x) is not true then no case satisfies G(x) and H(y,x). ((∀x ¬F(x)) ⇒¬(∀y G(y) ˄ H(y,x))) Now, Can I possibly convert this into: (∀y G(y) ˄ H(y,x))) ⇒ ((∀x F(x)) ???? If not, the left hand side essentially has to…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
0
votes
0 answers

python regex: match a group more than once

Possible Duplicate: Python regular expressions - how to capture multiple groups from a wildcard expression? python regex of group match I know there are better or easier ways to do this, but as I tried it myself and it did not work I am…
Rafael T
  • 15,401
  • 15
  • 83
  • 144
0
votes
1 answer

Z3 .NET API for existence quantifier

I am trying to use Z3 .net API to get an existence quantifier expr. Following are my code: RealExpr c = ctx.MkRealConst("c"); BoolExpr Eqzero = ctx.MkGt(c,ctx.MkReal(0)); BoolExpr Gezero = ctx.MkGe(c,ctx.MkReal(0)); BoolExpr Lttwo =…
user1402725
  • 87
  • 2
  • 8
-1
votes
3 answers

JavaScript Regular Expression with character class quantifier variable

I am trying to create a regular expression with a character class that has a specific quantifier which is a variable for example: var str = "1234.00"; var quantifier = 3; str = str.replace(/(\d)(\d{quantifier}\.)/,"$1,$2"); //str should be…
your friend
  • 1
  • 1
  • 3
-1
votes
3 answers

javascript regex invalid quantifier error

I have the following javascript code: if (url.match(/?rows.*?(?=\&)|.*/g)){ urlset= url.replace(/?rows.*?(?=\&)|.*/g,"rows="+document.getElementById('rowcount').value); }else{ urlset=…
James
  • 3,765
  • 4
  • 48
  • 79
-1
votes
1 answer

Regex optional group fails whole search

I'm stuck with something obvious which I can't make working: There is a text like: ".... blah-blah-blah... Grupper blah-blah-blah Butik ...". Grupper is an optional token - can be omitted in text and Butik - is mandatory. So it should match Grupper…
Dada
  • 121
  • 6
-1
votes
1 answer

How do I impose a condition that must be satisfied by *any two* members of a set?

I want to use python to define one set in terms of another, as follows: For some set N that consists of sets, define C as the set such that an element n of N is in C just in case any two elements of n both satisfy some specific condition. Here is…
Al_Gebra
  • 3
  • 1
-1
votes
1 answer

Predicate logic of "cats have tails"

what is predicate logic of "cats have tails" or "if x is a cat then x has tail" which one of the following is correct: cat(x) -> hastail(x) ∀x cat(x) -> hastail(x) are both of them correct? does both make same sense ? if any of the above statement…
mr_beginner
  • 145
  • 1
  • 9
-1
votes
1 answer

Regex: quantifying the same character

How can I match the repetition of a character n times? For example with this sample text abcdddd123 123456777xssx I want to match the three consecutive 7 and the three consecutive d I've tried with .{3} But the quantifier {3}, as well as other…
skan
  • 7,423
  • 14
  • 59
  • 96
-1
votes
4 answers

How do you "quantify" a variable number of lines using a regexp?

Say you know the starting and ending lines of some section of text, but the chars in some lines and the number of lines between the starting and ending lines are variable, á la: aaa bbbb cc ... ... ... xx yyy Z What quantifier do you use,…
1 2 3
15
16