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
1 answer

Dafny invalid Ident

I am getting an invalid Ident error in the forall line (from is to the first i), does anybody know why? This is unusual. predicate SumMaxToRight(v:array,i:int,s:int) reads v requires 0<=i
Theo Deep
  • 666
  • 4
  • 15
1
vote
4 answers

TypeError: unsupported operand type(s) for /: 'str' and 'int' for

I am using python 3.7 My list data looks like this [['file1.o', '.text', '0x30'], ['file2.o', '.initvector', '0x36'], ['15', '31', '0x72']] My code For parsing the file c = re.compile("^\w+.*(\w+)\s+([\.\w]+)\s+([\w\.]+).*$") Printing to a csv…
1
vote
1 answer

Complex quantifiers in Idris?

Now I know, it's possible to express quantifiers via dependent types. So I wrote a simple realization for this "for all (a, b: N): exists (c: N): c = a + b": f : (a : Nat) -> (b : Nat) -> (c : Nat ** c = a + b) f a b = (a + b ** Refl) and it…
R. Shirkhanov
  • 367
  • 3
  • 6
1
vote
0 answers

Using ST with polymorphic test 'templates' using QuickCheck

I have a class that has an associated monad, so that instances can be created for different monads. class MutRef a where type MutRefM a :: * -> * type MutRefVal a readMutRef :: a -> MutRefM a (MutRefVal a) writeMutRef :: a -> MutRefVal a ->…
Ari Fordsham
  • 2,437
  • 7
  • 28
1
vote
1 answer

RewriteRule: which regex quantifier are permitted?

I'd like to know if I can use a quantifier {x} in order to define a RewriteRule. RewriteRule ^([0-9]{3})([0-9]{2})-page/?$ /www/page.php?firstId=$1&secondId=$2 Can I write something like this? Thanks for answers
1
vote
1 answer

How is the scope of a nested universal quantifier determined (higher-rank types)?

Originally I assumed the scope of a nested universal quantifier on the LHS of a function type can be determined purely syntactical, i.e. everything inside the parenthesis of (forall a. a -> b) -> Bool is within the same scope. However, this…
1
vote
2 answers

Z3 Forall with array

Z3 provides unknown for the simple problem: (assert (forall ((y (Array Int Int))) (= (select y 1) 0)) ) (check-sat) I've found that it becomes sat if negate the forall, but this seems like a particularly simple thing to be unable to solve. This…
Dval
  • 352
  • 1
  • 10
1
vote
0 answers

Regex Lookbehind with quantifiers

I had the case to set together letters with length one when they were separated by just space, very straightforward. So I applied the following regex pattern: res = re.sub(r'(?<=\b[A-Za-z]\b)\s+(?=[a-zA-Z]\b)|\s+$', '', …
John Barton
  • 1,581
  • 4
  • 25
  • 51
1
vote
1 answer

z3py dies trying to do quantifier elimination

I have a Python program in which I generate different z3 formulas, then I do existential quantification on some of them. My program used to work fine, but all of a sudden it started to die trying to do quantifier elimination on some of the…
Zeinab Ganjei
  • 123
  • 1
  • 9
1
vote
4 answers

Populating Automatic Perl Variables when using Quantifiers

I was trying to match the following line 5474c2ef012a759a c11ab88ae8daa276 63693b53799c91f1 be1d8c8738733d80 with if(/[[:xdigit:]{8}[:xdigit:]{8}\s]{4}/) Is there anyway I populate the automatic variables $1,$2,$3..$8 etc with half of…
Jean
  • 21,665
  • 24
  • 69
  • 119
1
vote
2 answers

alternative greedy match

I want to make a greedy match to an alternative of either zero to 'm' consecutive occurences of 'a' or zero to 'n' consecutive occurences of 'b'. If I do /a{,m}|b{,n}/ it will not work because when I have sequences of 'b', it will match with…
sawa
  • 165,429
  • 45
  • 277
  • 381
1
vote
1 answer

Existential and Universal quantifiers in DBMS

I understand what they are and I have seen examples regarding these. One such example is {t.Fname,t.Lname|Employee(t) AND (∃d)(Department(d) AND d.Dname='Research' AND d.Dnumber=t.Dno)} Now what is the difference between above and…
Prabhat
  • 2,261
  • 7
  • 46
  • 74
1
vote
0 answers

How to establish uniqueness of atoms that satisfy Prolog predicate?

I want to represent in a knowledge base that foo(X) for only one value of X. Basically, a statement that foo(X), foo(Y) implies that X \= Y. But Prolog insists on backward chaining, or an "is implied by" relation. I don't know how to code that.
Lori
  • 1,392
  • 1
  • 21
  • 29
1
vote
1 answer

Is ∃x∈S(P (x)) shorthand for ∃x(x ∈ S ∧ P (x)) or ∃x(x ∈ S → P (x))?

In Discrete mathematics and its applications Book by Kenneth H. Rosen In chapter 2 setction 2.1(page no 124 in pdf) "Using Set Notation with Quantifiers Sometimes we restrict the domain of a quantified statement explicitly by making use of…
Dipok Dipu
  • 321
  • 1
  • 3
  • 6
1
vote
0 answers

z3 generates power-set model - don't understand

I'm working on proving satisfiability and reviewing models of a FOL theory. I'm trying to understand why sometimes z3 takes too long to build a model when I add a seemingly innocuous assertion to a previous set of assertions for which a model is…
alanr
  • 21
  • 3