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
5
votes
2 answers

* quantifier in Perl 6

This seems to be something very basic that I don't understand here. Why doesn't "babc" match / a * / ? > "abc" ~~ / a / 「a」 > "abc" ~~ / a * / 「a」 > "babc" ~~ / a * / 「」 # WHY? > "babc" ~~ / a + / 「a」
Eugene Barsky
  • 5,780
  • 3
  • 17
  • 40
5
votes
1 answer

Quantifier range not working in lookbehind

Okay so I'm working on a project where I need a regex that can match a * followed by 1-4 spaces or tabs and then followed by a row of text. Right now I'm using .* after the lookbehind for testing purposes. However I can get it to match explicitly 1,…
Hultner
  • 3,710
  • 5
  • 33
  • 43
5
votes
1 answer

Proof by counterexample in Coq

After proving tens of lemmas in propositional and predicate calculus (some more challenging than others but generally still provable on an intro-apply-destruct autopilot) I hit one starting w/ ~forall and was immediately snagged. Clearly, my…
jaam
  • 900
  • 4
  • 23
5
votes
1 answer

Regex, group & quantifyer

I just did the funny regex crosswords at http://regexcrossword.com/ - and found out I don't understand what quantifying groups means, e.g. (.)+ or (.)* Let me try at http://ole.michelsen.dk/tools/regex.html , it offers the JavaScript and the PHP…
Falko
  • 1,028
  • 1
  • 12
  • 24
4
votes
2 answers

CUDD: Quantification of ZDDs

I'm working with CUDD (https://github.com/ivmai/cudd) to use bdd and zdd functionality for model checking, and am wondering how i can quantify over zdds. For bdds there are the functions bddExistAbstract and bddUnivAbstract (see…
4
votes
3 answers

Two greedy quantifiers in the same regex

If I have an unknown string of the structure: "stuff I don't care about THING different stuff I don't care about THING ... THING even more stuff I don't care about THING stuff I care about" I want to capture the "stuff I care about" which will…
noah
  • 2,616
  • 13
  • 27
4
votes
1 answer

Understanding quantifier traversing in Z3

I'm trying to understand traversing quantified formula in z3 (i'm using z3py). Have no idea how to pickup the quantified variables. For example in code shown below i'm trying to print the same formula and getting error. from z3 import * def…
Pushpa
  • 448
  • 3
  • 10
4
votes
1 answer

Difference between `Z3_mk_forall` and `Z3_mk_forall_const` in C API for Z3?

I am confused by the 2 functions. They seem to take about the same set of arguments (one straightforwardly convertible to another) and each returns an AST. Do the functions do the same thing? If not, when do I need each? Signatures of the 2: Z3_ast…
Phil
  • 5,595
  • 5
  • 35
  • 55
4
votes
2 answers

List of polymorphic functions in haskell?

Consider the code below: t1 :: [Int] -> (Int,String) t1 xs = (sum xs,show $ length xs) t2 :: [Int] -> (Int,String) t2 xs = (length xs, (\x -> '?') <$> xs) t3 :: [Int] -> (Char,String) t3 (x:xs) = ('Y',"1+" ++ (show $ length xs)) t3 [] =…
Jules
  • 14,841
  • 9
  • 83
  • 130
4
votes
1 answer

Use Z3 to determine difficulty of quantifier elimination for BV-queries

I'm currently using the Z3 C++ API for solving queries over bitvectors. Some queries may contain an existential quantifier at the top level. Often times the quantifier elimination is simple and can be performed by Z3 quickly. However, in those cases…
bdh
  • 63
  • 5
4
votes
1 answer

Why is my regex capture group only capturing the last part of the string when it matches multiple parts?

What I Tried var test = "asdfdas ABCD EFGH"; var regex = /^\S+( [A-Z]{4})+$/; // Also tried: /^\S+( [A-Z]{4})+$/g // And: /^\S+( [A-Z]{4})+?$/g var matches = test.match(regex); I made a JSFiddle. What I Expect The variable matches should…
NoBrainer
  • 5,853
  • 1
  • 27
  • 27
4
votes
1 answer

Are there any value-level logical quantifers in Haskell?

I was working on an abstract algebra library for Python, when I realized that a lot of the dirty work was just constructing loops to correspond to logical expressions with quantifiers. I then realized, while it might be hard to implement a function…
Nathan BeDell
  • 2,263
  • 1
  • 14
  • 25
4
votes
4 answers

Universal and existential quantification using C++ template magic

Is there a way to implement universal and existential quantification using C++ template magic (maybe using SFINAE etc.)? Something like this: template < template class Predicate > struct UniversalQuantification { …
Constructor
  • 7,273
  • 2
  • 24
  • 66
4
votes
3 answers

Encoding versus using an existential type when encoded as a universal

I'm trying to better understand the nuances of encoding versus using an existential type after we transform it into a universal. In short, it appears to me that using an existential type is much easier than encoding one and I'll explain what that…
wyer33
  • 6,060
  • 4
  • 23
  • 53
4
votes
3 answers

What exactly does the *+ quantifier do?

The idea of lazy and greedy are easy to understand, but I have only seen/used *+ once in my regex (in Java) [A]|[^B]*+(?!C) (A,B,C are arbitrary values) simply because it worked when the lazy modifier resulted in a StackOverflow error. Because of…
Song Gao
  • 666
  • 4
  • 14
1
2
3
15 16