laurelang
laurelang copied to clipboard
A pure logical, compact language. (Research)
``` : ? married(person, person). ? married(p1_uid, p2_uid) { db:Marriage(partner_id=p1_uid, partner2_id=p2_uid); }% ? married(p1_uid, p2_uid) { married(p2_uid, p1_uid); } $ InMarriage { person(name, _) person_1; person person_2; } where {...
New notation for predicates: ``` : #lt(int) -> int. #lt(x) -> y when y < x. int[] a = [1,2,3,4,5]. a = lt(5)[]. num = 1 .. a[3]; num[][] list;...
# Predicate determinators Sometimes predicate may have multiple meanings and an ability to set non-logical determinators when calling the predicate or constructing new bound predicate instance would be useful. #...
**Expected and real behaviour**: query `as_boolean(prime, x) = @false` must produce only natural solutions for `x` due to prime signature `?prime(natural)`. but it also produces integer results. **How to reproduce**:...
```laurelang (map_abs(arr) = x) ~ (map(arr, absolute) = x) ```
# Matrix ``` : ?transpose('T'[x][y]) -> 'T'[y][x]. ``` To make size variables invisible in predicate case's scope their names should start with underscore, such as `_x`. > Implementation. After such...
``` $ structure { string name; 'T' field1; 'T'[] field2; } ```
Example: ``` : ?divmod(int, int) -> ${int div; int mod}. ```